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 user@aname.com, THOUGH, some are to remain as user2@aname.com.au
so, both user@aname.com as well as user@aname.com.au should be one user
the users retrive emails as user@aname.com.au
longer term... some would want to use aname.com.au. some, aname.com
what's the best/proper way to do so in Dovecot ?
I think I can do Postfix with postfixadmin to "Mirror addresses of one of your domains to another."
but what do I do at the Dovecot end...?
thanks for any pointers, suggestions or advice
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 29 Sep 2015, voytek@sbt.net.au 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 user@aname.com, THOUGH, some are to remain as user2@aname.com.au
so, both user@aname.com as well as user@aname.com.au should be one user
the users retrive emails as user@aname.com.au
longer term... some would want to use aname.com.au. some, aname.com
what's the best/proper way to do so in Dovecot ?
I think I can do Postfix with postfixadmin to "Mirror addresses of one of your domains to another."
I cannot help you with Postfix, but:
you wrote: .../Dovecot/.../MySQL are all users storred in SQL? If so:
make all lookups for userXYZ@aname.com.au and userXYZ@aname.com return the same data without relying on %u and %d, even for default values, for both passdb and userdb.
In this case, you do not need to worry about the change for Dovecot and Postfix.
====
If you tweak Postfix to deliver to just one domain, you can tweak Dovecot to change the domain name in passdb lookups, in order to use the other domain in userdb queries, however, message delivery needs to use the domain in userdb only, see:
http://wiki2.dovecot.org/AuthDatabase/SQL
password_query = SELECT ..., userid AS user
^^^^^^^^^^
FROM users WHERE userid = '%Lu' OR userid2 = '%Lu';
^^^^^^^^^^ Match the user for both domains
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEVAwUBVgoxXXz1H7kL/d9rAQIvXAgAv4e+x+klD1qAeTUONmTlNEnUEq2hRvRs cd3VsEdrK925AHXSHtwasV97ZkBxRE+dNBpn+cGKT26m/E5UP9LgJCZXrypmMVjk ql3Z1h00thsTyzc+SJS5MIULpdmuuPP14QndvAnHpxuY5/c/hnwPTibi2fwXJm7E d6Pf3w7IARl4gJv96GbSfGnDsiuu508P1PyqJhFWEf0nTnf+tFzIO7sa7Yb1Ubep DPclzP2Cobd6rFiUTC/lp+r4sv/QmbeOT4G/7CkExbrFo0fQD8mb4qe9a3AnQBsu 5Fscmkt5HWWaLYj3pLDMiLd5DxpMbzilxDttoRqvsTutngArbDgPTA== =U7Gw -----END PGP SIGNATURE-----
On 28.09.2015 16:47, voytek@sbt.net.au 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 user@aname.com, THOUGH, some are to remain as user2@aname.com.au I usually do this by having 4 tables in mysql: hosting (links everything together, links to a product table, quota, what ever) domains (domainnames) accounts (homedir, password, etc.) usernames
- one hosting has many accounts
- one hosting has many domains (domain aliases)
- one account has many usernames (localpart aliases for same account)
then you can match like anything you want out of this and you use similar queries for postfix and dovecot.
in the domains table you could have a column boolean "maindomain" and in the account table you have a column "maindomain_only"...
for my use, users don't care if there are other alias combinations - they just don't use it then. but they can login with any combination of <account usernames>@<hosting domainnames> and it's still only one mail directory per account. it's also a good idea to name the maildirectory like <hosting_id>/<account_id>, so you don't have the domain / username hardcoded anywhere.
just some thoughts, works great for me - but depends on your exact use case. you can do like anything you want in SQL for postfix and dovecot.... keep performance in mind though :-)
so, both user@aname.com as well as user@aname.com.au should be one user
the users retrive emails as user@aname.com.au
longer term... some would want to use aname.com.au. some, aname.com
what's the best/proper way to do so in Dovecot ?
I think I can do Postfix with postfixadmin to "Mirror addresses of one of your domains to another."
but what do I do at the Dovecot end...?
thanks for any pointers, suggestions or advice
participants (3)
-
Marco Fretz
-
Steffen Kaiser
-
voytek@sbt.net.au