1

Topic: EE Edition Amavis Timeout too long.

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): v1.8.6
- Deployed with iRedMail Easy or the downloadable installer? EE
- Linux/BSD distribution name and version: Debian Trixie
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): NGINX
- Manage mail accounts with iRedAdmin-Pro? EE
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Ok I was getting multiple copies of the same emails. Here is what fixed it:

The Symptom: On Debian/Ubuntu with amavisd-milter, when an external HTML email hits a SpamAssassin DNS/network hang, Amavis's default timeout lets the scan run until $child_timeout (300 seconds), causing amavisd-milter to drop the connection (could not insert header 0 X-Virus-Scanned / Connection reset by peer), exhaust all Amavis child workers, delay small transactional emails (like 2FA codes), and trigger duplicate retries across sending clients and backup MX servers.

The Fix That Resolved It: Adding $sa_timeout = 15; and $max_requests = 10; inside /opt/iredmail/custom/amavisd/amavisd.conf forces SpamAssassin to abort stuck network checks long before amavisd-milter hits its 300-second socket timeout and recycles child processes before stale Perl Net::DNS sockets accumulate.

Suggested Default Improvement for EE: Recommending that iRedMail EE set a lower default $sa_timeout (such as 15 or 20 seconds, well below amavisd-milter's 300-second limit) in its generated 50-user template so a single stalled SpamAssassin lookup can never starve the worker pool.

----

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