Sendmail Outbound Queue full of NDRs

Posted on 2004-11-02
Last Modified: 2013-12-17
I've got a sendmail box running the whole clamav/mailscanner/spamassassin on a redhat server and we use it for clients to relay through for email protection.  recently, we had an issue where the server had about 10,000+ messages in the queue that it couldnt' deliver for about 12 hours.  we fixed the issue and the messages that needed to go to the outside world got there fine but now there are like 5,144 messages sitting in my outbound queue waiting to be delivered because they are NDR's (The 4 hour could not send message) that are trying to go to spam-spoofed addresses.  is there a way i can clear these out?  it would be nice if i could just clear out the NDR's that its been trying to send for the past 6 or so hours and leave the regular mail and newer NDR's there for now.

Question by:Jaidenkell
    LVL 34

    Expert Comment

    Yes, just delete the qf* and df* files from /var/spool/mqueue (or wherever you have the sendmail queue directory). Since you have such an accurate count, I assume you can specifically identify the message files.

    Author Comment

    well the details i get on the queue files are from mailwatch (which logs mailscanner and all of the stuff it does and puts it into a web interface).  so i can see all of the individual mail files and the totals of the whole mail server, but i cant just delete all of the NDR's and DNR's and leave all of the email that is still in there.  i have a bad feeling that of those 5000+ emails, there are probably about 20 or so that are good and wanted and i'd like to avoid deleting.

    on a side note i did try setting the queuereturn to like 5 hours on and restarting sendmail (in hopes that it will purge the emails older the 5 hours, which are all the deferred spam junk) but it doesn't seem to have taken affect.  did i mis-interpret the function of queuereturn?
    LVL 34

    Accepted Solution

    No, I don't think you did it wrong, altho sendmail won't notice they're over the limit until the next time it processes the queue, and if you have any queue-processing limits, those will also play into it.

    A good reference to have is _Sendmail_3rd_Edition_ by Bryan Costales, ISBN 1-56592-839-3. I recommend you get a copy.

    Here is a snippet of my - the Page #/Chapter.Section.Part references are from that book above:

    !! Page 1066/ - TimeOut.QueueReturn - Define the lifetime of messages
    !! within the sendmail queue before they are bounced as undeliverable. Can also be specified
    !! on a per-Priority: header basis, but is not here. Can also use the keyword now to force an
    !! immediate bounce of all messages in queue group badqueue. Default is 5 days.
    !! RFC1123 recommends 5 day minimum
    define(`confTO_QUEUERETURN', `#d')dnl

    You may also want to define a Dead Letter Drop:

    !! Page 967/24.9.26 - Path to write for E-Mail that double-bounces and no recipient is
    !! defined locally
    define(`confDEAD_LETTER_DROP', `/some/path/here')dnl

    You can see my annotated for some other ideas -->

    Author Comment

    Well it looks like it just took a long time for the queuereturn to take effect but it purged teh system and i moved it back up to 15 days.  quite an adventure.  thanks for the help!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Microsoft Outlook is not just an email client but it is full featured Personal Information Manager. But sometimes Outlook gets disconnected and you simply can’t access it. What steps can you perform before calling IT support? In this article we will…
    Import PST to Exchange using Power Shell new-mailboximportrequest command, you can simply import the PST file into Exchange mailbox or archived. To know How to import PST into Exchange  2013 read the complete article.
    In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
    In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…

    728 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

    18 Experts available now in Live!

    Get 1:1 Help Now