Incoming and outgoing queue..

Jeff A. Earickson jaearick at colby.edu
Thu Sep 21 18:24:40 IST 2006


Since I have multiple outbound queues, I just wrote a shell script
that I call "mailqs" to show me all of my mail queues.  Attached;
tweak to your own tastes per your queue structure.  This is for
Solaris.

Jeff Earickson
Colby College

On Thu, 21 Sep 2006, Douglas Ward wrote:

> Date: Thu, 21 Sep 2006 13:07:15 -0400
> From: Douglas Ward <dward at nccumc.org>
> Reply-To: MailScanner discussion <mailscanner at lists.mailscanner.info>
> To: MailScanner discussion <mailscanner at lists.mailscanner.info>
> Subject: Re: Incoming and outgoing queue..
> 
> That is a handy command.  The mailq command in postfix shows you everything
> incoming and outgoing at once.  Does anyone know of a similar function in
> postfix?
>
> On 9/21/06, Jeff A. Earickson <jaearick at colby.edu> wrote:
>> 
>> what MTA?  In sendmail, it is:
>> 
>> sendmail -v -bp -OQueueDirectory=/full/path/of/directory/queue
>> 
>> On Thu, 21 Sep 2006, JD Doelitzsch wrote:
>> 
>> > Date: Thu, 21 Sep 2006 09:42:38 -0700
>> > From: JD Doelitzsch <jd at bentecmed.com>
>> > Reply-To: MailScanner discussion <mailscanner at lists.mailscanner.info>
>> > To: MailScanner discussion <mailscanner at lists.mailscanner.info>
>> > Subject: Incoming and outgoing queue..
>> >
>> >
>> > To the wizards of the MailScanner mailing list:
>> >
>> > How can I tell what is sitting in the incoming queue and outgoing queue
>> > using the command line? For some reason the Fedora GUI won't start and
>> the
>> > Xwindows setup doesnt start up either. In any case I'd like to make sure
>> all
>> > of the email sitting on the server has been processed out of it before
>> > trying to reinstall? xwindows or just make a new MS box. Thanks a bunch!
>> >
>> > -JD
>> >
>> >
>> > --
>> > MailScanner mailing list
>> > mailscanner at lists.mailscanner.info
>> > http://lists.mailscanner.info/mailman/listinfo/mailscanner
>> >
>> > Before posting, read http://wiki.mailscanner.info/posting
>> >
>> > Support MailScanner development - buy the book off the website!
>> >
>> --
>> MailScanner mailing list
>> mailscanner at lists.mailscanner.info
>> http://lists.mailscanner.info/mailman/listinfo/mailscanner
>> 
>> Before posting, read http://wiki.mailscanner.info/posting
>> 
>> Support MailScanner development - buy the book off the website!
>> 
>
-------------- next part --------------
#!/usr/bin/ksh
#
#---shell script to check what is in the mail queues
#
ID=`/usr/xpg4/bin/id -u`

#---we have to run as root
if [ ${ID} -ne 0 ]; then
    print "You must have root permission to run $0."
    exit 1
fi

if [ $# -gt 0 ]; then
	print "\n=== Lost email ==="
	print "===inbound"
	if [ -d /var/spool/mqueue.in ]; then
		/usr/lib/sendmail -v -bp -qL -OQueueDirectory=/var/spool/mqueue.in
	fi
	print "\n===outbound fast/local delivery"
	if [ -d /var/spool/mqueue/fastq ]; then
		/usr/lib/sendmail -v -bp -qL -OQueueDirectory=/var/spool/mqueue/fastq
	fi
	print "\n===outbound slow/offcampus"
	if [ -d /var/spool/mqueue/slowq ]; then
		/usr/lib/sendmail -v -bp -qL -OQueueDirectory=/var/spool/mqueue/slowq
	fi
	print "\n===outbound delayed"
	if [ -d /var/spool/mqueue/delayq ]; then
		/usr/lib/sendmail -v -bp -qL -OQueueDirectory=/var/spool/mqueue/delayq
	fi
	print "\n===client mqueue"
	if [ -d /var/spool/clientmqueue ]; then
		/usr/lib/sendmail -v -bp -qL -OQueueDirectory=/var/spool/clientmqueue
	fi
	
	print "\n=== Quarantined email ==="
	print "===inbound"
	if [ -d /var/spool/mqueue.in ]; then
		/usr/lib/sendmail -v -bp -qQ -OQueueDirectory=/var/spool/mqueue.in
	fi
	print "\n===outbound fast/local delivery"
	if [ -d /var/spool/mqueue/fastq ]; then
		/usr/lib/sendmail -v -bp -qQ -OQueueDirectory=/var/spool/mqueue/fastq
	fi
	print "\n===outbound slow/offcampus"
	if [ -d /var/spool/mqueue/slowq ]; then
		/usr/lib/sendmail -v -bp -qQ -OQueueDirectory=/var/spool/mqueue/slowq
	fi
	print "\n===outbound delayed"
	if [ -d /var/spool/mqueue/delayq ]; then
		/usr/lib/sendmail -v -bp -qQ -OQueueDirectory=/var/spool/mqueue/delayq
	fi
	print "\n===client mqueue"
	if [ -d /var/spool/clientmqueue ]; then
		/usr/lib/sendmail -v -bp -qQ -OQueueDirectory=/var/spool/clientmqueue
	fi
fi

print "\n=== Regular email ==="
print "===inbound"
if [ -d /var/spool/mqueue.in ]; then
	/usr/lib/sendmail -v -bp -OQueueDirectory=/var/spool/mqueue.in
fi
print "\n===outbound fast/local delivery"
if [ -d /var/spool/mqueue/fastq ]; then
	/usr/lib/sendmail -v -bp -OQueueDirectory=/var/spool/mqueue/fastq
fi
print "\n===outbound slow/offcampus"
if [ -d /var/spool/mqueue/slowq ]; then
	/usr/lib/sendmail -v -bp -OQueueDirectory=/var/spool/mqueue/slowq
fi
print "\n===outbound delayed"
if [ -d /var/spool/mqueue/delayq ]; then
	/usr/lib/sendmail -v -bp -OQueueDirectory=/var/spool/mqueue/delayq
fi
print "\n===client mqueue"
if [ -d /var/spool/clientmqueue ]; then
	/usr/lib/sendmail -v -bp -OQueueDirectory=/var/spool/clientmqueue
fi


More information about the MailScanner mailing list