我对不同的域有不同的转发需求,它们都指向我的邮件服务器:
user1@example.com foo@example.org
user2@example.com bar@example.net
@example.com mylocalaccount
这一切都有效......但是,其中一些用户希望使用 +-notation 为不同的供应商提供不同的地址,例如user1
+ vendor@example.com
。而这部分不起作用——所有这些电子邮件最终都被传递到了包罗万象mylocalaccount
的地方,而不是被正确转发。
如何使我user+foo@example.com
被转发到与 相同的目的地user@example.com
?
我尝试添加类似的条目
user1+*@example.com foo+%2@example.org
但这并没有解决问题...
这是调试跟踪:
没有细节:
% sendmail -d60.5 -bv g@example.com
map_lookup(dequote, me, %0=me) => NOT FOUND (0)
map_lookup(dequote, g, %0=g) => NOT FOUND (0)
map_lookup(virtuser, g@example.com, %0=g@example.com, %1=g) => gexample@example.net (0)
...有效。
详细说明:
% sendmail -d60.5 -bv g+meow@example.com
map_lookup(dequote, me, %0=me) => NOT FOUND (0)
map_lookup(dequote, g+meow, %0=g+meow) => NOT FOUND (0)
map_lookup(virtuser, g+meow@example.com, %0=g+meow@example.com, %1=g+meow) => NOT FOUND (0)
map_lookup(virtuser, @example.com, %0=@example.com, %1=g+meow) => me (0)
map_lookup(dequote, me, %0=me) => NOT FOUND (0)
map_lookup(user, me, %0=me) => me<> (0)
g+meow@example.com... deliverable: mailer local, user me
... 不工作 - 来到包罗万象的本地帐户“我”。
如果您想 virtusertable 重定向并保留 +detail ,请尝试:
调试程序
以 root 身份执行
sendmail -d60.5 -bv user1+x@example.net
。它应该跟踪映射查找,包括 virtusertable 映射查找。
尝试
sendmail -d21.12 -d60.5 -bv user1+x@example.net
在 virtusertable 查找之前是否删除了 +detail。user1+detail@example.com
默认情况下,应该让 sendmail 查找以下 virtusertable enries:user+@example.com(加上存在但详细信息为空)进行查找 1+3+4+6+7
user@example.com(不存在+详细信息)进行查找 4+7
您的.
+
_ 它使行中看到一个令牌而不是三个令牌。OperatorChars
sendmail.cf
R
sedmail.cf
user+detail
user
+
detail
sendmail.cf
生成自sendmail.mc
应将OperatorChars 设置为.:%@!^/[]+
默认情况下符合 bat book。它可以通过定义在 mc 文件中进行更改confOPERATORS
。检查报告的内容
grep OperatorChars /etc/mail/sendmail.cf