AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 865383
Accepted
Mikhail T.
Mikhail T.
Asked: 2017-07-27 19:42:37 +0800 CST2017-07-27 19:42:37 +0800 CST 2017-07-27 19:42:37 +0800 CST

如何让 sendmail 尊重虚拟用户的 +-notation?

  • 772

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

[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]

但这并没有解决问题...

这是调试跟踪:

没有细节:

% 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
  • 2 2 个回答
  • 130 Views

2 个回答

  • Voted
  1. AnFi
    2017-07-27T20:49:18+08:002017-07-27T20:49:18+08:00

    如果您想 virtusertable 重定向并保留 +detail ,请尝试:

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

    调试程序
    以 root 身份执行sendmail -d60.5 -bv [email protected]。
    它应该跟踪映射查找,包括 virtusertable 映射查找。
    尝试sendmail -d21.12 -d60.5 -bv [email protected]在 virtusertable 查找之前是否删除了 +detail。

    [email protected]默认情况下,应该让 sendmail 查找以下 virtusertable enries:

    1. 用户+详细信息@example.com
    2. 用户[email protected]
    3. 用户+*@example.com
    4. 用户@example.com
    5. [email protected]
    6. +*@example.com
    7. @example.com

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

    • 1
  2. Best Answer
    AnFi
    2017-07-28T22:28:33+08:002017-07-28T22:28:33+08:00

    您的. +_ 它使行中看到一个令牌而不是三个令牌。OperatorCharssendmail.cfRsedmail.cfuser+detailuser + detail

    sendmail.cf生成自sendmail.mc 应将OperatorChars 设置为.:%@!^/[]+默认情况下符合 bat book。它可以通过定义在 mc 文件中进行更改confOPERATORS。

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

    • 1

相关问题

  • 如何使用远程 SMTP 配置 php.ini?

  • Linux sendmail 垃圾邮件?

  • 使 php mail() 函数在 ubuntu-server 上工作的步骤是什么?

  • 如何配置 sendmail 以拒绝日期标题与实时相差太远的电子邮件?

  • 什么是好的 sendmail 日志分析器?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve