I'm trying to figure out catchall forwarding for multiple domains on my Ubuntu server. I have it working for a single domain (maindomain) but cannot get the addons 1 and 2 to work.
My /etc/postfix/virtual looks like
@example.com onename@gmail.com
@example.net twoname@gmail.com
@example.org twoname@gmail.com
and /etc/postfix/main.cf looks like:
virtual_alias_domains = example.com, example.net, example.org
virtual_alias_maps = hash:/etc/postfix/virtual
alias_database = hash:/etc/aliases
...
mydestination = server.example.com, server, localhost.localdomain, localhost
...
mydomain = example.com
Originally I had example.com in the mydestination list, which worked, but I moved it while trying to add the addondomains because of this postfix documentation.
What do I need to add and where? I have yet to do anything with the alias_database
. The mail system will only be used for catch-all domain forwarding, but I want it to be able to handle multi domains to different addresses.
EDIT:
username@server:~$ ls -ltr /etc/postfix/virtual*
-rw-r--r-- 1 root root 122 Jan 16 09:48 /etc/postfix/virtual
-rw-r--r-- 1 root root 12288 Jan 16 10:10 /etc/postfix/virtual.db
EDIT: Running the logs gives:
Jan 18 14:56:22 server postfix/smtpd[27433]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Jan 18 14:56:32 server postfix/smtpd[27433]: connect from mail-wm0-f44.google.com[74.125.82.44]
Jan 18 14:56:32 server postfix/smtpd[27433]: 8ADF517FA6E: client=mail-wm0-f44.google.com[74.125.82.44]
Jan 18 14:56:32 server postfix/cleanup[27437]: 8ADF517FA6E: message-id=<CAOJdi7gjX9_Qm7exDjOrBVTtXF5hhysWcRqUp4pYx4NuwwsxWA@mail.gmail.com>
Jan 18 14:56:32 server postfix/qmgr[11433]: 8ADF517FA6E: from=<twoname@gmail.com>, size=2493, nrcpt=1 (queue active)
Jan 18 14:56:32 server postfix/smtpd[27433]: disconnect from mail-wm0-f44.google.com[74.125.82.44]
Jan 18 14:57:27 server postfix/smtp[27438]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c08::1a]:25: Network is unreachable
Jan 18 14:57:28 server postfix/smtp[27438]: 8ADF517FA6E: to=<twoname@gmail.com>, orig_to=<test@example.net>, relay=gmail-smtp-in.l.google.com[74.125.140.26]:25, delay=55, delays=0.06/0.01/55/0.08, dsn=2.0.0, status=sent (250 2.0.0 OK 1453128888 k126si25800198wma.23 - gsmtp)
Jan 18 14:57:28 server postfix/qmgr[11433]: 8ADF517FA6E: removed