1

Topic: IRedAPD error and not populating throttle_tracking

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
-IRedAPD 3.5
- iRedAPD only
- CentOS 7
- local users
- N/A
- Just using iRedApd
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

OS CentOS 7 latest
Postfix 2.10.1
iRedAPD Version 3.5

Every time a message is sent or received this entry is logged:

Mar 16 10:34:41 mail journal: iredapd Unexpected error: 'NoneType' object has no attribute 'connect'. Fallback to default action: DUNNO

smtp_sessions in MySQL is being populated, example of outgoing smtp session:

Here is an outgoing smtp_sessions row:

                 id: 25
               time: 2020-03-16 14:22:39
           time_num: 1584368559
             action: DUNNO
             reason:
           instance: 6f0d.5e6f8baf.34902.0
     client_address: <<clientIP redacted>>
        client_name: unknown
reverse_client_name: unknown
          helo_name: <<helo_name redacted>>
             sender: <<sender email redacted>>
      sender_domain: <<sender domain redacted>>
      sasl_username: <<SASL username redacted>>
        sasl_domain: <<SASL domain redacted>>
          recipient: <<recipient redacted>>
   recipient_domain: gmail.com
encryption_protocol:
  encryption_cipher:
     server_address:
        server_port:

throttle_tracking in MySQL is not being populated

Here is the throttle setting:

MariaDB [iredapd]> select * from throttle;
+----+---------+----------+----------+--------+----------+----------+-----------+
| id | account | kind     | priority | period | msg_size | max_msgs | max_quota |
+----+---------+----------+----------+--------+----------+----------+-----------+
|  1 | @.      | outbound |        0 |     60 |        0 |      100 |         0 |
+----+---------+----------+----------+--------+----------+----------+-----------+

Relevant postfix configuration:

smtpd_recipient_restrictions =
        check_policy_service inet:127.0.0.1:7777,
        ...
        reject
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:7777

iRedApd config:

# Listen address and port.
listen_address = '127.0.0.1'
# Port for normal Postfix policy requests.
listen_port = 7777
# Ports for SRS (Sender Rewriting Scheme).
# - `srs_forward_port` is used in Postfix parameter `sender_canonical_maps`.
# - `recipient_canonical_maps` is used in Postfix parameter `recipient_canonical_maps`.
#srs_forward_port = 7778
#srs_reverse_port = 7779
# SRS (Sender Rewriting Scheme)
#
# The secret key(s) used to generate cryptographic hash.
# The first secret key is used for generating AND verifying hash in SRS
# address. If you have old keys, you can append them also for verification only.
srs_secrets = []

# Rewrite address will be 'xxx@<srs_domain>', so please make sure `srs_domain`
# is a resolvable mail domain name and pointed to your server.
srs_domain = ''
# Run as a low privileged user.
run_as_user = 'iredapd'
# Path to pid file.
pid_file = '/var/run/iredapd.pid'
# Log level: info, debug.
log_level = 'debug'
# Backend: ldap, mysql, pgsql.
backend = 'mysql'
# Enabled plugins.
plugins = ['throttle']

# iRedAPD database, used for greylisting, throttle.
iredapd_db_server = '127.0.0.1'
iredapd_db_port = '3306'
iredapd_db_name = 'iredapd'
iredapd_db_user = 'iredapd'
iredapd_db_password = '<<redacted>>'

----

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

2

Re: IRedAPD error and not populating throttle_tracking

Please try to restart iredapd service and check its log file (/var/log/iredapd/iredapd.log) IMMEDIATELY, i expect to see some log lines which indicates some SQL related error.

3

Re: IRedAPD error and not populating throttle_tracking

ZhangHuangbin wrote:

Please try to restart iredapd service and check its log file (/var/log/iredapd/iredapd.log) IMMEDIATELY, i expect to see some log lines which indicates some SQL related error.

It says this:

Mar 19 09:03:03 mail journal: iredapd Error while create SQL connection: KeyError('vmail_db_user',)
Mar 19 09:03:03 mail journal: iredapd Error while create SQL connection: KeyError('amavisd_db_user',)
Mar 19 09:03:03 mail journal: iredapd Starting iRedAPD (version: 3.5, backend: mysql), listening on 127.0.0.1:7777.
Mar 19 09:03:03 mail journal: iredapd Loading plugin (priority: 60): throttle
Mar 19 09:03:03 mail journal: iredapd No SRS domain and/or secret strings in settings.py, not loaded.

We are only using throttle though, so I don't know why it needs amavisd or vmail. ??

4

Re: IRedAPD error and not populating throttle_tracking

LinMailGuy wrote:

Mar 19 09:03:03 mail journal: iredapd Error while create SQL connection: KeyError('vmail_db_user',)
Mar 19 09:03:03 mail journal: iredapd Error while create SQL connection: KeyError('amavisd_db_user',)

See, your /opt/iredapd/settings.py misses at least 2 parameters. Please double check and make sure you have required parameters:

# For SQL (MySQL/MariaDB/PostgreSQL) backends, used to query mail accounts.
vmail_db_server = '127.0.0.1'
vmail_db_port = '3306'
vmail_db_name = 'vmail'
vmail_db_user = 'vmail'
vmail_db_password = 'password'

# For Amavisd policy lookup and white/blacklists.
amavisd_db_server = '127.0.0.1'
amavisd_db_port = '3306'
amavisd_db_name = 'amavisd'
amavisd_db_user = 'amavisd'
amavisd_db_password = 'password'

# iRedAPD database, used for greylisting, throttle.
iredapd_db_server = '127.0.0.1'
iredapd_db_port = '3306'
iredapd_db_name = 'iredapd'
iredapd_db_user = 'iredapd'
iredapd_db_password = 'password'

5

Re: IRedAPD error and not populating throttle_tracking

ZhangHuangbin wrote:
LinMailGuy wrote:

Mar 19 09:03:03 mail journal: iredapd Error while create SQL connection: KeyError('vmail_db_user',)
Mar 19 09:03:03 mail journal: iredapd Error while create SQL connection: KeyError('amavisd_db_user',)

See, your /opt/iredapd/settings.py misses at least 2 parameters. Please double check and make sure you have required parameters:

# For SQL (MySQL/MariaDB/PostgreSQL) backends, used to query mail accounts.
vmail_db_server = '127.0.0.1'
vmail_db_port = '3306'
vmail_db_name = 'vmail'
vmail_db_user = 'vmail'
vmail_db_password = 'password'

# For Amavisd policy lookup and white/blacklists.
amavisd_db_server = '127.0.0.1'
amavisd_db_port = '3306'
amavisd_db_name = 'amavisd'
amavisd_db_user = 'amavisd'
amavisd_db_password = 'password'

# iRedAPD database, used for greylisting, throttle.
iredapd_db_server = '127.0.0.1'
iredapd_db_port = '3306'
iredapd_db_name = 'iredapd'
iredapd_db_user = 'iredapd'
iredapd_db_password = 'password'

Hello,

As I mentioned we are only using the throttle feature. We aren't using Amavisd or virtual mail. All of the accounts are local user accounts... Thats why I removed that from the config. Why wouldnt the throttle table populate?

Thank you

6

Re: IRedAPD error and not populating throttle_tracking

- It won't hurt to keep these settings especially if you don't exactly know whether they're involved. sad
- Throttle feature requires vmail db and iredapd db connections.

7

Re: IRedAPD error and not populating throttle_tracking

ZhangHuangbin wrote:

- It won't hurt to keep these settings especially if you don't exactly know whether they're involved. sad
- Throttle feature requires vmail db and iredapd db connections.

Okay but there is no vmail db because we aren't using a database to store accounts.

So what is supposed to be in that table? You realize that doesn't make any sense right?

8

Re: IRedAPD error and not populating throttle_tracking

So you're NOT running iRedMail server but just the iRedAPD?

iRedAPD is bound to iRedMail, the SQL schema or LDAP structure, i didn't try iRedAPD with a non-iRedMail server, and make iRedAPD working with a non-iRedMail server is not our plan at all.