简体   繁体   English

后缀-所有域的速率限制

[英]Postfix - Rate limit for all domains

My client is a travel agency and has thousands of opted-in emails (no spam). 我的客户是一家旅行社,有数千封选择加入的电子邮件(没有垃圾邮件)。 Every week they send a message to all customers once, but I'm having problems with some providers and want to rate limit the entire server, for all outgoing domains. 每周他们都会向所有客户发送一次消息,但是我遇到了一些提供商的问题,并且希望对所有传出域的整个服务器进行速率限制。

I found some configurations to limit one message per domain per minute. 我发现了一些配置来限制每个域每分钟一条消息。 I know how to create extra configuration (using transport file), to increase the numbers for some domains. 我知道如何创建额外的配置(使用传输文件),以增加某些域的数量。

For some reason, Postfix is not rate-limiting anything :( 由于某些原因,Postfix不会限制任何速率:(

smtp_destination_rate_delay = 60s
default_destination_concurrency_limit = 1
smtp_destination_concurrency_limit = 1
smtp_destination_recipient_limit = 1
smtp_initial_destination_concurrency = 1

/etc/postfix/transport is empty / etc / postfix / transport为空

For example, for Hotmail, sending several messages in the same minute: 例如,对于Hotmail,在同一分钟内发送几封邮件:

Jun 21 09:08:16 deres postfix/smtp[9905]: ABFB92165: to=<x@hotmail.com>, relay=hotmail-com.olc.protection.outlook.com[104.47.32.33]:25, delay=14, delays=11/0/0.83/1.4, dsn=2.6.0, status=sent (250 2.6.0 <600ef56d-18e7-4c10-9c7b-d0e5267c5589@SN1NAM01FT007.eop-nam01.prod.protection.outlook.com> [InternalId=9380208589439, Hostname=SN1NAM01HT004.eop-nam01.prod.protection.outlook.com] 442267 bytes in 1.070, 403.463 KB/sec Queued mail for delivery)
Jun 21 09:08:17 deres postfix/smtp[9849]: 59A7E2296: to=<y@hotmail.com>, relay=hotmail-com.olc.protection.outlook.com[104.47.32.33]:25, delay=14, delays=12/0/0.91/1.3, dsn=2.6.0, status=sent (250 2.6.0 <b6edd8d6-1302-45e9-8eef-a80b1d2659cd@SN1NAM01FT054.eop-nam01.prod.protection.outlook.com> [InternalId=9882719764030, Hostname=SN1NAM01HT090.eop-nam01.prod.protection.outlook.com] 442313 bytes in 0.689, 626.054 KB/sec Queued mail for delivery)
Jun 21 09:08:18 deres postfix/smtp[9836]: 0D0C122E7: to=<z@hotmail.com>, relay=hotmail-com.olc.protection.outlook.com[104.47.32.33]:25, delay=14, delays=12/0/0.76/1.5, dsn=2.6.0, status=sent (250 2.6.0 <8bd2a3d4-d20b-44f0-a90e-fc060b83380b@SN1NAM01FT014.eop-nam01.prod.protection.outlook.com> [InternalId=9354438785755, Hostname=SN1NAM01HT074.eop-nam01.prod.protection.outlook.com] 442283 bytes in 1.031, 418.834 KB/sec Queued mail for delivery)

The only thing (that I don't believe can impact) is that the customer sends the messages using an alternate port (5544 instead of 25/465/587). 唯一的事情(我认为不会影响)是客户使用备用端口(5544而不是25/465/587)发送消息。

Any ideia? 有什么想法吗? Thank you. 谢谢。

Edit: as requested, my config. 编辑:根据要求,我的配置。

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
bounce_queue_lifetime = 1h
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5
default_destination_concurrency_limit = 1
delay_warning_time = 4
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_backoff_time = 40m
maximal_queue_lifetime = 24h
message_size_limit = 26214400
minimal_backoff_time = 15m
mydestination = localhost.$mydomain, localhost
mydomain = deres.domain.com.br
myhostname = deres.domain.com.br
mynetworks = all
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
queue_run_delay = 15m
readme_directory = /usr/share/doc/postfix-2.2.2/README_FILES
recipient_delimiter = +
relay_domains = proxy:mysql:/etc/sentora/configs/postfix/mysql-relay_domains_maps.cf
sample_directory = /usr/share/doc/postfix-2.2.2/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_defer_if_no_mx_address_found = no
smtp_destination_concurrency_limit = 1
smtp_destination_rate_delay = 55s
smtp_destination_recipient_limit = 1
smtp_initial_destination_concurrency = 1
smtp_tls_note_starttls_offer = yes
smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache
smtp_use_tls = yes
smtpd_client_restrictions =
smtpd_data_restrictions = reject_unauth_pipelining,permit_sasl_authenticated
smtpd_discard_ehlo_keywords = silent-discard,dsn
smtpd_helo_required = yes
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain ,reject_rbl_client zen.spamhaus.org ,reject_rbl_client bl.spamcop.net ,reject_rbl_client b.barracudacentral.org
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions =
smtpd_tls_CAfile = /etc/letsencrypt/live/ca.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/letsencrypt/live/...removed
smtpd_tls_key_file = /etc/letsencrypt/live/...removed
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
soft_bounce = no
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_address_reject_code = 554
unknown_hostname_reject_code = 554
unknown_local_recipient_reject_code = 550
virtual_alias_maps = proxy:mysql:/etc/sentora/configs/postfix/mysql-virtual_alias_maps.cf, regexp:/etc/sentora/configs/postfix/virtual_regexp
virtual_gid_maps = static:12
virtual_mailbox_base = /var/sentora/vmail
virtual_mailbox_domains = proxy:mysql:/etc/sentora/configs/postfix/mysql-virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/sentora/configs/postfix/mysql-virtual_mailbox_maps.cf
virtual_minimum_uid = 101
virtual_transport = dovecot
virtual_uid_maps = static:101

Sorry, I misread your question. 抱歉,我看不懂你的问题。 You WANT rate limiting but don't seem to be getting it. 您想限制速率,但似乎没有得到。 Correct? 正确?

The settings you showed should work. 您显示的设置应该可以使用。 Have you done a postfix reload? 您是否完成了Postfix重新加载? PF won't pick up changes in it's config file without a reload or restart. PF在不重新加载或重新启动的情况下不会获取其配置文件中的更改。

If that doesn't do it, do a postconf -n, which will show the settings that it thinks you have in your config file, and post it here. 如果这样做不行,请执行postconf -n,它将显示您认为在配置文件中的设置,并将其发布到此处。

If what it thinks you set and what you actually set are different, you'll need to do some detective work to see where it's getting settings from. 如果它认为您设置的内容与实际设置的内容不同,则需要进行一些侦探性工作,以了解从何处获取设置。

Solved. 解决了。

Fixed with: 固定于:

default_destination_recipient_limit = 2
smtp_destination_recipient_limit = 2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM