Solved

Huge Sendmail Queue Problem

Posted on 2006-07-20
8
1,845 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 40

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 40

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 40

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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 40

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

932 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

20 Experts available now in Live!

Get 1:1 Help Now