Analysis of High Queue on Qmail Based Relay Server and its Resolution
Appearance
Analysis of High Queue on Qmail Based Relay Server and its Resolution[edit]
Login at Qmail mail Relay server
qmHandle -s Total messages: 590 Messages with local recipients: 0 Messages with remote recipients: 590 Messages with bounces: 0 Messages in preprocess: 0
Check the Details of mails via
qmHandle -l | more
Lot of mails having Subject "Undelivered Mail Returned to Sender"
562343 (16, 16/562343) Return-path: From: MAILER-DAEMON@gateway-1.tetrain.com (Mail Delivery System) To: Enetadvicemailing@hdfcbank.com Subject: Undelivered Mail Returned to Sender Date: Thu, 20 Jun 2019 18:22:16 +0530 (IST) Size: 8475 bytes
So Now Run
vi /etc/inittab ; init q ; qmHandle -S'Undelivered Mail Returned to Sender' ; vi /etc/inittab ; init q
Comment With # on line
#SV:123456:respawn:/command/svscanboot
Save the file
It will delete all mails with mentioned subject and open the file once again .
Deleting message: 562609 Deleted 564 messages from queue Qmail wasn't running when qmHandle was started, so it won't be restarted.
Now remove the comment on the same line and save it
SV:123456:respawn:/command/svscanboot
Depending On the Nature of Problem you can use the different options of qmHandle to Analyze the Issue and its Resolution .
Options are
[tetra@smtp-1 ~]$ qmHandle
qmHandle v1.3.2
Copyright 1998-2003 Michele Beltrame
Available parameters:
-a : try to send queued messages now (qmail must be running)
-l : list message queues
-L : list local message queue
-R : list remote message queue
-s : show some statistics
-mN : display message number N
-dN : delete message number N
-fsender : delete message from sender
-f're' : delete message from senders matching regular expression re
-Stext : delete all messages that have/contain text as Subject
-h're' : delete all messages with headers matching regular expression re (case insensitive)
-b're' : delete all messages with body matching regular expression re (case insensitive)
-H're' : delete all messages with headers matching regular expression re (case sensitive)
-B're' : delete all messages with body matching regular expression re (case sensitive)
-t're' : flag messages with recipients in regular expression 're' for earlier retry (note: this lengthens the time message can stay in queue)
-D : delete all messages in the queue (local and remote)
-V : print program version
Additional (optional) parameters:
-c : display colored output
-N : list message numbers only
(to be used either with -l, -L or -R)
You can view/delete multiple message i.e. -d123 -v456 -d567