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

Postfix is ignoring the virtual maps

· 52CE 我爱测

I am using Postfix and when I try to send an email to a virtual address ([email omitted]), it is not able to find the user: Aug 7 11:55:32 example postfix/local[24435]: AE54C808E546: to=<[email omitted]>, relay=local, delay=6.6, …

问题原文

原帖链接 · Cod1ngFree · CC BY-SA 4.0

I am using Postfix and when I try to send an email to a virtual address ([email omitted]), it is not able to find the user:

Aug  7 11:55:32 example postfix/local[24435]: AE54C808E546: to=<[email omitted]>, relay=local, delay=6.6, delays=4.8/0.47/0/1.4, dsn=5.1.1, status=bounced (unknown user: "paradise")

I am using the following virtual map:

[email omitted] horus
@example.org horus

Where horus is my (non-root) Unix user. If I try to verify the virtual addres by doing:

postmap -q [email omitted] hash:/etc/postfix/virtual

It returns my current user:

horus

Because of that, I am not sure why is not able to find [email omitted] or paradise.

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
milter_default_action = accept
milter_protocol = 2
mydestination = example.org,localhost
myhostname = example.org
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = example.org
readme_directory = no
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
virtual_alias_maps = hash:/etc/postfix/virtual

And my /etc/aliases (but as far as I know, it is used only for local delivery) is:

...
www:            webmaster
webmaster:      root
noc:            root
security:       root
hostmaster:     root
info:           postmaster
marketing:      postmaster
sales:          postmaster
support:        postmaster


# trap decode to catch security attacks
decode:         root

# Person who should get root's mail
root:           horus

The database seems to be okay:

db_dump /etc/postfix/virtual.db -p

VERSION=3
format=print
type=hash
h_nelem=4098
db_pagesize=4096
HEADER=END
[email omitted]\00
horus\00
@example.org\00
horus\00
DATA=END

What is wrong with the configuration?

社区高分解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

If you want to use virtual_alias_maps to deliver mail, you must also tell Postfix which domains it should consult the map for, with the virtual_alias_domains directive. This can be a plain list of domains, or it can also be one of the map types Postfix supports.

virtual_alias_domains = example.org

will get you going, and you can put in a map or whatever you want later.

See also the Postfix documentation on virtual hosting.

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

资料来源与适用范围

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

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

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