ZhangHuangbin wrote:Did you try this throttle setting for external domain/sender/ip?
https://bitbucket.org/zhb/iredapd/src/7 … #lines-128
jstewart wrote:Update - it seems that neither inbound nor outbound throttling is working. The database table throttle_tracking is being updated with the cur_msgs incrementing properly the tid appears correct, but it seems that the system isn't reading the settings from the throttle table. My test account is set to throttle at 3 messages outbound and 4 messages inbound, but I send as many emails from the account as I want, and all inbound mail is arriving as well.
Try to turn on debug mode in iRedAPD, it logs more detailed message for troubleshooting.
FYI: https://docs.iredmail.org/debug.iredapd.html
This user is throttled to max 3 outbound per day. I send 5, and they all went through
2018-12-06 08:32:16 DEBUG smtp session: request=smtpd_access_policy
2018-12-06 08:32:16 DEBUG smtp session: protocol_state=END-OF-MESSAGE
2018-12-06 08:32:16 DEBUG smtp session: protocol_name=ESMTP
2018-12-06 08:32:16 DEBUG smtp session: client_address=127.0.0.1
2018-12-06 08:32:16 DEBUG smtp session: client_name=localhost
2018-12-06 08:32:16 DEBUG smtp session: reverse_client_name=localhost
2018-12-06 08:32:16 DEBUG smtp session: helo_name=_
2018-12-06 08:32:16 DEBUG smtp session: sender=sender@mydomain.com
2018-12-06 08:32:16 DEBUG smtp session: recipient=receiver@gmail.com
2018-12-06 08:32:16 DEBUG smtp session: recipient_count=1
2018-12-06 08:32:16 DEBUG smtp session: queue_id=4DC8F42C74C3
2018-12-06 08:32:16 DEBUG smtp session: instance=1526.5c0924e0.4d90e.0
2018-12-06 08:32:16 DEBUG smtp session: size=375
2018-12-06 08:32:16 DEBUG smtp session: etrn_domain=
2018-12-06 08:32:16 DEBUG smtp session: stress=
2018-12-06 08:32:16 DEBUG smtp session: sasl_method=LOGIN
2018-12-06 08:32:16 DEBUG smtp session: sasl_username=sender@mydomain.com
2018-12-06 08:32:16 DEBUG smtp session: sasl_sender=
2018-12-06 08:32:16 DEBUG smtp session: ccert_subject=
2018-12-06 08:32:16 DEBUG smtp session: ccert_issuer=
2018-12-06 08:32:16 DEBUG smtp session: ccert_fingerprint=
2018-12-06 08:32:16 DEBUG smtp session: ccert_pubkey_fingerprint=
2018-12-06 08:32:16 DEBUG smtp session: encryption_protocol=TLSv1
2018-12-06 08:32:16 DEBUG smtp session: encryption_cipher=ECDHE-RSA-AES256-SHA
2018-12-06 08:32:16 DEBUG smtp session: encryption_keysize=256
2018-12-06 08:32:16 DEBUG LDAP connection initialied success.
2018-12-06 08:32:16 DEBUG LDAP bind success.
2018-12-06 08:32:16 DEBUG Skip plugin: reject_null_sender (protocol_state != END-OF-MESSAGE)
2018-12-06 08:32:16 DEBUG Skip plugin: wblist_rdns (protocol_state != END-OF-MESSAGE)
2018-12-06 08:32:16 DEBUG Skip plugin: reject_sender_login_mismatch (protocol_state != END-OF-MESSAGE)
2018-12-06 08:32:16 DEBUG Skip plugin: greylisting (protocol_state != END-OF-MESSAGE)
2018-12-06 08:32:16 DEBUG --> Apply plugin: throttle
2018-12-06 08:32:16 DEBUG Found sasl_username, consider this sender as an internal sender.
2018-12-06 08:32:16 DEBUG Check sender throttling.
2018-12-06 08:32:16 DEBUG [LDAP] query target domain of given alias domain (cyg.net).
2018-12-06 08:32:16 DEBUG [LDAP] query filter: ((&(objectClass=mailDomain)(accountStatus=active)(domainAliasName=cyg.net)))
2018-12-06 08:32:16 DEBUG result: []
2018-12-06 08:32:16 DEBUG [SQL] Query throttle setting:
2018-12-06 08:32:16 DEBUG [SQL] Query result:
2018-12-06 08:32:16 DEBUG sender throttle setting: msg_size=0 (bytes)/id=9/account=sender@mydomain.com; max_msgs=3/id=9/account=sender@mydomain.com; max_quota=0 (bytes)/id=9/account=sender@mydomain.com;
2018-12-06 08:32:16 DEBUG [SQL] Query throttle tracking data:
2018-12-06 08:32:16 DEBUG [SQL] Query result:
2018-12-06 08:32:16 DEBUG Tracking IDs: {(9L, 'sender@mydomain.com'): 256284L}
2018-12-06 08:32:16 INFO [127.0.0.1] sender throttle, sender@mydomain.com -> msg_size (375/0, period: 86400 seconds, time left: 23 hours, 59 minutes, 14 seconds)
2018-12-06 08:32:16 INFO [127.0.0.1] sender throttle, sender@mydomain.com -> max_quota (1125/0, period: 86400 seconds, time left: 23 hours, 59 minutes, 14 seconds)
2018-12-06 08:32:16 DEBUG [SQL] Update tracking record(s):
2018-12-06 08:32:16 DEBUG [OK] Passed all sender throttle settings.
2018-12-06 08:32:16 DEBUG Bypass recipient throttling (found sasl_username).
2018-12-06 08:32:16 DEBUG <-- Result: DUNNO
2018-12-06 08:32:16 DEBUG Skip plugin: ldap_maillist_access_policy (protocol_state != END-OF-MESSAGE)
2018-12-06 08:32:16 DEBUG Skip plugin: amavisd_wblist (protocol_state != END-OF-MESSAGE)
2018-12-06 08:32:16 DEBUG Session ended.
2018-12-06 08:32:16 INFO [127.0.0.1] END-OF-MESSAGE, sender@mydomain.com => receiver@gmail.com, DUNNO [recipient_count=1, size=375, process_time=0.0084s]
2018-12-06 08:32:16 DEBUG Close LDAP connection.
Why would it be skipping these:
2018-12-06 08:32:16 DEBUG Skip plugin: reject_null_sender (protocol_state != END-OF-MESSAGE)
2018-12-06 08:32:16 DEBUG Skip plugin: wblist_rdns (protocol_state != END-OF-MESSAGE)
2018-12-06 08:32:16 DEBUG Skip plugin: reject_sender_login_mismatch (protocol_state != END-OF-MESSAGE)
2018-12-06 08:32:16 DEBUG Skip plugin: greylisting (protocol_state != END-OF-MESSAGE)
They are enabled in settings.py, and files are in the plugins folder