Qmail is one of the famous open source email servers like postfix,
sendemail, exim etc.


Today, got a qmail server which was very slow in sending emails.
It took even 24 hours to send an email.

Let us see here, how to solve this issue.

Spam mails are the major reason on slowness of any email server.

First we have to check the email queue to know how many mails are
there to be processed.

# /var/qmail/bin/qmail-qstat
messages in queue: 23645
messages in queue but not yet preprocessed: 82


ooops.
23645 mails in the queue is a huge number.



The next step is to use is “qmail-qread”, which can be used to read
the message headers:

# /var/qmail/bin/qmail-qread
18 Jul 2005 15:03:07 GMT #2996948 9073 <[email protected]> bouncing
done remote [email protected]
done remote [email protected]
done remote [email protected]



23 Feb 2013 22:52:24 GMT  #13633871  2239  <[email protected]>  bouncing
        remote  [email protected]
  done  remote  [email protected]
  done  remote  [email protected]
  done  remote  [email protected]
        remote  [email protected]
        remote  [email protected]
....


I see here that there are many emails from the email address [email protected]
where all the mails contain bogus TO address.

So, all these mails are SPAM mails and can be deleted.

Let us count how many spam mails are there.


qmHandle is a nice tool to handle the email queue in the qmail.

using this, we can list the queue, send all the mails in the queue,
delete the mails using any field like sender, receiver, domain,
subject, body text even using regular expression.

options for qmandle

-l to list the queue
-s to summarize the queue
-a to send all emails
-fsender to delete emails from sender


/usr/local/src/qmhandle-1.3.2/qmHandle -l | grep From | grep ef6276 | wc -l

22735

So, there are 22735 spam mails that are generated from single email
address [email protected]

Let us delete them all.

/usr/local/src/qmhandle-1.3.2/qmHandle [email protected]

It took some 30 min to delete all the spam emails.

Let us check the queue status now.

/usr/local/src/qmhandle-1.3.2/qmHandle -s


Total messages: 910
Messages with local recipients: 0
Messages with remote recipients: 910
Messages with bounces: 10
Messages in preprocess: 0

So, there are 910 valid emails

Let us try to send them all.

/usr/local/src/qmhandle-1.3.2/qmHandle -a



That's all.

In some 30 minutes, all the valid emails are sent and the email server
started to breath easily.

Thanks to the following links which helped me to know about qmail.

http://blog.xfloyd.net/?p=109
http://pc-freak.net/blog/how-to-fix-a-broken-qmail-queue-with-queue-repair-and-qmhandle/
http://linuxhostingsupport.net/blog/howto-manage-mail-queue-in-qmail-using-qmhandle
http://lateral.netmanagers.com.ar/stories/8.html


-- 
Regards,
T.Shrinivasan


My Life with GNU/Linux : http://goinggnu.wordpress.com
Free/Open Source Jobs : http://fossjobs.in

Get CollabNet Subversion Edge :     http://www.collab.net/svnedge
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to