大网数据广告活动
服务器运维问答

postfix: aliases will be ignored

· 52CE 我爱测

I have a server which is configured as a postfix MTA and on which runs also a munin node. In /etc/aliases I have add: root: [email omitted] in the main.cf of postfix is configured: mydomain = my.domain myorigin = $mydomain alias_…

问题原文

原帖链接 · Steffen · CC BY-SA 3.0

I have a server which is configured as a postfix MTA and on which runs also a munin node. In /etc/aliases I have add:

root:    [email omitted]

in the main.cf of postfix is configured:

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

After each change of aliases or postfix configuration files I have called newaliases or postmap <cfgfile> and restart postfix.

Each time if munin will send a (error) email I get this in the maillog file:

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 omitted]>
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 omitted]>, 
    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 omitted]>: 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 omitted]>
Dec 22 16:45:20 myserver postfix/bounce[22100]: 5CFBA2011E0: sender non-delivery 
    notification: A98B72012D2

Don't understand why "root" (orig_to) was not replaced with "[email omitted]" like it was specified in the aliases file. Seems postfix append the myorigin value to "root". Not sure why because I have also specified append_at_myorigin = no.

Whats going on here? I want to replace the "root" address with "[email omitted]". How can I do that?

已采纳解答

原帖链接 · Déjà vu · CC BY-SA 3.0

Not sure about what "my.domain" is exactly, but aliases are only used for local deliveries.

Instead, you probably want to use the virtual maps.

As root (or sudo)

In /etc/postfix/virtual (or where virtual is)

root    [email omitted]

In main.cf

virtual_maps = hash:/etc/postfix/virtual

or (modern versions of postfix)

virtual_alias_maps = hash:/etc/postfix/virtual

after the virtual map has been modified

# postmap /etc/postfix/virtual
# postfix reload

Beware that all mail for "root" will be redirected to "[email omitted]".

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-12-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。