[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] mail stuck in queue? -- explain this then..



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> [root q1]# ls
> dfh2AFeih22248  dfh2AFh3h22341  dfh2AFuYh22922  dfh2AG6gh23468
> xfh2AFeih22248  xfh2AFh3h22341  xfh2AFuYh22922  xfh2AG6gh23468
> dfh2AFfRh22283  dfh2AFhfh22363  dfh2AFvTh22960  dfh2AG8Ah23530
> xfh2AFfRh22283  xfh2AFhfh22363  xfh2AFvTh22960  xfh2AG8Ah23530
> dfh2AFgvh22339  dfh2AFtQh22882  dfh2AG6bh23466  dfh2AG9Zh23618
> xfh2AFgvh22339  xfh2AFtQh22882  xfh2AG6bh23466  xfh2AG9Zh23618
> [root q1]#
>
> [root q1]# mailq
> /var/spool/mqueue/q1 is empty
> /var/spool/mqueue/q2 is empty

Hm. I've never seen _that_ before.

Found this script in a quick google search:

#!/bin/sh
# A script to clean out the sendmail's mailqueue directory.  It
# deletes 0 length files and files older than 7 days (sendmail should
# throw these out anyway), then looks for "orphan" files - header
# files that don't have a data file and vice versa.

# Change this if your mailqueue is in a different location
cd /var/spool/mqueue

# Remove zero length files and files older than 7 days
find . -size 0 -o -ctime +7 | xargs rm

# Remove orphans
# First, list the header and data files
ls -1 q*|cut -c 3-10 > /tmp/q.o
ls -1 d*|cut -c 3-10 > /tmp/d.o
ls -1 x*|cut -c 3-10 > /tmp/x.o

# Find the orphans
# Uncomment egrep line to display failed delivery reason
# Uncomment rm line to delete queued messages
QFILES=`comm -23 /tmp/q.o /tmp/d.o`
echo HEADER FILES:
for i in $QFILES
do
#	egrep '^M' qf$i
#       rm qf$i
done

# Data files
# Uncomment echo line to display info
# Uncomment rm line to remove files
DFILES=`comm -13 /tmp/q.o /tmp/d.o`
echo DATA FILES:
for i in $DFILES
do
#	echo df$i
#       rm df$i
done

# Uncomment echo line to display info
# Uncomment rm line to remove files
XFILES=`comm -13 /tmp/q.o /tmp/x.o`
echo X FILES:
for i in $XFILES
do
#	echo xf$i
#       rm xf$i
done

# Clean up
rm /tmp/q.o; rm /tmp/d.o; rm /tmp/x.o


Also found another script at 
http://www.patoche.org/LTT/daemon/00000073.html

- -- 
Bruce Timberlake

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD4DBQE+bN4MvLA2hUZ9kgwRAh7dAJUapAz8OE9KfB7z08fMhVqkp0kfAJ90V9t/
jYX7pdbEiG197nYG/ZBryg==
=0RzC
-----END PGP SIGNATURE-----