Troubleshooting

<h2>Not receiving / sending (viewing) e-mail</h2> <h3>ClamAV-clamd av-scanner FAILED</h3> <pre><code>Jul 27 10:42:47 mailserver amavis[13951]: (13951-13) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: Connection refused Jul 27 10:42:47 mailserver amavis[13951]: (13951-13) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (All attempts (1) failed connecting to /var/run/clamav/clamd.ctl) at (eval 98) line 613.\n Jul 27 10:42:47 mailserver amavis[13951]: (13951-13) (!)WARN: all primary virus scanners failed, considering backups</code></pre> <p>Restart clamav service:</p> <pre><code class="language-shell">systemctl restart clamav-daemon</code></pre> <h3>Corrupt AMAVIS (10024) cache</h3> <p>When general e-mail sending / receiving (and even vieweing the inbox) it may be caused by an AMAVIS (10024) malfunciton. For instance when you see the following in the /var/log/mail.log:</p> <pre><code class="language-shell">Mar 1 10:31:29 mailserver postfix/error[600]: 9DCF98AD3E: to=&lt;john@example.com&gt;, relay=none, delay=0.21, delays=0.16/0.03/0/0.02, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)</code></pre> <p>and then when investigation the AMAVIS logs (<code>service amavis status</code>) you encounter: </p> <pre><code>Jul 4 10:31:23 server amavis[9941]: (!!)TROUBLE in pre_loop_hook: db_init: BDB no dbS: __fop_file_setup: Retry limit (100) exceeded, File exists. at (eval 97) line 309. Jul 4 10:31:23 server amavis[9941]: (!)_DIE: Suicide () TROUBLE in pre_loop_hook: db_init: BDB no dbS: __fop_file_setup: Retry limit (100) exceeded, File exists. at (eval 97) line 309.</code></pre> <p>it is sometimes caused by a corrupt AMAVIS cache.</p> <ul> <li>Clear the cache: <pre><code class="language-shell">rm /var/lib/amavis/db/*</code></pre></li> </ul>