rewrite: ruleset 199   input: isaac < @ linux . org . au . >

rewrite: ruleset 199 returns: isaac < @ linux . org . au . >

rewrite: ruleset  98   input: isaac < @ linux . org . au . >

rewrite: ruleset  98 returns: isaac < @ linux . org . au . >

rewrite: ruleset 198   input: isaac < @ linux . org . au . >

rewrite: ruleset  95   input: < uucp-new : moria > isaac </

    @ linux . org . au . >

rewrite: ruleset  95 returns: $# uucp-new $@ moria $: isaac </

    @ linux . org . au . >

rewrite: ruleset 198 returns: $# uucp-new $@ moria $: isaac </

    @ linux . org . au . >

rewrite: ruleset   0 returns: $# uucp-new $@ moria $: isaac </

    @ linux . org . au . >

The results of this test indicate that the hostname was resolved, and that the message would still have been routed to our smart host. This proves that our LOCAL_NET_CONFIG definition works correctly and it handled both cases correctly. This test was also successful, so we can happily assume our configuration is correct and use it.

Running sendmail

The sendmail daemon can be run in either of two ways. One way is to have to have it run from the inetd daemon; the alternative, and more commonly used method is to run sendmail as a standalone daemon. It is also common for mailer programs to invoke sendmail as a user command to accept locally generated mail for delivery.

When running sendmail in standalone mode, place the command in an rc file so it starts at boot time. The syntax used is commonly:

/usr/sbin/sendmail -bd -q10m

The -bd argument tells sendmail to run as a daemon. It will fork and run in the background. The -q10m argument tells sendmail to check its queue every ten minutes. You may choose to use a different queue to check time.

To run sendmail from the inetd network daemon, you'd use an entry like:

smtp stream tcp nowait nobody /usr/sbin/sendmail -bs

The -bs argument here tells sendmail to use the SMTP protocol on stdin/stdout, which is required for use with inetd.

The runq command is usually a symlink to the sendmail binary and is a more convenient form of:

# sendmail -q

When sendmail is invoked this way, it processes any mail waiting in the queue to be transmitted. When running sendmail from inetd you must also create a cron job that runs the runq command periodically to ensure that the mail spool is serviced periodically.

A suitable cron table entry would be similar to:

# Run the mail spool every fifteen minutes

0,15,30,45 * * * * /usr/bin/runq

In most installations sendmail processes the queue every 15 minutes as shown in our crontab example, attempting to transmit any messages there.

Tips and Tricks

There are a number of things you can do to make managing a sendmail site efficient. A number of management tools are provided in the sendmail package; let's look at the most important of these.

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)

                                   [email protected]

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

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату