Addition/MySQL/Catch-all

From iRedMail
(Difference between revisions)
Jump to: navigation, search

Revision as of 19:02, 30 December 2013

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 catch-all account for existing domain 'domain.ltd' in vmail.alias table, like this:
Terminal:
$ mysql -uroot -p
mysql> USE vmail;
mysql> INSERT INTO alias (address, goto, domain) VALUES ('@domain.ltd', 'dest@example.com', 'domain.ltd');

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