通过中继主机限制传出速率

通过中继主机限制传出速率

如何在 Postfix 中获得每个域的速率限制?

我有一个位于中继主机后面的 Postfix 服务器。中继主机是我们的 MS Exchange 网桥。中继不会执行任何节流,也不会抱怨我发送太多太快。

我启用了速率限制,但它在每封电子邮件之间引入了 1 秒的延迟,而不仅仅是每个域的每封电子邮件之间的 1 秒延迟。

我的期望是 gmail.com、att.net 和 yahoo.com 地址之一(来自以下日志片段)将在同一秒内发送;并且下一个 yahoo.com 地址将在下一个报价中发送。

这是日志的片段:

May 31 11:39:34 postfix_machine postfix/smtp[16117]: 1DCB881D59C4: to=<[email protected]>, relay=relayhost_ip_addr[relayhost_ip_addr]:25, conn_use=93, delay=6195, delays=0.03/6195/0.08/0.33, dsn=2.6.0, status=sent (250 2.6.0 <20220531135619.1DCB881D59C4@postfix_machine.example.com> [InternalId=115998476732199, Hostname=relayhost_domain_name] 19717 bytes in 0.168, 114.157 KB/sec Queued mail for delivery)
May 31 11:39:34 postfix_machine postfix/qmgr[2141]: 1DCB881D59C4: removed
May 31 11:39:35 postfix_machine postfix/smtp[16117]: 404AB81D59C7: to=<[email protected]>, relay=relayhost_ip_addr[relayhost_ip_addr]:25, conn_use=94, delay=6197, delays=0.02/6196/0.07/0.32, dsn=2.6.0, status=sent (250 2.6.0 <20220531135619.404AB81D59C7@postfix_machine.example.com> [InternalId=115998476732200, Hostname=relayhost_domain_name] 19721 bytes in 0.167, 115.117 KB/sec Queued mail for delivery)
May 31 11:39:35 postfix_machine postfix/qmgr[2141]: 404AB81D59C7: removed
May 31 11:39:37 postfix_machine postfix/smtp[16117]: 6444581D59CA: to=<[email protected]>, relay=relayhost_ip_addr[relayhost_ip_addr]:25, conn_use=95, delay=6198, delays=0.02/6197/0.07/0.32, dsn=2.6.0, status=sent (250 2.6.0 <20220531135619.6444581D59CA@postfix_machine.example.com> [InternalId=115998476732201, Hostname=relayhost_domain_name] 19719 bytes in 0.168, 114.247 KB/sec Queued mail for delivery)
May 31 11:39:37 postfix_machine postfix/qmgr[2141]: 6444581D59CA: removed
May 31 11:39:38 postfix_machine postfix/smtp[16117]: 8792E81D59CD: to=<[email protected]>, relay=relayhost_ip_addr[relayhost_ip_addr]:25, conn_use=96, delay=6199, delays=0.02/6199/0.07/0.32, dsn=2.6.0, status=sent (250 2.6.0 <20220531135619.8792E81D59CD@postfix_machine.example.com> [InternalId=115998476732202, Hostname=relayhost_domain_name] 19718 bytes in 0.168, 114.377 KB/sec Queued mail for delivery)
May 31 11:39:38 postfix_machine postfix/qmgr[2141]: 8792E81D59CD: removed
May 31 11:39:40 postfix_machine postfix/smtp[16117]: AB92E81D59D0: to=<[email protected]>, relay=relayhost_ip_addr[relayhost_ip_addr]:25, conn_use=97, delay=6200, delays=0.02/6200/0.07/0.32, dsn=2.6.0, status=sent (250 2.6.0 <20220531135619.AB92E81D59D0@postfix_machine.example.com> [InternalId=115998476732203, Hostname=relayhost_domain_name] 19715 bytes in 0.168, 114.593 KB/sec Queued mail for delivery)
May 31 11:39:40 postfix_machine postfix/qmgr[2141]: AB92E81D59D0: removed

以下是我的配置,与默认值不同:

compatibility_level = 2

inet_protocols = all

mynetworks_style = host

header_size_limit = 4096000
message_size_limit = 0
mailbox_size_limit = 0

header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = regexp:/etc/postfix/header_checks

smtputf8_enable = no
smtp_sasl_auth_enable = yes
smtp_use_tls = yes
smtp_tls_security_level = may
smtp_sasl_security_options = noanonymous
smtp_cname_overrides_servername = no
smtp_sender_dependent_authentication = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

relayhost = [relayhost_ip_addr]:25

smtp_destination_concurrency_limit = 2
smtp_destination_rate_delay = 1s
smtp_extra_recipient_limit = 10
smtp_connection_reuse_count_limit = 100

smtp_generic_maps = hash:/etc/postfix/generic

相关内容