Force sendmail to deliver a message in sendmail's mail queue

Sendmail is age-old mail transfer agent (MTA). We still use sendmail on Solaris boxes and all other web hosting (www) server to route mails via our master MTA.

ADVERTISEMENTS

Task: Linux/UNIX deliver old email

The command sendmail -q forces the mail queue to be sent. Use the command mailq to find out what’s in the queue:
# sendmail -q
# mailq
Following command will force sendmail to become verbose so that debugging turns into an easy job:

# sendmail -v -q

However, there is a catch. Sendmail would not process your queue if the system load were too high. You can configure these options in sendmail configuration file sendmail.cf and configure QueueLA option. Using this option you can configure load average at which Sendmail simply queues up new messages, this is a good tweaking and troubleshooting parameter.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
6 comments… add one
  • lepiaf Oct 16, 2008 @ 15:42

    I write the command, but it doesn’t send.


    Running /var/spool/mqueue/m9GFSg8s014645 (sequence 1 of 3)
    m9GFSg8s014645: locked

    What’s the problem ?

  • Mohammed Shah Newaj Nov 4, 2010 @ 10:50

    It’s usefull and awsome tools for trouble shooting.

  • Colin May 27, 2013 @ 0:47

    Hi All

    I found that this command was incredibly effective in flushing stuck mail.
    sendmail -OTimeout.hoststatus=0m -q -v

    This sent out all waiting mail.

    The source:

    http://stephan.paukner.cc/syslog/archives/33-Flush-deferred-messages-in-sendmail-queue.html

  • Siddharth Pujare Jul 24, 2013 @ 6:50

    How to read a mail using messege id in sendmail queue?
    For e.g. we use postcat -q in postfix. Is there anything similar for sendmail?

  • Ashwani Nov 18, 2014 @ 2:37

    Pls guide , suggest your expert advise
    We are using Fedora mail server but all te messages in the queue are stuck , goes very very slow, we need to flush the queue every time and then it sends messages.

    We do this after ervy one hour, which is really trouble some

    please advise any solution

    Thanks a lot for your help

  • David Rogers Nov 12, 2016 @ 21:15

    i had an issue and it turned out to be the receiving email server limiting the number of connects per hour from 1 IP. have 1000s of email going from 1 server to another.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.