Solved

Huge Sendmail Queue Problem

Posted on 2006-07-20
8
1,882 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CLI command keep running after close 7 55
Unix Help with:  mailx -s 17 57
postfix start error! 9 48
CentOs root password/fsck issue 7 30
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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 …
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.

685 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