Solved

Huge Sendmail Queue Problem

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

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Backup & Restore 3 54
Oracle 10g standard edition server with 4 processors 3 52
AWS ELB 5 74
ifconfig 4 44
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

813 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