Postfix SMTP Mail Relay Server (on Ubuntu 8.04)
Here is how to configure Postfix to relay all incoming mail to another mail server (main mail server)
1. Edit main.cf
#mydestination = $mydomain
relayhost = your.main.mail.server.com
relay_domains = $mydomain
virtual_alias_maps = hash:/etc/postfix/virtual
relay_recipient_maps = hash:/etc/postfix/relay_recipients
local_recipient_maps =
transport_maps = hash:/etc/postfix/transport
2. You should create and hash tree files:
—-
virtual –> virtual users mailbox
relay_recipients –> accepted relay addresses
transport –> smtp transport address
—-
Just like this:
— virtual —
# user mail
info info@mymail.address.com
— /virtual —
— relay_recipients —
# mail stat
info@mymail.address.com OK
— /relay_recipients —
— transport —
# domain smtp forward
mymail.address.com smtp:[your.main.mail.server.com]
— /transport —
3. Hash all these tree files:
cd /etc/postfix
postmap virtual
postmap relay_recipients
postmap transport
after correct hashing you should have three files.db
4. Reload postfix /etc/init.d/postfix reload
5. See SMTP traffic log in front mail server and mail server. e.g: tail -f /var/log/mail.log
6. Enjoy :)
This was helpful. Thanks for taking the time and sharing.