The document describes troubleshooting an issue where emails were being deferred from a Zimbra mail server due to port 10024 being refused. The potential causes were a failed or stopped amavisd service, an out-of-date ClamAV antivirus package, or a stale amavisd.pid file. The resolutions included restarting the amavisd service, upgrading ClamAV, and removing and updating the amavisd.pid file before restarting Zimbra services.
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection Refused
1. Zimbra Troubleshooting – Port 10024: Connection refused
i | P a g e
Table of Contents
Overview.......................................................................................................................................................1
Login – EMail Server..................................................................................................................................1
E-Mail Server – Log Directory ...................................................................................................................1
E-Mail Server – Filter Error........................................................................................................................1
E-Mail Server – Zimbra Queue Statistics...................................................................................................3
E-Mail Server – Postfix Queue ..................................................................................................................3
Error Message – Log Snippet ................................................................................................................3
Error Message – Cause..........................................................................................................................4
Zmamavisdctl Service – Resolution #1......................................................................................................4
ClamAV Package – Resolution #2.............................................................................................................4
ClamAV Package – Upgrade......................................................................................................................5
Stale amavisd.pid – Resolution #3 ...........................................................................................................5
Stale amavisd.pid – Remove PID..............................................................................................................6
Stale amavisd.pid – Updated PID.............................................................................................................6
Stale amavisd.pid – Validate zmqstat ......................................................................................................7
2. Zimbra Troubleshooting – Port 10024: Connection refused
1 | P a g e
Overview
Sometimes there may be a case, wherein all the emails sent to a domain will be deferred from Zimbra
mail service.
In this guide we will check a possible “amavisd” could be failed / stopped. In order to resume deferment
of emails sent from this domain service has to be restarted.
Also in some scenario clamav (clam Anti-virus) tool is not updated with latest version, hence signatures
will not be downloaded and clamav service seize to function.
Another scenario amavisd.pid becomes stale during automatic restart and service doesn’t restart and PID
file is not updated due to this.
We will walk through the process of identifying and resolve such issue.
Login – EMail Server
Login to email server and switch to Zimbra account.
sudo su - zimbra
E-Mail Server – Log Directory
After logging on to the server, switch to Zimbra Log Folder.
By default, Zimbra log folder is configured to “/var/log” this is mail administrator configurable parameter
during installation.
cd /var/log/
E-Mail Server – Filter Error
After switching to Zimbra Log Folder, filter for text “127.0.0.1:10024”, run the command;
cat zimbra.log | grep m 1 "10024"
or
cat zimbra.log | grep -m 1 "127.0.0.1[127.0.0.1]:10024"
4. Zimbra Troubleshooting – Port 10024: Connection refused
3 | P a g e
You can also check the port status by telnet command; to know the status of port run the command;
telnet 127.0.0.1 10024
E-Mail Server – Zimbra Queue Statistics
To know the current status Zimbra mail service queue statistics, run the command;
sudo ~/libexec/zmqstat
E-Mail Server – Postfix Queue
To know the current postfix queue status, run the command;
/opt/zimbra/postfix/sbin/postqueue -p
Error Message – Log Snippet
postfix/smtp[14955]: connect to 127.0.0.1[127.0.0.1] 10024: Connection refused
5. Zimbra Troubleshooting – Port 10024: Connection refused
4 | P a g e
Error Message – Cause
amavisd service has abruptly stopped, check current “amavisd” service status.
After you have logged, switch to Zimbra application user, switch to Zimbra user and run command;
zmamavisdctl status
Alternatively, you could also run zmcontrol status, to know the status of all Zimbra related services.
Zmamavisdctl Service – Resolution #1
Since “zmamavisdctl” is not running, we need to restart the service “amavisd” to restart service, run the
command;
sudo su - zimbra
postfix stop
zmamavisdctl stop
zmamavisdctl start
postfix start
ClamAV Package – Resolution #2
In some scenario, clamav (antivirus) package has to be upgraded to newer version and calmav service will
not start till you upgrade package manually, to identify the current version and possible version upgrade
requirement, run the command;
cd /opt/zimbra/log
ll *.log
cat freshclam.log
6. Zimbra Troubleshooting – Port 10024: Connection refused
5 | P a g e
ClamAV Package – Upgrade
Since we already know that the clamav version deployed on the server, we will List latest version of
package availability and upgrade it; to upgrade the package run the command;
yum list clamav && yum upgrade clamav -q
After package upgrade restart the Zimbra services run command; zmcontrol restart
Stale amavisd.pid – Resolution #3
If resolution #1 and #2 doesn’t resolve the issue; amavisd.pid could be in a stale state and doesn’t restart
automatically as needed, hence we will remove the amavisd.pid file and restart service(s), before you
remove the process ID (pid file) check status of Process ID file.
cd /var/zimbra/log/
ll *.pid
7. Zimbra Troubleshooting – Port 10024: Connection refused
6 | P a g e
Stale amavisd.pid – Remove PID
Now that we have found that amavisd.pid has not been updated, whereas other services pid files have
updated, so we consider that as stale state of a process and we will remove the file, to remove the file run
the command;
rm amavisd.pid
After deleting the file restart the Zimbra services run command; zmcontrol restart
Stale amavisd.pid – Updated PID
After deleting the file restart the Zimbra services run command; zmcontrol restart. Once the service is
restarted, amavisd.pid file gets updated, you can again list the PID’s and check.
8. Zimbra Troubleshooting – Port 10024: Connection refused
7 | P a g e
Stale amavisd.pid – Validate zmqstat
Once the services have been restarted, within few minutes you can check Zimbra mail queue deferred
emails are being delivered, run the command;
sudo ~/libexec/zmqstat