You can use the mailq command sendmail -bp command to display a summary of the mail messages queued for future delivery. Type the following command:
# mailq
via Sendmail: Clear / Delete / Flush Mail Queue.
A service in a local server started to send email through my main server back to the originating server causing many errors in /var/log/maillog of my main server. Each attempt added a message to its message queue that was blocked due to a problem with sendmail on the originating server. The email being sent was sent automatically by a VOIP service I was testing on that originating server (not good).
You can cd to /var/spool/mqueue and delete all files if you want to get rid of all messages in the queue:
# cd /var/spool/mqueue/
# ls
# rm *
The above sequence cleared the queue so sendmail stopped trying to send those messages to a broken server at the destination.
Sendmail Problem on Originating Server
Sendmail wouldn’t start. OS Fedora 19 so it’s running that new systemd for service startup. Here are pertinent error messages in /var/log/messages:
Nov 17 21:23:39 ana systemd[1]: Starting Sendmail Mail Transport Agent...
Nov 17 21:23:39 ana sendmail[1555]: -bd is not supported by sSMTP
Nov 17 21:23:39 ana systemd[1]: PID file /run/sendmail.pid not readable (yet?) after start.
Nov 17 21:23:39 ana systemd[1]: Failed to start Sendmail Mail Transport Agent.
Nov 17 21:23:39 ana systemd[1]: Dependency failed for Sendmail Mail Transport Client.
Nov 17 21:23:39 ana systemd[1]: Unit sendmail.service entered failed state.
I did a lot of googling to find someone in a similar situation to no avail. I then looked into sSMTP and why that was being called instead of good old sendmail. After
#yum erase sSMTP
thus purging that service entirely from the system, sendmail starts in this Fedora 19 VM and works (knock on wood).