How can I get notifications of email stuck in the queue?
by Tor Willy Austerslått
We set up a heavily modified toaster-like SMTP gateway contraption for a client not too long ago. During the techie briefing afterwards, one microscopic but handy issue came up: notification on mails being stuck in the out queue. Apparently MS Exchange can be set up to do this.
We fixed this by simply installing qmail-notify from ports to run in an hourly cron job.
qmail-notify checks the queue and sends a notification to the sender if a mail have been in the queue for more than n seconds. The default is four hours. The notification contains the sender, recipient and subject from the stuck mail. Attaching the complete original mail is optional.
Nothing further will happen, but the sender will know that his/her mail haven't left the mail server yet. Any action is up to the user. We've had a couple of incidents where the user misspelled the domain on an important mail and didn't realize it until a week later when the mail expired from the queue.
To install, select install_qmail_notify in toaster-watcher.conf and run toaster_setup.pl -s pre. Once installed, add it to cron.
@hourly /usr/local/bin/qmail-notify -r
Last modified on 4/17/05.