1

Topic: iredapd outbound throttle

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version: ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx): apache
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue:
====

Hello guys,
im trying to set outbound and inbound throttle rules per user.
the inbound rules works just fine but it seems that the iredapd doesn't query the mysql for outbound rule

rules:
'1', 'raz@example.com', 'outbound', '100', '360', '10240000', '1', '4096000000'
'42', 'raz@example.com', 'inbound', '100', '360', '10240000', '1', '4096000000'

and when i send a message from outlook or from sogo:

2017-03-30 10:57:41 INFO [127.0.0.1] RCPT, raz@example.com -> raz@gmail.com, DUNNO
2017-03-30 10:57:41 DEBUG smtp session: request=smtpd_access_policy
2017-03-30 10:57:41 DEBUG smtp session: protocol_state=END-OF-MESSAGE
2017-03-30 10:57:41 DEBUG smtp session: protocol_name=ESMTP
2017-03-30 10:57:41 DEBUG smtp session: client_address=127.0.0.1
2017-03-30 10:57:41 DEBUG smtp session: client_name=
2017-03-30 10:57:41 DEBUG smtp session: client_port=40704
2017-03-30 10:57:41 DEBUG smtp session: reverse_client_name=
2017-03-30 10:57:41 DEBUG smtp session: helo_name=
2017-03-30 10:57:41 DEBUG smtp session: sender=raz@example.com
2017-03-30 10:57:41 DEBUG smtp session: recipient=raz@gmail.com
2017-03-30 10:57:41 DEBUG smtp session: recipient_count=1
2017-03-30 10:57:41 DEBUG smtp session: queue_id=44A6623EE17
2017-03-30 10:57:41 DEBUG smtp session: instance=3c67.58dcba75.227b6.0
2017-03-30 10:57:41 DEBUG smtp session: size=2489
2017-03-30 10:57:41 DEBUG smtp session: etrn_domain=
2017-03-30 10:57:41 DEBUG smtp session: stress=
2017-03-30 10:57:41 DEBUG smtp session: sasl_method=
2017-03-30 10:57:41 DEBUG smtp session: sasl_username=
2017-03-30 10:57:41 DEBUG smtp session: sasl_sender=
2017-03-30 10:57:41 DEBUG smtp session: ccert_subject=
2017-03-30 10:57:41 DEBUG smtp session: ccert_issuer=
2017-03-30 10:57:41 DEBUG smtp session: ccert_fingerprint=
2017-03-30 10:57:41 DEBUG smtp session: ccert_pubkey_fingerprint=
2017-03-30 10:57:41 DEBUG smtp session: encryption_protocol=
2017-03-30 10:57:41 DEBUG smtp session: encryption_cipher=
2017-03-30 10:57:41 DEBUG smtp session: encryption_keysize=0
2017-03-30 10:57:41 DEBUG smtp session: policy_context=
2017-03-30 10:57:41 DEBUG Drop invalid smtp session input: policy_context=
2017-03-30 10:57:41 DEBUG Skip plugin: reject_null_sender (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG Skip plugin: reject_sender_login_mismatch (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG Skip plugin: greylisting (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG --> Apply plugin: throttle
2017-03-30 10:57:41 DEBUG Bypass sender throttling (No sasl_username).
2017-03-30 10:57:41 DEBUG Check recipient throttling.
2017-03-30 10:57:41 DEBUG [SQL] Query throttle setting:

        SELECT id, account, priority, period, max_msgs, max_quota, msg_size
          FROM throttle
         WHERE kind='inbound' AND account IN ('127.0.0.1', '@ip', '@.', 'raz@gmail.com', '@gmail.com', '@.gmail.com', '@com', '@.com', '127.*.0.1', '127.*.*.*', '*.*.*.1', '127.0.0.*', '*.*.0.1', '*.0.0.1', '127.0.*.1', '*.*.*.*', '127.*.*.1', '127.0.*.*')
         ORDER BY priority DESC

2017-03-30 10:57:41 DEBUG [SQL] Query result:
[]
2017-03-30 10:57:41 DEBUG No recipient throttle setting.
2017-03-30 10:57:41 DEBUG <-- Result: DUNNO
2017-03-30 10:57:41 DEBUG Skip plugin: sql_alias_access_policy (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG Skip plugin: amavisd_wblist (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG Session ended


any suggestions?

Thank you,
Raz

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: iredapd outbound throttle

*) Which version of iRedAPD are you running? Please show us output of command:

ls -l /opt/

*) You didn't paste full log related to this testing email, please try again and copy full log. (NOTE: it contains 2 parts, one for protocol state "RCPT" (missed in your post), one for "END-OF-MESSAGE").

3

Re: iredapd outbound throttle

iRedAPD-1.9.1/

and sorry about the log
here is the full log of this test:

2017-03-30 10:57:41 DEBUG smtp session: request=smtpd_access_policy
2017-03-30 10:57:41 DEBUG smtp session: protocol_state=RCPT
2017-03-30 10:57:41 DEBUG smtp session: protocol_name=ESMTP
2017-03-30 10:57:41 DEBUG smtp session: client_address=127.0.0.1
2017-03-30 10:57:41 DEBUG smtp session: client_name=
2017-03-30 10:57:41 DEBUG smtp session: client_port=40704
2017-03-30 10:57:41 DEBUG smtp session: reverse_client_name=
2017-03-30 10:57:41 DEBUG smtp session: helo_name=
2017-03-30 10:57:41 DEBUG smtp session: sender=raz@example.com
2017-03-30 10:57:41 DEBUG smtp session: recipient=raz@gmail.com
2017-03-30 10:57:41 DEBUG smtp session: recipient_count=0
2017-03-30 10:57:41 DEBUG smtp session: queue_id=
2017-03-30 10:57:41 DEBUG smtp session: instance=3c67.58dcba75.227b6.0
2017-03-30 10:57:41 DEBUG smtp session: size=0
2017-03-30 10:57:41 DEBUG smtp session: etrn_domain=
2017-03-30 10:57:41 DEBUG smtp session: stress=
2017-03-30 10:57:41 DEBUG smtp session: sasl_method=
2017-03-30 10:57:41 DEBUG smtp session: sasl_username=
2017-03-30 10:57:41 DEBUG smtp session: sasl_sender=
2017-03-30 10:57:41 DEBUG smtp session: ccert_subject=
2017-03-30 10:57:41 DEBUG smtp session: ccert_issuer=
2017-03-30 10:57:41 DEBUG smtp session: ccert_fingerprint=
2017-03-30 10:57:41 DEBUG smtp session: ccert_pubkey_fingerprint=
2017-03-30 10:57:41 DEBUG smtp session: encryption_protocol=
2017-03-30 10:57:41 DEBUG smtp session: encryption_cipher=
2017-03-30 10:57:41 DEBUG smtp session: encryption_keysize=0
2017-03-30 10:57:41 DEBUG smtp session: policy_context=
2017-03-30 10:57:41 DEBUG Drop invalid smtp session input: policy_context=
2017-03-30 10:57:41 DEBUG --> Apply plugin: reject_null_sender
2017-03-30 10:57:41 DEBUG Local sender.
2017-03-30 10:57:41 DEBUG <-- Result: DUNNO
2017-03-30 10:57:41 DEBUG --> Apply plugin: reject_sender_login_mismatch
2017-03-30 10:57:41 DEBUG Not an authenticated sender (no sasl_username).
2017-03-30 10:57:41 DEBUG Local sender.
2017-03-30 10:57:41 DEBUG <-- Result: DUNNO
2017-03-30 10:57:41 DEBUG --> Apply plugin: greylisting
2017-03-30 10:57:41 DEBUG Local sender.
2017-03-30 10:57:41 DEBUG <-- Result: DUNNO
2017-03-30 10:57:41 DEBUG --> Apply plugin: throttle
2017-03-30 10:57:41 DEBUG Bypass sender throttling (No sasl_username).
2017-03-30 10:57:41 DEBUG Check recipient throttling.
2017-03-30 10:57:41 DEBUG [SQL] Query throttle setting:

        SELECT id, account, priority, period, max_msgs, max_quota, msg_size
          FROM throttle
         WHERE kind='inbound' AND account IN ('127.0.0.1', '@ip', '@.', 'raz@gmail.com', '@gmail.com', '@.gmail.com', '@com', '@.com', '127.*.0.1', '127.*.*.*', '*.*.*.1', '127.0.0.*', '*.*.0.1', '*.0.0.1', '127.0.*.1', '*.*.*.*', '127.*.*.1', '127.0.*.*')
         ORDER BY priority DESC

2017-03-30 10:57:41 DEBUG [SQL] Query result:
[]
2017-03-30 10:57:41 DEBUG No recipient throttle setting.
2017-03-30 10:57:41 DEBUG <-- Result: DUNNO
2017-03-30 10:57:41 DEBUG --> Apply plugin: sql_alias_access_policy
2017-03-30 10:57:41 DEBUG [SQL] query access policy:
SELECT accesspolicy, goto, moderators
               FROM alias
              WHERE
                    address='raz@gmail.com'
                    AND islist=1
                    AND active=1
              LIMIT 1
2017-03-30 10:57:41 DEBUG SQL query result: None
2017-03-30 10:57:41 DEBUG [SQL] Check whether recipient domain is an alias domain:
SELECT target_domain
                   FROM alias_domain
                  WHERE alias_domain = 'gmail.com'
                  LIMIT 1

2017-03-30 10:57:41 DEBUG [SQL] query result: None
2017-03-30 10:57:41 DEBUG Recipient domain is not an alias domain.
2017-03-30 10:57:41 DEBUG <-- Result: DUNNO (Not a mail alias account)
2017-03-30 10:57:41 DEBUG --> Apply plugin: amavisd_wblist
2017-03-30 10:57:41 DEBUG Possible policy senders: ['@.', 'raz@example.com', '@example.com', '@.example.com', '@com', '@.com', 'raz@*', '127.0.0.1', '127.*.0.1', '127.*.*.*', '*.*.*.1', '127.0.0.*', '*.*.0.1', '*.0.0.1', '127.0.*.1', '*.*.*.*', '127.*.*.1', '127.0.*.*']
2017-03-30 10:57:41 DEBUG Possible policy recipients: ['@.', 'raz@gmail.com', '@gmail.com', '@.gmail.com', '@com', '@.com']
2017-03-30 10:57:41 DEBUG Apply wblist for inbound message.
2017-03-30 10:57:41 DEBUG [SQL] Query local addresses:
SELECT id, email
               FROM users
              WHERE email IN ('@.', 'raz@gmail.com', '@gmail.com', '@.gmail.com', '@com', '@.com')
           ORDER BY priority DESC
2017-03-30 10:57:41 DEBUG No record found in SQL database.
2017-03-30 10:57:41 DEBUG No valid sender id or recipient id.
2017-03-30 10:57:41 DEBUG <-- Result: DUNNO
2017-03-30 10:57:41 DEBUG Session ended
2017-03-30 10:57:41 INFO [127.0.0.1] RCPT, raz@example.com -> raz@gmail.com, DUNNO
2017-03-30 10:57:41 DEBUG smtp session: request=smtpd_access_policy
2017-03-30 10:57:41 DEBUG smtp session: protocol_state=END-OF-MESSAGE
2017-03-30 10:57:41 DEBUG smtp session: protocol_name=ESMTP
2017-03-30 10:57:41 DEBUG smtp session: client_address=127.0.0.1
2017-03-30 10:57:41 DEBUG smtp session: client_name=
2017-03-30 10:57:41 DEBUG smtp session: client_port=40704
2017-03-30 10:57:41 DEBUG smtp session: reverse_client_name=
2017-03-30 10:57:41 DEBUG smtp session: helo_name=
2017-03-30 10:57:41 DEBUG smtp session: sender=raz@example.com
2017-03-30 10:57:41 DEBUG smtp session: recipient=raz@gmail.com
2017-03-30 10:57:41 DEBUG smtp session: recipient_count=1
2017-03-30 10:57:41 DEBUG smtp session: queue_id=44A6623EE17
2017-03-30 10:57:41 DEBUG smtp session: instance=3c67.58dcba75.227b6.0
2017-03-30 10:57:41 DEBUG smtp session: size=2489
2017-03-30 10:57:41 DEBUG smtp session: etrn_domain=
2017-03-30 10:57:41 DEBUG smtp session: stress=
2017-03-30 10:57:41 DEBUG smtp session: sasl_method=
2017-03-30 10:57:41 DEBUG smtp session: sasl_username=
2017-03-30 10:57:41 DEBUG smtp session: sasl_sender=
2017-03-30 10:57:41 DEBUG smtp session: ccert_subject=
2017-03-30 10:57:41 DEBUG smtp session: ccert_issuer=
2017-03-30 10:57:41 DEBUG smtp session: ccert_fingerprint=
2017-03-30 10:57:41 DEBUG smtp session: ccert_pubkey_fingerprint=
2017-03-30 10:57:41 DEBUG smtp session: encryption_protocol=
2017-03-30 10:57:41 DEBUG smtp session: encryption_cipher=
2017-03-30 10:57:41 DEBUG smtp session: encryption_keysize=0
2017-03-30 10:57:41 DEBUG smtp session: policy_context=
2017-03-30 10:57:41 DEBUG Drop invalid smtp session input: policy_context=
2017-03-30 10:57:41 DEBUG Skip plugin: reject_null_sender (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG Skip plugin: reject_sender_login_mismatch (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG Skip plugin: greylisting (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG --> Apply plugin: throttle
2017-03-30 10:57:41 DEBUG Bypass sender throttling (No sasl_username).
2017-03-30 10:57:41 DEBUG Check recipient throttling.
2017-03-30 10:57:41 DEBUG [SQL] Query throttle setting:

        SELECT id, account, priority, period, max_msgs, max_quota, msg_size
          FROM throttle
         WHERE kind='inbound' AND account IN ('127.0.0.1', '@ip', '@.', 'raz@gmail.com', '@gmail.com', '@.gmail.com', '@com', '@.com', '127.*.0.1', '127.*.*.*', '*.*.*.1', '127.0.0.*', '*.*.0.1', '*.0.0.1', '127.0.*.1', '*.*.*.*', '127.*.*.1', '127.0.*.*')
         ORDER BY priority DESC

2017-03-30 10:57:41 DEBUG [SQL] Query result:
[]
2017-03-30 10:57:41 DEBUG No recipient throttle setting.
2017-03-30 10:57:41 DEBUG <-- Result: DUNNO
2017-03-30 10:57:41 DEBUG Skip plugin: sql_alias_access_policy (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG Skip plugin: amavisd_wblist (protocol_state != END-OF-MESSAGE)
2017-03-30 10:57:41 DEBUG Session ended
2017-03-30 10:57:41 INFO [127.0.0.1] END-OF-MESSAGE, raz@example.com -> raz@gmail.com, DUNNO

Thank you Zhang!

Raz

4

Re: iredapd outbound throttle

raz wrote:

iRedAPD-1.9.1/

Please upgrade to iRedAPD-2.0, it enforces sender throttling for both local sender (sasl authenticated local user)  and external sender.