Postfix mail forwarder
- by Andrew
Hello,
I just bought a dedicated server and I'm trying to install a webserver on it.
The server is Ubuntu 10.04. I installed ftp, nginx, php, mysql, bind and now I have to install mail server.
For the mail server I'm using Postfix, because it's recomended on ubuntu.
I installed Postfix with apt-get install postfix but mail() function from php wasn't working. After a little debug I found the way to solve this : I created an empty file /etc/postfix/main.cf and it worked good.
I do have a mx record like this
mail 5M IN A xxx.xxx.xxx.xxx
example.com. 5M IN MX 1 mail.example.com.
After that I wanted to forward all e-mails to my GMail address.
So I googled for it and I found in the official docs Virtual Domain Host Forwarding
I added these lines in main.cf
virtual_alias_domains = example.com
virtual_alias_maps = hash:/etc/postfix/virtual
I created map file and I placed this line in it
@example.com [email protected]
I run in terminal
postmap /etc/postfix/virtual
postfix reload
The result: I can send e-mail from php with mail() function, but when I send an email to [email protected] that e-mail isn't forwarded to my Gmail.
How to solve this?
-Andrew
I also tried this but not working http://rackerhacker.com/2006/12/26/postfix-virtual-mailboxes-forwarding-externally/
It works now! But I don't know what the problem was.
I just installed "Mail Server" from Tasksel and after that it worked fine.
Can anyone tell me what Tasksel installed or that it changed ?