Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


sendmail filling the clientmqueue but mqueue says it's empty

Posted on 2004-03-31
Medium Priority
Last Modified: 2013-12-15
I'm running a redhat 9 server with sendmail 8.12 or so. Everything has been working great for months except my clientmqueue directory is filled with 150 Mb of files spanning several months.

mailq says /var/spool/mqueue is empty (there are two files)
mailq -Ac says /var/spool/clientmqueue is empty (it is not!)

I tried a lot of the obvious stuff. http://www.experts-exchange.com/Operating_Systems/Solaris/Q_20509474.html reminded me that I need to have two sendmails running, and I do. Just for kicks, I ran a second copy of both:

sendmail -L mta -bd -q15m
sendmail -L msp -q15m

but all I get from that are a lot of daemon MTA: cannot bind errors in the maillog.

The files are mostly owned by smmsp.smmsp and have -rw-rw---- permissions, although there are a couple of apache.smmsp files.

Why isn't sendmail able to find and process that stuff?
Question by:jtw90210
  • 4
  • 4
LVL 40

Expert Comment

ID: 10732022
A number of queued messages in /var/spool/clientmqueue means that either the MSP instance of Sendmail isn't running (it should be automatically started at boot by RH 9's /etc/init.d/sendmail script) or that is fails for some reason. The first thing to do would be to execute '/sbin/service sendmail stop' and make sure that all sendmail processes have died (check with 'ps -ef | grep sendmail | grep -v grep'). Then start sendmail with '/sbin/service sendmail start'. Check the tail end of /var/log/maillog for any errors and make sure that there is an MSB instance runningm like:

# ps -ef | grep sendmail | grep -v grep
root      5116     1  0 Mar20 ?        00:00:00 sendmail: accepting connections
smmsp     5125     1  0 Mar20 ?        00:00:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue

Author Comment

ID: 10734729
Yes, jlevie. I suspected that it might be a 'not running' kind of problem based on other solutions to this problem, but there are two reasons why that doesn't seem to be the case. First, the todo list generated by mailq -Ac is empty. Second, I tested to make sure that both sendmails were running.

Last night I shut down both my existing sendmail processes (that started with init.d/sendmail) and started separate ones with
# sendmail -L mta -bd -q15m
# sendmail -L msp -q15m
while I tailed the maillog. Here are the only three errors incurred (other than bounces).

Apr  1 10:27:01 teddy mta[3712]: daemon invoked without full pathname; kill -1 won't work
Apr  1 10:27:01 teddy mta[3714]: starting daemon (8.12.8): SMTP+queueing@00:15:00
Apr  1 10:27:01 teddy msp[3718]: starting daemon (8.12.8): queueing@00:15:00

and the two sendmail processes appear in the ps.
I let it run all night like that and there were plenty of new entries in the directory, but none going away.
This morning I searched my maillog for messages from msp and I could only find the startup messages even though ps showed the same processes were still running.

For some reason it seems as though sendmail isn't able to see the messages. The contents of the messages that are in the directory seem to be predominantly mail reject bounces from mail sent to root@[mymachine] that doesn't accept mail, a lot of which are generated by cron. (I'll poke down that path for a while.)

The only other strange thing is that I get a lot of spam reject notices. Is it possible that my system might be compromised? How would I test for that?

Author Comment

ID: 10734766
Just now I was checking my ps and I have a lot of child processes:

# ps -ax | grep sendm
root      3714     1  0 10:27 ?        00:00:00 [sendmail]
root      3718     1  0 10:27 ?        00:00:00 [sendmail]
root      3838  3714  0 10:41 ?        00:00:00 [sendmail]
root      3942  3714  0 10:52 ?        00:00:00 [sendmail]
root      4113  3714  0 11:10 ?        00:00:00 [sendmail]
root      4114  3714  0 11:10 ?        00:00:00 [sendmail]
root      4115  3714  0 11:10 ?        00:00:00 [sendmail]

From the maillog I know 3714 is the mta while 3718 is the msp. So mta is working, but msp thinks it has an empty todo list.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 40

Expert Comment

ID: 10745506
Is the content in /var/spool/clientmqueue valid qf/df pairs? A valid message will consist of a qf and df file with the same ID, e.g., qfi2ULRsBD025511 & dfi2ULRsBD025511. Failed mail transactions can result in either of the parts being present and won't ever get deleted since they can't be processed.

Does this system have a "stock RedHat" sendmail installation? By that I mean that you haven't replaced any of the parts of sendmail except as a result of running up2date?

Author Comment

ID: 10745570
yes, it is stock except for the conf -- I didn't compile it, but I did change sendmail.mc a bit.  
yes, there appear to be two files for each entry, one beginning with 'Q' and the other beginning with 'd'.
The files themselves seem to be the output of cron jobs that I have that are getting bounced from the machine's root but aren't getting delivered to the bounce address. Almost a 'hop' problem. (That woundn't explain why it's not /trying/ though.)

# cat Qfi3305AST013867
${daemon_flags}c u
rRFC822; root@machine.host.com
H?P?Return-Path: <g>
H??Received: from localhost (localhost)
        by machine.host..com (8.12.8/8.12.8/Submit) id i3305AST013867;
        Fri, 2 Apr 2004 16:07:16 -0800
H?D?Date: Fri, 2 Apr 2004 16:07:16 -0800
H?F?From: Mail Delivery Subsystem <MAILER-DAEMON>
H?x?Full-Name: Mail Delivery Subsystem
H?M?Message-Id: <200404030007.i3305AST013867@machine.host..com>
H??To: root
H??MIME-Version: 1.0
H??Content-Type: multipart/report; report-type=delivery-status;
H??Subject: Returned mail: see transcript for details
H??Auto-Submitted: auto-generated (failure)

# head -30 dfi3305AST013867
This is a MIME-encapsulated message


The original message was received at Fri, 2 Apr 2004 16:05:10 -0800
from root@localhost

   ----- The following addresses had permanent fatal errors -----
    (reason: 553 5.3.0 <root@machine.host.com>... No email to this machine)
    (expanded from: root)

   ----- Transcript of session follows -----
... while talking to []:
>>> MAIL From:<root@machine.host.com> SIZE=17464
<<< 553 5.3.0 <root@machine.host.com>... No email to this machine
501 5.6.0 Data format error

Content-Type: message/delivery-status

Reporting-MTA: dns; machine.host.com
Arrival-Date: Fri, 2 Apr 2004 16:05:10 -0800

Final-Recipient: RFC822; root@machine.host.com
Action: failed
Status: 5.3.0
Diagnostic-Code: SMTP; 553 5.3.0 <root@machine.host.com>... No email to this machine
Last-Attempt-Date: Fri, 2 Apr 2004 16:07:16 -0800
LVL 40

Accepted Solution

jlevie earned 500 total points
ID: 10746353
Those are failed mail transactions. Since the message is from MAILER-DAEMON to root and since that's effectively from/to root and mail can't be delivered to root, the result is a failed mail transaction. That's shown by the presence of a Qf file, as oppossed to a qf file. Since Qf files represent a transaction that's in progress subsequent runs of the MSP won't clear them out.

You need to fix your system so that mail can be delivered to root. Not being able to do so affects not only local mail like this, but also mail transactions from to Internet sites and the loss of possibly important system notices.

Author Comment

ID: 10748463
Thanks, jlevie, I should have suspected sendmail would use something like labeling files with a Q to indicate failure instead of a  q to indicate that they are enqueued.

root stopped accepting email when I tried to block mail from outside but not localhost. I shut that off and now I'm getting system messages again (but also a load of spam.) Is there a quick and proper way to set up root like that?
LVL 40

Expert Comment

ID: 10749129
> Is there a quick and proper way to set up root like that?

No, at least not without causing other problems.

Why not install an anti-spam package? Something like MailScanner (http://www.mailscanner.info), which is my personal favorite, or MIMEdefang or AMaViS is pretty easy to install and helps lots with controlling spam.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension . This reminded me of questions that come up here at EE along the lines of, "How can I tell the type of file from its cont…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

571 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