I do not want to deal with any mail on my server. All I want is for my something like me@allmydomains.tld to forward to me@gmail.com
mydestination vs virtual_alias_domains I have read probably 10 tutorials and some say to list all my domains under mydestination and others say to list them all under virtual_alias_domains. So which is it?
aliases vs virtual Again, many tutorials talk about setting up forwarding in the /etc/postfix/aliases file and others talk about doing it in /etc/postfix/virtual so I’m again lost as to which I should be using?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Typically you would only use virtual_mailbox_domains etc, if you are hosting more than one domain on the same server. If you are hosting more than one domain use virtual domains, if not then use mydestination. If you are hosting multiple domains the I normally set mydestination to be the FQDN of the server i.e. mailserver.example.tld (as opposed to example.tld for a single domain server). It’s probably a good idea to add localhost to your mydestination.
Virtual alias domains do a 1 to 1 mapping of the local part (the bit before the @ symbol in an email address) of the virtual domain to it’s target domain but ONLY IF the local part is listed in one of the virtual_alias_maps (you can have none or more maps; separated by commas). These maps (or map) can have various backends; file, hash file, ldap, sql etc.
So in your can you’d probably want to do something like this (a name like <name> can be replaced with anything (don’t actually add the angle brackets!));
main.conf
virtual_alias_maps = hash:/etc/postfix/<filename>
/etc/postfix/<filename> virtual-alias.domain anything me@allmydomains.tld me@gmail.com
The first entry in the virtual_alias_maps file must have the keyword “virtual-alias.domain” in the first entry. The second entry can be anything as it is disregarded.
After that put all the fully qualified aliases and their destination in the first and second entries respectively. Once you have all the entries entered then run
Whatever you do don’t put allmydomains.tld (or any of your other virtual_alias_domains) in either the mydestination or relay_domains config entries; it will break.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.