Solved

Huge Sendmail Queue Problem

Posted on 2006-07-20
8
1,830 Views
Last Modified: 2013-12-16
Hi Guys,

I need some help regarding Sendmail on a debian box.

We had a client complain about slow email delivery times so I looked into the issue. I had a look at the mailq and it never loaded. Then I looked further ..

mail:/var/spool/mqueue# ls | wc -l
227000

227 THOUSAND emails in the queue. What in gods name?
I've had a look further and most are bounce messages, trying to send to tell external users that bob@mycompany doesn't exist! Aren't they supposed to try for 3 or 4 days and then be deleted?

Anyone have any idea's about how to clear this? And most importantly, what settings or permissions to check why sendmail isn't removing items from the queue.

Any help would be much appreciated.

James
0
Comment
Question by:JigsawTech
8 Comments
 
LVL 39

Accepted Solution

by:
noci earned 500 total points
ID: 17145329
SPAM, somebody ran a spam run and metioned a  bob@mycompany as the sender,
many undeliverable messages might by sent to you.
And your mailer might try to answer to (potentioaly a LOT of nonexistent mail addresses
that this bob account doesn't exist.

And SPAM can be sent by the millions in a run.

You probably want to remove all those messages from your mqueue, as they need not go anywhere
and they cost you a LOT in th form of processing power & file storage.

in mqueue

do ls | xargs grep -l "some specificstring in the offending mails" | whatever...

whatever can be f.e. less to see the list of filenames
or 'wc -l'
to count the specific files
or 'xargs rm -f '
to get rid of the files.

HIH
0
 
LVL 39

Expert Comment

by:noci
ID: 17145427
The solution would be to not send any bounce messages anymore. The problem with that is
legitimate users also will not get a bounce message.

The problem with bounce messages is that they can be used to probe what legitimate addresses you have.

It basicly is a choice between bad options ;-|
0
 
LVL 1

Author Comment

by:JigsawTech
ID: 17145779
Okay thanks.

How can I turn off bounce messages in sendmail? As a temporary fix for now?
0
 
LVL 39

Expert Comment

by:noci
ID: 17146407
Here you can find a description how to install it.
(I am using exim myself nowadays, after using qmail for years)

http://www.kempston.net/solaris/configsendmail2.html

Look at chapter:
Accepting email for unknown users

In that mailbox you send everything to, you can read or remove the mailfile as needed.
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 22

Expert Comment

by:pjedmond
ID: 17148610
Obviously bob is very very popular!

find . | awk {'print "cat "$1 " | grep \"bob\@mydomain\.com\" && rm -f "$1 '}

will print rm -f filename of any files that contain bob@mydomain.com (the '.' will actually get transalated as any 1 char).

But what you can now do is


find /path/to/dir | awk {'print "cat "$1 " | grep \"bob\@mydomain\.com\" && rm -f "$1 '} | /bin/bash

to delete the 226000 emails that you don't want. Obviously test this on a test couple of files in a seperate folder first:)

(   (()
(`-' _\
 ''  ''
0
 
LVL 1

Author Comment

by:JigsawTech
ID: 17151049
Thanks guys, I turned off delivery reports in Exchange and it's stopped.

However, one last question - How can I change the time emails stay in the queue that can't be sent? I know it retries for a certain amount and if its still un-deliverable for a few days it deletes it  - correct?
0
 
LVL 39

Expert Comment

by:noci
ID: 17151992
By default it wil retry for about a week.
I think you do want to remove this amount, and not wait fot it to clear..

If you are using Exchange, maybe look into the use of GFI Mail Essentials, it can help with a more controlled approach
to spamcontrol.
0
 
LVL 3

Expert Comment

by:bryanlloydharris
ID: 17164234
not sure but maybe there is a setting in sendmail.cf?
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now