Unable to get information from zmcontrol

This issue is mainly occurring due to the incorrect permission of /opt/zimbra/redolog and /opt/zimbra/redolog/redo.log.

Do the following steps:

[root@zimbra bin]# ls -l /opt/zimbra/redolog
total 8
drwxr-x— 2 root root 4096 Mar 20 13:17 archive
-rw-r—– 1 root root 1292 Apr 11 19:11 redo.log

The chower ship of /opt/zimbra/redolog/redo.log and /opt/zimbra/redolog must be zimbra.

chown -R zimbra.zimbra /opt/zimbra/redolog/

[root@zimbra bin]# ls -l /opt/zimbra/redolog
total 8
drwxr-x— 2 zimbra zimbra 4096 Mar 20 19:17 archive
-rw-r—– 1 zimbra zimbra 1292 Apr 11 19:59 /opt/zimbra/redolog/redo.log

Now try the “zmcontrol status” and “zmcontrol start”. This will work fine now.

Note: If you are facing difficulty in running “zmcontrol status”, try the exact path “/opt/zimbra/bin/zmcontrol status”.

Flush mail queue in sendmail

To flush the mail queue manually in sendmail servers, use

$ /usr/sbin/sendmail -q -v

Better way

Make a backup of the existing queue directory.

$ mv mqueue mqueue.bak

Create the ‘mqueue’ directory with the same permissions and ownership. Then, type in

$ /usr/sbin/sendmail -q -v -OQueueDirectory=/var/spool/mqueue.bak

You can use the same command to flush any sendmail queue as some servers have multiple queue setup like mqueue, mqueue.site, clientmqueue, q1, q2 etc.

Change SMTP source IP address in sendmail

1. Edit sendmail.cf search for ClientPortOptions

2. Change

#O ClientPortOptions=Family=inet, Address=x.x.x.x

to

O ClientPortOptions=Family=inet, Address=

3. Restart sendmail

4. Verify by sending a mail and checking the full header

CLIENT_OPTIONS(`field1=value1,field2=value2,…’) in sendmail.mc file is equivalent to ClientPortOptions in the sendmail.cf file.

Script for deleting all the mails in Qmail

1. create a file with the following statements, say delqmail

service qmail stop
find /var/qmail/queue/mess -type f -exec rm {} \;
find /var/qmail/queue/info -type f -exec rm {} \;
find /var/qmail/queue/local -type f -exec rm {} \;
find /var/qmail/queue/intd -type f -exec rm {} \;
find /var/qmail/queue/todo -type f -exec rm {} \;
find /var/qmail/queue/remote -type f -exec rm {} \;
service qmail start

You may also include the directories like /var/qmail/queue/mess/bounce… etc.

2. Give executable permission to this file

chmod 755 delqmail

3. Execute the script

sh -x delqmail

How to change SMTP port in postfix

The default SMTP port is 25. In Postfix we can change it to some other port (say 6000) using the following steps.

Open the file master.cf.

$ vi /etc/postfix/master.cf

Add the following line to the file.

6000 inet n - n - - smtpd

Restart postfix.

$ /etc/init.d/postfix restart

You can check the connection to the new port using telnet. Also make sure that the new port is not blocked in the server firewall.

« Prev - Next »