我在 Centos 7.1 上设置了一些虚拟主机,我想让用户点赞,[email protected]
这样我就可以通过点赞回复[email protected]
,而不是点赞[email protected]
Postfix 正在与用户一起工作user
但不与[email protected]
,它显示错误status=bounced (User unknown in virtual alias table)
;
/etc/postfix/main.cf
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
local_recipient_maps = hash:/etc/postfix/relay_recipients
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 62.210.xx.xx/24, 192.168.1.0/24, 127.0.0.0/8, [::ffff:127.0.0.0]/104 [::1]/128
mynetworks_style = host
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relay_domains =
relay_recipient_maps = hash:/etc/postfix/relay_recipients
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
virtual_alias_domains = example1.com example2.com example3.com
virtual_alias_maps = dbm:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
/etc/postfix/虚拟
example1.com example1.com
#[email protected] admin
[email protected] [email protected]
当我这样做时,我收到了邮件
example1.com example1.com
[email protected] admin
我收到错误status=bounced (User unknown in virtual alias table) doing this
example1.com example1.com
[email protected] [email protected]
请提出任何可能的方法
谢谢
答案1
创建一个relay_recipients映射:
在/etc/postfix/relay_recipients中:
[email protected] ok
[email protected] ok
当然你可以用以下方法映射它:
$ postmap relay_recipients
然后将地图移动到你的 postfix 目录并重新启动你的服务:
$ sudo mv relay_recipients.db /etc/postfix/
$ sudo service postfix restart
从 /etc/postfix/main.cf 中执行: /etc/postfix/main.cf:
mynetworks = 127.0.0.0/8 12.34.56.0/24
relay_domains = example.com
smtpd_relay_restrictions = permit_mynetworks reject_unauth_destination
relay_recipient_maps = hash:/etc/postfix/relay_recipients
对于您的虚拟别名执行相同类型的 postmap。
创建虚拟别名文件virtual
:
/user@.*/ [email protected]
[email protected] user
执行:
$ postmap virtual
$ sudo mv virtual.db /etc/postfix/
$ sudo service postfix restart
答案2
我通过创建发送者规范映射解决了这个问题
/etc/postfix/sender_canonical
user [email protected]
然后进行映射
postmap /etc/postfix/sender_canonical
然后将其添加到/etc/postfix/main.cf
sender_canonical_maps = hash:/etc/postfix/sender_canonical
现在重新启动 Postfix
现在我可以user
从[email protected]
希望它也能帮助其他人。
答案3
这里的问题是,您混淆了两个不同用途的邮件传递代理 (MDA)。长话短说,postfix 带有两个 MDA - 本地和虚拟。main.cf 参数(如 mydomain、local_recipient_maps 等)由本地使用,因此不适用于虚拟。因此,如上所述,您需要为虚拟 MDA 创建另一个用户映射。(virtual_mailbox_maps)
在 mos basix 形式中,这些 MTA 的目的是本地绑定到所有域之间共享的系统用户帐户(如 /etc/passwd),而虚拟可以服务于不同的用户和域。有关此方面的任何进一步信息,您应该参考 postfix 文档,它非常具有描述性且易于理解。
顺便说一句,如果您希望 Postfix 为用户提供邮件服务,请考虑使用 SASL(SMTP 身份验证)。