后缀:别名将被忽略

我有一个服务器configuration为后缀MTA和运行也munin节点。 在/ etc / aliases我添加:

root: [email protected] 

在postfix的main.cf中configuration:

 mydomain = my.domain myorigin = $mydomain alias_database = hash:/etc/aliases relay_domains = my.domain append_at_myorigin = no ... 

在每次更改别名或后缀configuration文件后,我都调用了newaliasespostmap <cfgfile>并重新启动postfix。

每次如果munin会发送(错误)电子邮件,我在maillog文件中得到这个:

 Dec 22 16:45:19 myserver postfix/pickup[21509]: 5CFBA2011E0: uid=995 rom=<munin> Dec 22 16:45:19 myserver postfix/cleanup[22094]: 5CFBA2011E0: message-id=<[email protected]> Dec 22 16:45:19 myserver postfix/qmgr[21510]: 5CFBA2011E0: from=<munin>, size=999, nrcpt=1 (queue active) Dec 22 16:45:20 myserver postfix/smtp[22099]: 5CFBA2011E0: to=<[email protected]>, orig_to=<root>, relay=internal.my.domain[XXX.182.189.136]:25, delay=4.2, delays=3/0.01/1.1/0.09, dsn=5.1.1, status=bounced (host internal.my.domain[XXX.182.189.136] said: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in virtual mailbox table (in reply to RCPT TO command)) Dec 22 16:45:20 myserver postfix/cleanup[22094]: A98B72012D2: message-id=<[email protected]> Dec 22 16:45:20 myserver postfix/bounce[22100]: 5CFBA2011E0: sender non-delivery notification: A98B72012D2 

不明白为什么“root”(orig_to)没有被replace为“[email protected]”就像在别名文件中指定的一样。 似乎后缀追加myorigin值“根”。 不知道为什么,因为我也指定了append_at_myorigin = no

这里发生了什么? 我想用“[email protected]”replace“root”地址。 我怎样才能做到这一点?

不确定“my.domain”究竟是什么,但别名仅用于本地交付。

相反,你可能想要使用虚拟地图 。

作为根(或sudo)

在/ etc / postfix / virtual(或虚拟的地方)

 root [email protected] 

在main.cf中

 virtual_maps = hash:/etc/postfix/virtual 

或(现代版本的后缀)

 virtual_alias_maps = hash:/etc/postfix/virtual 

在虚拟地图被修改之后

 # postmap /etc/postfix/virtual # postfix reload 

请注意,所有“root”邮件都将被redirect到“[email protected]”。

在我的情况下,我想使用/ etc / aliases(因为有些软件包使用它,所以你必须validation更改并复制到/ etc / postfix / virtual

为什么它不起作用的问题是在myorigin。 如果你设置myorigin,所有邮件发送到根,没有人和其他本地人automagicaly更改为root @ myorigin

在我的情况下:/ etc / aliases:

 nobody: root root: [email protected] 

的/ etc /邮件名:

 myhost.example.com 

/etc/postfix/main.cf文件:

 myorigin = /etc/mailname myhostname = othername.example.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases mydestination = othername, localhost.localdomain, localhost 

在这种情况下,发送给nobody的所有邮件都会更改为[email protected](因为myorigin),然后发送到某个地方。

我必须改变主意:

 mydestination = myhost.example.com, othername, localhost.localdomain, localhost 

现在邮件发送到没有人被redirect到根,这将更改为[email protected],但因为它在mydestination它看着别名和更改为[email protected],但因为它是在我的目的地查看别名,并redirect到[email protected],它不在我的目的地,它被发送到应该发送的地方; D