IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

Linux Mail-Queue mini-HOWTO

Search Howtos :Match :
Next Previous Contents

3. Dial-on-demand solutions PART

Written by Jan P Tietze <jptietze at mail.hh.provi.de>.

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.

3.1 Configuring sendmail.cf

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 sendmail.cf directly, for trivial configurations

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$* <  at  $* $~P > $*               $: $1 <  at  $[ $2 $3 $] > $4

Precede that line with a "#" so that it reads

#R$* <  at  $* $~P > $*              $: $1 <  at  $[ $2 $3 $] > $4

Configuring sendmail.cf using the m4 source.

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

3.2 Adding dial delay

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.

Configuring sendmail.cf directly

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.

Configuring sendmail.cf using m4 source

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


Next Previous Contents
Search Howtos :Match :
DbVisualizer 6.5.2
The Universal Database Tool
PhpMyAdmin 3.1.2 rc1
Php front-end to MySQL administration
Xine 1.1.6
Free video player
Glade 3.5.5
User interface builder for GTK+ and Gnome
Evolution 2.25.4
GNOME mailer, calendar, contact manager and communications tool
GEdit 2.25.4
Small but powerful text editor
LimeWire 5.0.4
Gnutella Client
WebGUI 7.6.8
A fully featured content management system.
GTK2 2.14.7
GUI Toolkit
Brasero 0.9.0
Application to burn CD/DVD
Free IT Magazines, White Papers, eBooks, and more !
Dr. Dobb's Journal

Dr. Dobb's Journal enables programmers to write the most efficient and sophisticated programs and help in daily programming quandaries.

The 7 Things that IT Security Professionals MUST KNOW!

Gain key insight into security problem and find the safest means to protect your technological assets.

Database Trends and Applications

Provides timely coverage of the technology, intelligence and insight needed to plan, implement and manage information-rich projects.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info