I decided to do a couple of tweaks on my Postfix mail server tonight. ![]()
I decided to add support for virtual domain aliasing ‘coz I want to move some of my domain email accounts to my VPS. Since I’m already spending some amount of money for a VPS, I thought that why don’t I just make the most of it. Currently, I’m hosting some of my email accounts with GoDaddy’s email services but now I’m planning to move everything to my VPS account. It’s true that paying for a 3rd party email provider would be a bit more reliable, but then again putting my Unix/Linux knowledge into good use might also provide the same reliability.
Anyway, in order to add virtual domain aliasing support for postfix, you just need to add the following lines in your main.cf file:
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = example.net,example.org
You then have to add the virtual alias maps to /etc/postfix/virtual file:
[email protected] exampleuser
[email protected] exampleuser
The lines:
[email protected] exampleuser
[email protected] exampleuser
maps email address from the virtual domains ([email protected] and [email protected]) to a unix user in your system (exampleuser) . So on this example, let’s say that your default domain is example.com, emails sent to [email protected] and [email protected] would go to user exampleuser.
After all the configurations, you need to execute the following commands for the changes to take effect:
postmap /etc/postfix/virtual # To rebuild the virtual domain alias db
postfix reload # For changes on main.cf to take effect on the postfix service
That’s it! ![]()
Just try sending an email to [email protected] and then check if it arrives on your exampleuser account. If anything goes wrong, well there’s always the Postfix site to find some more detailed documents or just post your comments here and let’s see if I can help. ![]()
Popularity: 3% [?]