Sendmail mail queue backed up



Sendmail is not my favorite MTA. I really prefer Postfix, but… I have to use sendmail in a few situations. I’ve run a little script on the web server for a good while to monitor the mail queue. I was running into a problem where I had LOTS of messages backed up. I suspected I had been hit originally by a spam onslaught which had flooded the server and it had been throttled (VPS) to prevent causing problems for the other users and things got backed up.


The script I’ve used looks like this

#!/bin/sh
# mailalert.sh

threshold=20
currentnum=`ls -l /var/spool/mqueue/qf* | wc -l`

if [ $currentnum -gt $threshold ]
then
datestamp=`date`
mail postmaster -s “Mail Queue Alert” <<EOM

There are $currentnum messages in the mail queue on

$datestamp

Check /var/spool/mqueue

EOM
fi

It basically checks to see if there are more than 20 messages queued… so here are some ways to deal with the mailqueue in sendmail from the shell.

mailq shows all the messages that are currently queued waiting for a re-attempt.

sendmail -q starts processing the message queue. Most all of the messages backed up were because my home server had rejected the sender (using some of postfix’s UCE controls…) sendmail couldn’t deliver them and can’t deliver a bounce (forged message). I probably need to investigate how I might tighten the sendmail policy on not accepting from bogus addresses.

It’s possible though to delete items out of the queue by deleting them from /var/spool/mqueue Eventually, sendmail should give up on a message though and stop trying to deliver it or it’s bounce. (Don’t recall the default number of days.)

Popularity: 1% [?]

Free PDF    Send article as PDF   
Blog Traffic Exchange Related Posts
  • How to Remove Personal Security | Personal Security Removal Guide Personal Security is a rogue antivirus application that comes from the same (dreaded) family as the Cyber Security rogue. It usually installs on the users computer without the permission of the computer user. Once installed on the system it will then perform supposed scans finding lots of virus infected files......
  • Asheville based Web Design, VPS Hosting and SEO Services [/caption] Change is constant. The last couple of years I have been doing less onsite computer service. Health has been one large reason for that. I have been focusing on other things though. One of the things that I've been working on is now going live. I've redesigned my web......
  • Microsoft Outlook - duplicate email messages Part I This will likely be a multi-part story because it turns out the solution was one of the more obscure things I think I've run into AND I thought it was worth "dumping" everything I found out in the process here for my own reference and anyone else wandering through. I......
Blog Traffic Exchange Related Websites
  • How To Pick Out A Reliable Web Hosting Service For Your Website Selecting the correct web host can either make your website grow or tear it down. This is because the web host should be considered to be the foundation of your website. In order to have a longer term website and make sure you provide a good experience for your web......
  • 10 Benefits of Hosting your Own Blog If you want to create an edge over many of the other bloggers on the web, then one of the best things that you can do is host your own blog. There are a number of benefits of hosting your own blog over having some other service host your blog.......
  • How To Find Inexpensive Web Hosting There are many reasons that you might decided you would like to have web hosting. If you feel that you want to have a web site, the first thing that you need to do is find yourself some web hosting. There are many ways that you can find this without......

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site