如何使sendmail尊重+虚拟用户的说明?

我对不同的域有不同的转发需求,这些都指向我的邮件服务器:

[email protected] [email protected] [email protected] [email protected] @example.com mylocalaccount 

这一切都有效…但是,其中一些用户希望使用+ -notation来为不同的供应商提供不同的地址,例如user1 + vendor @example.com 。 而这个部分不起作用 – 所有这样的电子邮件最终被传送到了所有的mylocalaccount而不是被正确地转发。

如何将[email protected]转发到[email protected]目的地?

我尝试添加类似的条目

 user1+*@example.com foo+%[email protected] 

但是这并没有解决问题…

这里是debugging跟踪:

没有细节:

 % sendmail -d60.5 -bv [email protected] map_lookup(dequote, me, %0=me) => NOT FOUND (0) map_lookup(dequote, g, %0=g) => NOT FOUND (0) map_lookup(virtuser, [email protected], %[email protected], %1=g) => [email protected] (0) 

…工作。

细节:

 % sendmail -d60.5 -bv [email protected] map_lookup(dequote, me, %0=me) => NOT FOUND (0) map_lookup(dequote, g+meow, %0=g+meow) => NOT FOUND (0) map_lookup(virtuser, [email protected], %[email protected], %1=g+meow) => NOT FOUND (0) map_lookup(virtuser, @example.com, %[email protected], %1=g+meow) => me (0) map_lookup(dequote, me, %0=me) => NOT FOUND (0) map_lookup(user, me, %0=me) => me<> (0) [email protected]... deliverable: mailer local, user me 

…不起作用 – 来到全面的本地帐户“我”。

sendmail.cf中的OperatorChars中似乎没有+ 。 它使sedmail.cf R行看到一个令牌user+detail而不是三个令牌user + detail

sendmail.cf生成的sendmail.mc 应该默认根据蝙蝠本书将OperatorChars设置为.:%@!^/[]+ 。 通过定义confOPERATORS可以在mc文件中改变它。

检查grep OperatorChars /etc/mail/sendmail.cf报告的内容

如果你想virtusertableredirect与+保留的细节,然后尝试:

 # use %2 if you want to strip EMPTY +detail ([email protected]) [email protected] foo%[email protected] 

debugging程序
以root sendmail -d60.5 -bv [email protected]执行sendmail -d60.5 -bv [email protected]
它应该跟踪地图查找,包括虚拟地图查找。
尝试sendmail -d21.12 -d60.5 -bv [email protected]如果在精确查找之前删除了+ detail。

[email protected]默认情况下应该让sendmail寻找下面的virtusertable enries:

  1. [email protected]
  2. [email protected]
  3. user+*@example.com
  4. [email protected]
  5. [email protected]
  6. +*@example.com
  7. @ example.com

[email protected](加上存在但是详细为空)进行查找1 + 3 + 4 + 6 + 7
[email protected](不提供+详细信息)condutcs lookup 4 + 7