1

Topic: Error Greylisting

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: Centos 7.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MYSQL
- Web server (Apache or Nginx): NGINX
- Manage mail accounts with iRedAdmin-Pro? NO
- Related log if you're reporting an issue: Greylisting
====

Hello in my log (iredapd) have the line:

ERROR <!> Error while applying plugin "greylisting": unsupported operand type(s) for +: 'int' and 'str'

but my configuration file is default the installation.

How procedure in the error?

----

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

2

Re: Error Greylisting

Could you please turn on debug mode in iRedAPD, and keep monitoring its log file? If it occur again, please extract full log related to the new error from iRedAPD log file /var/log/iredapd/iredapd.log and paste here.

3

Re: Error Greylisting

Hello
so far only these error messages have occurred.

2016-06-27 06:01:05 DEBUG Not an valid IP network: (id=8847034, sender=200.147.1.0/22, comment="AUTO-UPDATE: bol.com.br"), error: 200.147.1.0/22 has host bits set
2016-06-27 06:01:05 DEBUG Not an valid IP network: (id=8847039, sender=200.147.41.88/26, comment="AUTO-UPDATE: bol.com.br"), error: 200.147.41.88/26 has host bits set
2016-06-27 06:01:05 DEBUG Not an valid IP network: (id=8847040, sender=200.147.99.24/26, comment="AUTO-UPDATE: bol.com.br"), error: 200.147.99.24/26 has host bits set
2016-06-27 06:01:05 DEBUG Not an valid IP network: (id=8847041, sender=200.147.98.72/27, comment="AUTO-UPDATE: bol.com.br"), error: 200.147.98.72/27 has host bits set
2016-06-27 06:02:40 DEBUG Not an valid IP network: (id=8847034, sender=200.147.1.0/22, comment="AUTO-UPDATE: bol.com.br"), error: 200.147.1.0/22 has host bits set
2016-06-27 06:02:40 DEBUG Not an valid IP network: (id=8847039, sender=200.147.41.88/26, comment="AUTO-UPDATE: bol.com.br"), error: 200.147.41.88/26 has host bits set
2016-06-27 06:02:40 DEBUG Not an valid IP network: (id=8847040, sender=200.147.99.24/26, comment="AUTO-UPDATE: bol.com.br"), error: 200.147.99.24/26 has host bits set
2016-06-27 06:02:40 DEBUG Not an valid IP network: (id=8847041, sender=200.147.98.72/27, comment="AUTO-UPDATE: bol.com.br"), error: 200.147.98.72/27 has host bits set
2016-06-27 08:44:45 DEBUG Not an valid IP network: (id=8851393, sender=65.55.238.129/26, comment="AUTO-UPDATE: hotmail.com"), error: 65.55.238.129/26 has host bits set

4

Re: Error Greylisting

mrteam wrote:

so far only these error messages have occurred.

This is fine.

Could you please show me output of below commands?

ls -l /opt/
cat /etc/iredmail-release

5

Re: Error Greylisting

DEBUG-IREDAPD-log wrote:

2016-06-27 08:21:02 INFO [200.147.33.216] END-OF-MESSAGE,  -> comercial@main.domain, DUNNO
2016-06-27 08:25:35 DEBUG Connect from 127.0.0.1, port 51532.
2016-06-27 08:25:35 DEBUG smtp session: request=smtpd_access_policy
2016-06-27 08:25:35 DEBUG smtp session: protocol_state=RCPT
2016-06-27 08:25:35 DEBUG smtp session: protocol_name=ESMTP
2016-06-27 08:25:35 DEBUG smtp session: client_address=213.229.161.138
2016-06-27 08:25:35 DEBUG smtp session: client_name=mx4.mitula.org
2016-06-27 08:25:35 DEBUG smtp session: reverse_client_name=mx4.mitula.org
2016-06-27 08:25:35 DEBUG smtp session: helo_name=mitula.net
2016-06-27 08:25:35 DEBUG smtp session: sender=noreply@mitula.org
2016-06-27 08:25:35 DEBUG smtp session: recipient=trafego@main.domain
2016-06-27 08:25:35 DEBUG smtp session: recipient_count=0
2016-06-27 08:25:35 DEBUG smtp session: queue_id=
2016-06-27 08:25:35 DEBUG smtp session: instance=12c8.57710d2f.5b608.0
2016-06-27 08:25:35 DEBUG smtp session: size=6107
2016-06-27 08:25:35 DEBUG smtp session: etrn_domain=
2016-06-27 08:25:35 DEBUG smtp session: stress=
2016-06-27 08:25:35 DEBUG smtp session: sasl_method=
2016-06-27 08:25:35 DEBUG smtp session: sasl_username=
2016-06-27 08:25:35 DEBUG smtp session: sasl_sender=
2016-06-27 08:25:35 DEBUG smtp session: ccert_subject=
2016-06-27 08:25:35 DEBUG smtp session: ccert_issuer=
2016-06-27 08:25:35 DEBUG smtp session: ccert_fingerprint=
2016-06-27 08:25:35 DEBUG smtp session: ccert_pubkey_fingerprint=
2016-06-27 08:25:35 DEBUG smtp session: encryption_protocol=
2016-06-27 08:25:35 DEBUG smtp session: encryption_cipher=
2016-06-27 08:25:35 DEBUG smtp session: encryption_keysize=0
2016-06-27 08:25:35 DEBUG --> Apply plugin: reject_null_sender
2016-06-27 08:25:35 DEBUG <-- Result: DUNNO
2016-06-27 08:25:35 DEBUG --> Apply plugin: reject_sender_login_mismatch
2016-06-27 08:25:35 DEBUG Not an authenticated sender (no sasl_username).
2016-06-27 08:25:35 DEBUG [SQL] query alias domains:
SELECT alias_domain
                               FROM alias_domain
                              WHERE alias_domain='mitula.org' OR target_domain='mitula.org'
                              LIMIT 1
2016-06-27 08:25:35 DEBUG SQL query result: None
2016-06-27 08:25:35 DEBUG Sender domain is not hosted locally.
2016-06-27 08:25:35 DEBUG <-- Result: DUNNO
2016-06-27 08:25:35 DEBUG --> Apply plugin: greylisting
2016-06-27 08:25:35 DEBUG [SQL] Query greylisting whitelists:
SELECT id, sender, comment
               FROM greylisting_whitelists
              WHERE account IN ('trafego@main.domain', '@main.domain', '@.')
2016-06-27 08:25:35 DEBUG No whitelist found.
2016-06-27 08:25:35 DEBUG [SQL] query greylisting settings:
SELECT id, account, sender, sender_priority, active
               FROM greylisting
              WHERE account IN ('trafego@main.domain', '@main.domain', '@.')
              ORDER BY priority DESC, sender_priority DESC
2016-06-27 08:25:35 DEBUG [SQL] query result: [(1L, '@.', '@.', 0, 1)]
2016-06-27 08:25:35 DEBUG Greylisting should be applied according to SQL record: (id=1, account='@.', sender='@.')
2016-06-27 08:25:35 ERROR <!> Error while applying plugin "greylisting": unsupported operand type(s) for +: 'int' and 'str'
2016-06-27 08:25:35 DEBUG --> Apply plugin: throttle
2016-06-27 08:25:35 DEBUG Bypass sender throttling (No sasl_username).
2016-06-27 08:25:35 DEBUG Check recipient throttling.
2016-06-27 08:25:35 DEBUG [SQL] Query throttle setting:

        SELECT id, account, priority, period, max_msgs, max_quota, msg_size
          FROM throttle
         WHERE kind='inbound' AND account IN ('213.229.161.138', '@ip', '@.', 'trafego@main.domain', '@main.domain', '@.main.domain', '@com.br', '@.com.br', '@br', '@.br', '*.*.*.138', '213.229.*.*', '213.*.*.*', '213.*.161.138', '*.*.161.138', '213.229.161.*', '*.229.161.138', '213.*.*.138', '213.229.*.138', '*.*.*.*')
         ORDER BY priority DESC

2016-06-27 08:25:35 DEBUG [SQL] Query result:
[]
2016-06-27 08:25:35 DEBUG No recipient throttle setting.
2016-06-27 08:25:35 DEBUG <-- Result: DUNNO
2016-06-27 08:25:35 DEBUG --> Apply plugin: sql_alias_access_policy
2016-06-27 08:25:35 DEBUG [SQL] query access policy:
SELECT accesspolicy, goto, moderators
               FROM alias
              WHERE
                    address='trafego@main.domain'
                    AND islist=1
                    AND active=1
              LIMIT 1

2016-06-27 08:25:35 DEBUG SQL query result: None

ls -l /opt
total 8
-rwxr-xr-x  1 root root 1598 Jun 16 21:02 backup.sh
lrwxrwxrwx. 1 root root   18 Jun  5 11:57 iredapd -> /opt/iRedAPD-1.9.1
dr-x------. 7 root root 4096 Jun 27 09:08 iRedAPD-1.9.1
drwxr-xr-x  2 root root    6 Jun  7 21:35 php-5
 cat /etc/iredmail-release
0.9.5-1     # Get professional upgrade support from iRedMail Team: http://www.iredmail.org/support.html

6 (edited by j3roen 2017-04-01 16:03:58)

Re: Error Greylisting

I'm having the same problem. Using iRedAPD 2.0. I tried upgrading to 2.1, but the problem persists.

2017-04-01 09:31:56 ERROR <!> Error while applying plugin "greylisting": ['Traceback (most recent call last):\n', '  File "/opt/iRedAPD-2.1/libs/utils.py", line 101, in apply_plugin\n', '  File "/opt/iredapd/plugins/greylisting.py", line 401, in restriction\n', '  File "/opt/iredapd/plugins/greylisting.py", line 210, in _should_be_greylisted_by_tracking\n', "TypeError: unsupported operand type(s) for +: 'int' and 'str'\n"]

Platform is Ubuntu 16.04; up-to-date with all patches.

7 (edited by j3roen 2017-04-02 00:08:58)

Re: Error Greylisting

I found the solution in my case.

I had in settings.py:

GREYLISTING_BLOCK_EXPIRE = "5"

But this should have been:

GREYLISTING_BLOCK_EXPIRE = 5

Python apparently doesn't automatically detect integers.

8

Re: Error Greylisting

j3roen wrote:

Python apparently doesn't automatically detect integers.

Not Python's fault.

- Sysadmin should check document to understand which format should be used.
- iRedAPD code should always convert them to integer -- this helps avoid sysadmin's mistake. I committed code to do this moment ago.

Thanks for the feedback.