I had a problem setting up PostFix only for aliases use. Let me first explain what I did:
1) I went to the domain name control panel where our DNS is hosted, and created a new sub domain called it m.example-mydomain.com (and i pointed it to the server IP), then went to the MX records (Mail records) and then, there I created a new sub domain, pointed it to m.example-mydomain.com. The end result, when a mail server such as google, attempts to send an email to [email protected], it will be looked up in our DNS and will be redirected to the proper IP address.
2) I logged in to the machine and installed postfix using apt-get.
3) edited the main postfix setting file with the following lines at the end /etc/postfix/main.cf
virtual_alias_domains = m.example-mydomain.com
virtual_alias_maps = hash:/etc/postfix/virtual
4) created a new file /etc/postfix/virtual and inside the file I created the forwarders e.g
cat /etc/postfix/virtual
[email protected] [email protected]
[email protected] [email protected]
5) then I added an entry inside virtual file, you must run the command
postmap /etc/postfix/virtual
I tried to send an email to [email protected] so it will forward to the alias but here is what I got in the log files.
Nov 24 12:25:30 domU-12-31-39-0C-1A-72 postfix/smtpd[11373]: connect from unknown[74.125.82.48]
Nov 24 12:25:31 domU-12-31-39-0C-1A-72 postfix/trivial-rewrite[11377]: warning: do not list domain m.example-mydomain.com in BOTH mydestination and virtual_alias_domains
Nov 24 12:25:31 domU-12-31-39-0C-1A-72 postfix/smtpd[11373]: 73B6A4D72: client=unknown[74.125.82.48]
Nov 24 12:25:31 domU-12-31-39-0C-1A-72 postfix/cleanup[11378]: 73B6A4D72: message-id=<CACaL_7fcTcxLQmbQFdh0H5N8mea1750FVOFbDyi4s5e=r=ieuw@mail.gmail.com>
Nov 24 12:25:31 domU-12-31-39-0C-1A-72 postfix/qmgr[11309]: 73B6A4D72: from=<[email protected]>, size=1480, nrcpt=1 (queue active)
Nov 24 12:25:32 domU-12-31-39-0C-1A-72 postfix/smtp[11379]: 73B6A4D72: to=<[email protected]>, orig_to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.115.27]:25, delay=0.89, delays=0.28/0.01/0.18/0.41, dsn=2.0.0, status=sent (250 2.0.0 OK 1322137866 u18si4183976vcq.63)
Nov 24 12:25:32 domU-12-31-39-0C-1A-72 postfix/qmgr[11309]: 73B6A4D72: removed
Nov 24 12:26:01 domU-12-31-39-0C-1A-72 postfix/smtpd[11373]: disconnect from unknown[74.125.82.48]
please advise on how i can make the Postfix works in redirection?