mirroring one domain.tld to domain.tld.au
I have Postfix/Dovecot/postfixadmin/MySQL with several virtual mailbox domains one of the domains is like aname.com.au, the user also now has aname.com, and, would like to 'mirror' most of the addresses to be u...@aname.com, THOUGH, some are to remain as us...@aname.com.au so, both u...@aname.com as well as u...@aname.com.au should be one user what's the best/proper way to do so ? I think there is an option in postfixadmin to "Mirror addresses of one of your domains to another." , is that the way to do this? thanks for any pointers, suggestions or advice mail_version = 2.11.0 virtual_minimum_uid = 2000 virtual_uid_maps = static:2000 virtual_gid_maps = static:2000 virtual_mailbox_base = /var/vmail virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf
Re: mirroring one domain.tld to domain.tld.au
On 09/29/2015 03:41 AM, Voytek wrote: > I have Postfix/Dovecot/postfixadmin/MySQL with several virtual mailbox > domains > > one of the domains is like aname.com.au, the user also now has aname.com, > and, would like to 'mirror' most of the addresses to be u...@aname.com, > THOUGH, some are to remain as us...@aname.com.au > > so, both u...@aname.com as well as u...@aname.com.au should be one user > > what's the best/proper way to do so ? > > I think there is an option in postfixadmin to "Mirror addresses of one of > your domains to another." , is that the way to do this? The option in postfixadmin simply adds the domain alias to a table that you designate, you still need to tell postfix how to use that table. The way that I would do it, given that you're using mysql, is to alter your virtual_alias_maps query so that it's a UNION between the two tables. This is what I have for postgresql, you'll need to tweak it a bit to work for mysql and for your specific tables: query = (SELECT goto FROM alias WHERE address='%s' AND active) UNION (SELECT goto FROM (SELECT '%u@' || target_domain goto FROM alias_domain WHERE alias_domain = '%d' AND active) AS a WHERE (goto IN (SELECT username FROM mailbox WHERE active) OR goto IN (SELECT address FROM alias WHERE active))) Peter
Re: mirroring one domain.tld to domain.tld.au
On Tue, Sep 29, 2015 at 12:29:29PM +1300, Peter wrote: > query = (SELECT goto FROM alias WHERE address='%s' AND active) > UNION (SELECT goto FROM (SELECT '%u@' || target_domain goto > FROM alias_domain WHERE alias_domain = '%d' AND active) AS a > WHERE (goto IN (SELECT username FROM mailbox WHERE active) OR > goto IN (SELECT address FROM alias WHERE active))) I don't think this meets the OP's needs. He seems to want only some of the addresses in the target domain aliased. For that, those and only those addresses should be listed in the virtual alias table (whether file based or SQL): virtual: user1@alias.example user1@target.example user2@alias.example user2@target.example Plus an appropriate setting of virtual_alias_maps. -- Viktor.
Re: mirroring one domain.tld to domain.tld.au
On September 29, 2015 1:30:09 AM Peterwrote: query = (SELECT goto FROM alias WHERE address='%s' AND active) UNION (SELECT goto FROM (SELECT '%u@' || target_domain goto FROM alias_domain WHERE alias_domain = '%d' AND active) AS a WHERE (goto IN (SELECT username FROM mailbox WHERE active) OR goto IN (SELECT address FROM alias WHERE active))) Peter it is dokumented how to setup domain alias in postfixadmin, read the docs, its not working with a single query