抓住Postfix(Ubuntu)上的多个域的所有转发器

我试图找出我的Ubuntu服务器上的多个的catchall转发。 我有一个单一的域(maindomain)工作,但不能得到插件1和2的工作。

我的/ etc / postfix / virtual看起来像

@example.com [email protected] @example.net [email protected] @example.org [email protected] 

/etc/postfix/main.cf看起来像:

 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 

最初我在mydestination列表中有example.com,这个工作,但我试图添加addondomains,因为这个后缀文档移动它。

我需要添加什么以及在哪里? 我还没有做任何事情与alias_database 。 邮件系统将只用于全域转发,但我希望它能够处理多个域到不同的地址。

编辑:

 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 

编辑:运行日志给出:

 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=<[email protected]>, 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=<[email protected]>, orig_to=<[email protected]>, 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 

好。

所以这其实很简单。

正如对这个链接的评论之一http://www.binarytides.com/postfix-mail-forwarding-debian/指出的那样&#x3002; Gmail不会让您通过转发域发送电子邮件给自己。

[email protected]发送到[email protected]这是转发给[email protected]将无法正常工作。 尽[email protected] [email protected]工作!

哇。

我可能是错误的,但请执行ls -ltr /etc/postfix/virtual*

如果virtual.dbvirtual之前列出,则需要执行postmap /etc/postfix/virtual 。 每次更改文件时都需要这样做。