Wednesday, May 9, 2018

Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection Refused


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"



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

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



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


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


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.



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




Slideshare Information

A step by step guide is uploaded to slideshare with screenshot.


No comments:

Post a Comment