Solution found.
For iRedOS 5.0:
1. Create new table in database vmail:
CREATE TABLE `vmail`.`common_alias` (
`address` VARCHAR(128) NOT NULL COMMENT 'Received base address (without domain part)',
`goto` VARCHAR(128) NOT NULL COMMENT 'Where to redirect (domain part MUST be included)',
`created` DATETIME DEFAULT NULL,
`modified` DATETIME DEFAULT NULL,
`expired` DATETIME NOT NULL DEFAULT '9999-12-31 00:00:00',
`active` BOOLEAN NOT NULL DEFAULT 0,
PRIMARY KEY (`address`)
)
ENGINE = MyISAM
CHARACTER SET utf8 COLLATE utf8_general_ci
COMMENT = 'Common aliases for all domains';
2. Populate the above table with the values you need, for example:
INSERT INTO `common_alias` SET `address`='postmaster', `goto`='postmaster@example.com', `created`=NOW(), `modified`=NULL, `expired`='9999-12-31 00:00:00', `active`=1;
INSERT INTO `common_alias` SET `address`='abuse', `goto`='abuse@example.com', `created`=NOW(), `modified`=NULL, `expired`='9999-12-31 00:00:00', `active`=1;
INSERT INTO `common_alias` SET `address`='hostmaster', `goto`='hostmaster@example.com', `created`=NOW(), `modified`=NULL, `expired`='9999-12-31 00:00:00', `active`=1;
INSERT INTO `common_alias` SET `address`='webmaster', `goto`='webmaster@example.com', `created`=NOW(), `modified`=NULL, `expired`='9999-12-31 00:00:00', `active`=1;
3. Create file /etc/postfix/mysql_virtual_common_alias_maps.cf, with the following contents:
user = vmail
password = your_password_here
hosts = 127.0.0.1
port = 3306
dbname = vmail
query = SELECT goto FROM common_alias WHERE address = '%u' AND active='1' AND expired >= NOW() AND '%d' IN (SELECT domain FROM domain WHERE domain='%d');
Be sure to modify "your_password_here" with your real password for user vmail.
4. Modify the entry in /etc/postfix/main.cf to include the new map:
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_common_alias_maps.cf, mysql:/etc/postfix/mysql_virtual_alias_maps.cf
If you use proxymap, adapt it for proxymap.
5. Test it.
P.S.
ZhangHuangbin, you should include this in the next version/hotfix.