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.)

Related Posts

Blog Traffic Exchange Related Posts
  • Mail Server Rejecting all Messages - Check your Blacklists relays.ordb.org is listing the WORLD It's unusual for mail servers to suddenly start rejecting messages internally and from external sources. That's exactly what I saw though over the weekend. A mailserver running mdaemon on Windows 2000 was rejected ALMOST every message that was sent it's way whether it was an internal mail sender and recipient......
  • Modern Computer Viruses are almost NEVER from whom they claim to be from This is one that I've probably talked about before, but it's worth rehashing because of a call I had this afternoon. A customer had been receiving phone calls and email messages from folks asking that he stop sending them a virus. Essentially all of the viruses were claiming to be......
  • Common Networking Ports Along the lines of "knowing your network" with the network security guide. Here are some of the most commonly used network ports. There are 65535 ports that can listen for a connection, so this is not a thorough listing. (These are tcp unless noted otherwise.) FTP 21 (file transfer protocol,......
Blog Traffic Exchange Related Websites
  • 3 Ideas For Finding The Right Web Host Having a website is really important for your long term online success, which also means that making sure your site runs smoothly without any problems is equally important. You can find loads of information about how to make your site look better or how to optimize it better, but those......
  • Why We Have To Switch To Cloud Web Host: Why we must switch to Cloud Web host: Cloud hosting as explained in Wikipedia is a service that does not need knowledge among the consumers, we might not really know it, but we are actually enjoying the benefits of cloud hosting as Google searches are running within a cloud of......
  • Templates For E-Commerce Web Hosting Developing a expert website may be difficult. E-commerce internet style is truly a complex animal. To cut development time, numerous web hosting organizations start offering web hosting templates or hosting with templates. Whether or not you are looking for a easy internet website or a functional e-commerce website, the chances......
PDF24    Send article as PDF   

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