Written by Jan P Tietze <[email protected]>.
Many Linux users access the Internet through a dialup line, and many have decided to implement dial-on-demand facilities on their system. That is, whenever an IP packet of some sort has to leave the local network or the local host, the link to an Internet Service Provider (ISP) will automatically be established. The link will be dropped after some period of time that no packet has travelled across.
Although this is very comfortable and cost effective, there is one special case in which this is neither comfortable (as the time to bring up a "traditional" modem dialup is very noticeable) nor cost effective, and this is sending e-mail. E-Mail is commonly sent by SMTP, either delivered by your own system or through a SMTP host on the Internet that usually resides in your ISP's network.
With dialup lines, every time you send a message the link will have to be brought up. This is quite okay if you send only one message, but if you happen to create and send multiple messages, bringing up the line more than once can be tedious and cost ineffective. Also, if your ISP imposes limits as to what times you are allowed to login, this would also restrict you to postpone messages at certain times of the day, and you would have to manually send them later.
Section 1 of this document will solve the situation, however in situations where an external DNS lookup would cause the link up, the link will still be established even if e-mail is just being queued. The reason is that sendmail wishes to "canonify" host names.
The solution to this problem is twofold: First, we'll have to moderately change sendmail.cf. And then we have to define the process of actual mail delivery. Personally, I prefer to have cron do the job for me and describe the necessary changes below.
For the reasons stated in [1.2], I recommend modifying the m4 sources instead of editing sendmail.cf directly. It will actually save you a lot of hassle and make configuration changes more verbose.
First, perform all the changes described in the first part of this document. Then go through the dial-on-demand specific stuff.
Configuring directly is highly impractical and anything but verbose, but obviously, this is your decision.
Close to very bottom of your sendmail.cf should be a line that reads:
R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4
Precede that line with a "#" so that it reads
#R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4
Add the following line to /usr/src/sendmail-8.8.7/cf/cf/yourhostname.smtp.mc:
FEATURE(nocanonify)dnl
Your final sendmail.cf can then be built by issuing the following commands. Remember to always back up your old /etc/sendmail.cf before installing the new one:
cp /etc/sendmail.cf /etc/sendmail.cf.bak
cd /usr/src/sendmail-8.8.7/cf/cf
m4 yourhostname.smtp.mc > /etc/sendmail.cf
It is oftentimes useful, especially when using modem lines, to have a dial delay installed. This means that if sendmail tries to initiate a connection in an attempt to send an e-mail (and this causes the line to go up) but the link actually takes more time to get established than what sendmail thinks should be a reasonable timeout, sendmail will simply wait some seconds and then retry.
Somewhere in your sendmail.cf could be a line that would read:
#O DialDelay=10s
(or very similar). Delete the ``#''. If there's no ``#'' at the beginning of the line, things should be considered okay (it just means this had already been enabled before).
If there is no such line in your sendmail.cf, add one (it is a wise thing to do to add this in the "options" part of the file):
O DialDelay=10s
Now change the ``10s'' part to the number of seconds you deem suitable.
Add the following line to /usr/src/sendmail-8.8.7/cf/cf/yourhostname.smtp.mc:
define(`confDIAL_DELAY',`10s')
Now change the ``10s'' part to the number of seconds you deem suitable.
Your final sendmail.cf can then be built by issuing the following commands. Remember to always back up your old /etc/sendmail.cf before installing the new one:
cp /etc/sendmail.cf /etc/sendmail.cf.bak
cd /usr/src/sendmail-8.8.7/cf/cf
m4 yourhostname.smtp.mc > /etc/sendmail.cf
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |