大网数据广告活动
服务器运维问答

Throttle outgoing mail by domain in exim

· 52CE 我爱测

I am using exim to deliver mail generated by a web app. The gmx.net, gmx.de and web.de domains are asking me to throttle the amount of mail I send but I have trouble in getting that configured in exim. The scenario goes like this…

问题原文

原帖链接 · Lucas · CC BY-SA 4.0

I am using exim to deliver mail generated by a web app. The gmx.net, gmx.de and web.de domains are asking me to throttle the amount of mail I send but I have trouble in getting that configured in exim.

The scenario goes like this:

  1. my web app generates the emails
  2. they are submitted to exim running on localhost via phpmailer
  3. exim puts them in the queue right away (I have queue_smtp_domains = web.de : gmx.de : gmx.net in the config)
  4. on every queue run (every hour) it tries to deliver the mail
  5. after some successful deliveries each of these two domains returns a 421 error code (1.1.1.1 is my IP address in the original log entry which I replaced here). Exim claims that the error occurs strait after connecting to the server:
2019-09-12 14:50:41.157 [19619] 1i8OYb-00056H-01 H=mx01.emig.gmx.net [212.227.17.5]:25: SMTP error from remote mail server after initial connection: 421-gmx.net (mxgmx115) Nemesis ESMTP Service not available\n421-Service unavailable\n421-Reject due to policy restrictions.\n421 For explanation visit http://postmaster.gmx.com/en/error-messages?ip=1.1.1.1&c=irlims

The link they give the advise to reduce the sending rate. That is what I am trying to do.

Every three hours a fixed amount of mail is accepted be the recieving mailserver before the same error message apears again.

I found one question but it looks like the acls will do the rate limiting at step 2 and I don't want that. I want to rate limit at point 4. And only for the two domains in question.

I also found the docs for special retry rules in exim. But I only want to apply a special rule if the domain and the error code match and it seems to me that I can not match the error 421 on connection (only as a reply of a MAIL or DATA or RCPT command can I match it).

How can I configure this kind of throtteling in exim or how else can I get these mails to be accepted at a faster rate?

已采纳解答

原帖链接 · Lucas · CC BY-SA 4.0

I have found this thread on the exim mailing list.

They discuss different hacks and workarounds for throtteling including

  • writing a shell script to manually sleep and deliver the messages (with exim -M)
  • postfix as a "smarthost" which apearently can do what we want
  • configuring a router that just sleeps for some seconds and then passes the message to the next router

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-09-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。