A user repoted that she didn't receive an email someone sent her today. I checked the
/var/log/maillog
file to see if the mail server,
which is running Sendmail, received the email. When I searched on part of the
sender's email address, I saw the message had been received by the mail
server:# grep sbear /var/log/maillog Jan 5 14:08:08 moonpoint sendmail[6276]: v05IxmvR006276: from=<sbearab1@y0hoo.c om>, size=2339942, class=0, nrcpts=1, msgid=<1226622358.574156.1483642780691@mai l.y0hoo.com>, proto=ESMTP, daemon=MTA, relay=omp1011.mail.ne1.y0hoo.com [98.138. 87.11]
So I checked Sendmail's queue with the
mailq command and saw
the message was stuck there. Note: Mailq is identical to sendmail -bp
.
# mailq /var/spool/mqueue (1 request) -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient----------- v05IxmvR006276 2338155 Thu Jan 5 14:08 <sbearab1@y0hoo.com> (host map: lookup (yahoo.com): deferred) <abad_kitty@moonpoint.com> Total requests: 1 #
The sendmail queue can be flushed with the command sendmail -q -v
.
# sendmail -q -v Running /var/spool/mqueue/v05IxmvR006276 (sequence 1 of 1) <abad_kitty@moonpoint.com>... aliased to ann ann... Connecting to local... ann... Sent # mailq /var/spool/mqueue is empty Total requests: 0 #
The meaning of the -q
and -v
options to the
sendmail command are
shown below:
-q[time] Process saved messages in the queue at given intervals. If time is omitted, process the queue once. Time is given as a tagged number, with `s' being seconds, `m' being minutes (default), `h' being hours, `d' being days, and `w' being weeks. For example, `-q1h30m' or `-q90m' would both set the timeout to one hour thirty minutes. By default, sendmail will run in the back- ground. This option can be used safely with -bd. -v Go into verbose mode. Alias expansions will be announced, etc.