Addition/MySQL/Catch-all
From iRedMail
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.
