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 / 问题 / 869100
Accepted
Alexander Farber
Alexander Farber
Asked: 2017-08-18 00:27:15 +0800 CST2017-08-18 00:27:15 +0800 CST 2017-08-18 00:27:15 +0800 CST

如何将注册邮件退回到 noreply@ 邮件地址

  • 772

在 CentOS 7 Linux 上,我运行 Drupal,它要求用户确认他们的邮件地址。

我通过以下方式修改了后缀配置文件:

/etc/后缀/通用:

@www.localdomain [email protected]

/etc/postfix/main.cf:

smtp_generic_maps = hash:/etc/postfix/generic

这导致 Drupal 向新用户发送注册邮件,其中包含以下标题:

From: [email protected]     <--- non-existing address at my domain
Reply-To: [email protected] <--- my private mail address

这很好用(比以前更好,当我设置From:为我的 Gmail 地址并且 Gmail 认为我的网站正在向其他人发送垃圾邮件时),但我有一个问题:

我不想再接收任何发给任何人的邮件@preferans.de(太多垃圾邮件涌入),所以我删除了服务器 DNS 条目中的 MX 记录,并通过 iptables 关闭了端口 25。

现在当一个新的 Drupal 用户输入一个虚假地址时,注册邮件会退回,[email protected]但我的 postfix 安装无法传递它:

/var/log/maillog:

Aug 16 18:20:44 www postfix/master[1006]: daemon started -- version 2.10.1, configuration /etc/postfix
Aug 16 22:29:20 pref postfix/cleanup[9031]: 785952C03A8: message-id=<[email protected]>
Aug 16 22:29:20 pref postfix/bounce[9033]: 5B56F2C03A7: sender non-delivery notification: 785952C03A8
Aug 16 22:29:20 pref postfix/qmgr[24449]: 785952C03A8: from=<>, size=3262, nrcpt=1 (queue active)
Aug 16 22:29:20 pref postfix/qmgr[24449]: 5B56F2C03A7: removed
Aug 16 22:29:22 pref postfix/smtp[9009]: connect to preferans.de[88.99.244.39]:25: Connection refused
Aug 16 22:29:22 pref postfix/smtp[9009]: 785952C03A8: to=<[email protected]>, relay=none, delay=1.5, delays=0/0/1.5/0, dsn=4.4.1, status=deferred (connect to preferans.de[88.99.244.39]:25: Connection refused)
Aug 16 22:38:51 pref postfix/qmgr[24449]: 785952C03A8: from=<>, size=3262, nrcpt=1 (queue active)
Aug 16 22:38:51 pref postfix/smtp[9208]: connect to preferans.de[88.99.244.39]:25: Connection refused
Aug 16 22:38:51 www postfix/smtp[9208]: 785952C03A8: to=<[email protected]>, relay=none, delay=571, delays=571/0.01/0.01/0, dsn=4.4.1, status=deferred (connect to preferans.de[88.99.244.39]:25: Connection refused)
Aug 16 22:48:51 www postfix/qmgr[24449]: 785952C03A8: from=<>, size=3262, nrcpt=1 (queue active)
Aug 16 22:48:51 www postfix/smtp[9393]: connect to preferans.de[88.99.244.39]:25: Connection refused
Aug 16 22:48:51 www postfix/smtp[9393]: 785952C03A8: to=<[email protected]>, relay=none, delay=1171, delays=1171/0.01/0.01/0, dsn=4.4.1, status=deferred (connect to preferans.de[88.99.244.39]:25: Connection refused)
Aug 16 23:08:51 www postfix/qmgr[24449]: CF37F2C039F: from=<[email protected]>, size=1234, nrcpt=1 (queue active)
Aug 16 23:08:51 www postfix/qmgr[24449]: 785952C03A8: from=<>, size=3262, nrcpt=1 (queue active)
Aug 16 23:08:51 www postfix/smtp[9797]: connect to preferans.de[88.99.244.39]:25: Connection refused
Aug 16 23:08:51 www postfix/smtp[9797]: 785952C03A8: to=<[email protected]>, relay=none, delay=2371, delays=2371/0.01/0.01/0, dsn=4.4.1, status=deferred (connect to preferans.de[88.99.244.39]:25: Connection refused)
Aug 16 23:08:51 www postfix/smtp[9796]: connect to gamai.com[67.227.226.241]:25: Connection refused
Aug 16 23:08:51 www postfix/smtp[9796]: CF37F2C039F: to=<[email protected]>, relay=none, delay=4588, delays=4588/0.01/0.13/0, dsn=4.4.1, status=deferred (connect to gamai.com[67.227.226.241]:25: Connection refused)
Aug 16 23:48:52 www postfix/qmgr[24449]: 785952C03A8: from=<>, size=3262, nrcpt=1 (queue active)
Aug 16 23:48:52 www postfix/smtp[10420]: connect to preferans.de[88.99.244.39]:25: Connection refused
Aug 16 23:48:52 www postfix/smtp[10420]: 785952C03A8: to=<[email protected]>, relay=none, delay=4772, delays=4772/0.01/0.01/0, dsn=4.4.1, status=deferred (connect to preferans.de[88.99.244.39]:25: Connection refused)

队列已满:

# sudo mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
CF37F2C039F     1234 Wed Aug 16 21:52:22  [email protected]
                 (connect to gamai.com[67.227.226.241]:25: Connection refused)
                                         [email protected]

785952C03A8     3262 Wed Aug 16 22:29:20  MAILER-DAEMON
                (connect to preferans.de[88.99.244.39]:25: Connection refused)
                                         [email protected]

BD4222C03B6     1219 Thu Aug 17 07:48:48  [email protected]
(host mx.yandex.ru[87.250.250.89] said: 451 4.5.1 The recipient <[email protected]> has exceeded their message rate limit. Try again later. 1502957639-8f63s3727h-Dw8G1QLj (in reply to end of DATA command))
                                         [email protected]

-- 6 Kbytes in 3 Requests.

我的问题是:

如何配置我的 postfix 安装,以便它立即删除未发送的邮件(但仍然通过灰名单)?

最后是当前的postconf -n输出:

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
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_generic_maps = hash:/etc/postfix/generic
unknown_local_recipient_reject_code = 550
email
  • 1 1 个回答
  • 1358 Views

1 个回答

  • Voted
  1. Best Answer
    Alexander Farber
    2017-08-21T05:58:37+08:002017-08-21T05:58:37+08:00

    我的解决方案是设置

    bounce_queue_lifetime = 2d
    

    在/etc/postfix/main.cf中将退回邮件的生命周期缩短到 2 天

    • 0

相关问题

  • 如何绕过 ISP 的限制性电子邮件政策?

  • SharePoint 传入电子邮件出现“未知别名”错误

  • 电子邮件帐户的角色名称与人名

  • 如何在笔记本电脑上使用 Tobit David?[关闭]

  • 随行人员通过 VPN 连接到 Exchange 2007

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