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
  • Microsoft Outlook - duplicate email messages Part II This is part II, click here for part one of the saga... Okay, so I revisit to install Microsoft Office 2003 SP2 and hope that solves it. Somewhere along this time, I had also found a suggestion of removing the entire mail PROFILE and creating a new one. *(The theory......
  • 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......
  • Open Source Web templates One of the things that I've really not looked at until lately is the use of open source web templates. I don't know why but I've never really paid much attention to the thought of templates outside of those for a cms platform like wordpress or ezcontents, etc. However, recently......
Blog Traffic Exchange Related Websites
  • Web Hosting Tips for New Bloggers This is a guest post! If you want to write for us, Contact using the Contact Me form. With increased internet users, people are trying to make their presence on this World Wide Web in one or the other way. With blogging creating a platform for millions of writers who......
  • The Web Hosting Services Of The Hostgator Review Thousands and thousands of web hosts scattered around the world and their business aim is simple - to get recognized and make profit. With so much noise around the web hosting industry, it is a tough task for us to pick up the right hosting. Nevertheless, it's not too hard......
  • The Virtual Assistants As Well As The Little Web Hosting Service Which Shouldn't Be The virtual assistants ask: Is bigger far better? People have their very own opinion regarding that, which includes web hosting companies. They are saying it is. This is exactly why whenever you take a look at their hosting packages, the feature list goes on and on and on. You would......
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