Solved

Huge Sendmail Queue Problem

Posted on 2006-07-20
8
1,869 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

839 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