Web hosting domain names - Managing the Mail Spool Mail is queued in
Managing the Mail Spool Mail is queued in the /var/spool/mqueue directory before being transmitted. This directory is called the mail spool. The sendmail program provides a means of displaying a formatted list of all spooled mail messages and their status. The /usr/bin/mailq command is a symbolic link to the sendmail executable and behaves indentically to: # sendmail -bp The output displays the message ID, its size, the time it was placed in the queue, who sent it, and a message indicating its current status. The following example shows a mail message stuck in the queue with a problem: $ mailq Mail Queue (1 request) –Q-ID—-Size——-Q-Time—————–Sender/Recipient———— RAA00275 124 Wed Dec 9 17:47 root (host map: lookup (tao.linux.org.au): deferred) terry@tao.linux.org.au This message is still in the mail queue because the destination host IP address could not be resolved. We can force sendmail to process the queue now by issuing the /usr/bin/runq command. The runq command produces no output. sendmail will begin processing the mail queue in the background. Forcing a Remote Host to Process its Mail Queue If you use a temporary dial-up Internet connection with a fixed IP address and rely on an MX host to collect your mail while you are disconnected, you will find it useful to force the MX host to process its mail queue soon after you establish your connection. A small perl program is included with the sendmail distribution that makes this simple for mail hosts that support it. The etrn script has much the same effect on a remote host as the runq command has on our own. If we invoke the command as shown in this example: # etrn vstout.vbrew.com we will force the host vstout.vbrew.com to process any mail queued for our local machine. Typically you’d add this command to your PPP ip-up script so that it is executed soon after your network connection is established. Analyzing Mail Statistics sendmail collects data on mail traffic volumes and some information on hosts to which it has delivered mail. There are two commands available to display this information, mailstats, and hoststat. mailstats The mailstats command displays statistics on the volume of mail processed by sendmail. The time at which data collection commenced is printed first, followed by a table with one row for each configured mailer and one showing a summary total of all mail. Each line presents eight items of information: Field Meaning M The mailer (transport protocol) number msgsfr The number of messages received from the mailer bytes_from The Kbytes of mail from the mailer msgsto The number of messages sent to the mailer bytes_to The Kbytes of mail sent to the mailer