How do I get sendmail to process mails in /var/spool/clientmqueue
? sendmail -q
does not work for this directory.
Asked
Active
Viewed 2.3k times
2 Answers
8
To manually flush the queue in clientmqueue
:
sendmail -Ac -q -v
Or without -v
if you don't want to watch the progress in the console:
sendmail -Ac -q

chicks
- 3,793
- 10
- 27
- 36

Philippe Green
- 181
- 1
- 1
-
Why does this work? I don't really understand what the `-Ac` and `-q` flags are supposed to be doing. – alex Jan 21 '21 at 16:03
-
2The messages in clientmqueue are locally generated outbound messages handled separately from messages received externally via smtp. To process this queue, you need to tell sendmail to use the submit.cf configuration file. The -A switch is used to tell sendmail which configuration file to use. -Ac will use the submit.cf configuration and -Am will use the sendmail.cf configuration file. Absent the -A, it will default to using -Am unless you are running sendmail with -t or -bs. The -q is to tell Sendmail to process the queue once. – Philippe Green Feb 04 '21 at 05:05
3
You will need to check what items are in that folder, if it is a qf
/df
pair, then it probably a failed mail transaction. So something wrong with your setting or mail not going out or to someone or even got rejected.
You also need to know that the normal sendmail -q
will process the queue every one hour interval. You can do sendmail -q10m
to make it process the queue every 10 minutes.
It will also be good to check the mail queue mailq -v -Ac
, see if its empty or not. If its empty, then those mail in the clientmqueue
, must have been the one that are not successful.
-
mailq -Ac -v show the queue as empty, so it is safe to remove these files? – Robert Sep 15 '09 at 09:31
-
If there are only a few qf/df pair, you can try can cat the file and see the content before removing it. I used a perl scripts from here (http://www.brandonhutchinson.com/deleting_mail_queue.html) to check the queue and removing it, it is much more easier and safer. – Muhammad Sep 16 '09 at 01:10