Addition/MySQL/Catch-all

From iRedMail

(Difference between revisions)
Jump to: navigation, search
(Created page with 'TO BE CONTINUED')
 
Line 1: Line 1:
-
TO BE CONTINUED
+
Note: This feature was added in iRedMail-0.6.1.
 +
 
 +
iRedMail-0.6.0 and eariler versions with MySQL backend doesn't support catch-all account by default, which stored in MySQL. but you can implement it with below steps:
 +
 
 +
* Edit /etc/postfix/mysql_virtual_alias_maps.cf:
 +
{{cfg|/etc/postfix/mysql_virtual_alias_maps.cf|<pre>
 +
# ---- OLD SETTING ----
 +
query      = SELECT goto FROM alias WHERE address='%s' AND active='1'
 +
 
 +
# ---- NEW SETTING ----
 +
query      = SELECT goto FROM alias WHERE (address='%s' OR address='@%d') AND active='1'
 +
</pre>}}
 +
 
 +
* Restart postfix.
 +
 
 +
* Now you can add domain catch-all address in '''vmail.alias''' table, like this:
 +
{{cmd|<pre>
 +
$ mysql -uroot -p
 +
mysql> USE vmail;
 +
mysql> INSERT INTO alias (address, goto) VALUES ('@domain.ltd', 'dest@example.com');
 +
</pre>}}
 +
This mysql command creates catch-all address for domain '''domain.ltd''', all mails sent to non-exist accounts will be delivered to '''dest@example.com'''.

Current revision as of 00:56, 3 August 2010

Note: This feature was added in iRedMail-0.6.1.

iRedMail-0.6.0 and eariler versions with MySQL backend doesn't support catch-all account by default, which stored in MySQL. but you can implement it with below steps:

  • Edit /etc/postfix/mysql_virtual_alias_maps.cf:
File: /etc/postfix/mysql_virtual_alias_maps.cf
# ---- OLD SETTING ----
query       = SELECT goto FROM alias WHERE address='%s' AND active='1'

# ---- NEW SETTING ----
query       = SELECT goto FROM alias WHERE (address='%s' OR address='@%d') AND active='1'
  • Restart postfix.
  • Now you can add domain catch-all address in vmail.alias table, like this:
Terminal:
$ mysql -uroot -p
mysql> USE vmail;
mysql> INSERT INTO alias (address, goto) VALUES ('@domain.ltd', 'dest@example.com');

This mysql command creates catch-all address for domain domain.ltd, all mails sent to non-exist accounts will be delivered to dest@example.com.

Personal tools