linuxconf Howto/FAQ

Howto index

How to configure sendmail for on-demand link (PPP)

It is possible to configure sendmail so it behaves correctly for on demand link (PPP using diald for example). You can do this with Linuxconf.

Basic configuration dialog

Other fiddling

You must setup things so that email are processed once in a while. For example, you may want to trigger the Internet link every hour to deliver mail and retrieve the other mail. You may want to check fetchmail for mail retrieval. If the PPP config was done with Linuxconf and its dialout module, you can put the following script the /etc/cron.hourly script for example, or use the "root scheduled task" of Linuxconf control panel to fine tune the the call schedule:

     #!/bin/sh
     if netconf --connect dialout-config-name
     then
          /usr/sbin/sendmail -q &
          fetchmail config &
          wait
          netconf --disconnect dialout-config-name
     fi

Switching sendmail config while connected

Here is a trick RedHat user can use to switch the behavior of sendmail when they are connected. When "not connected", you do not want Sendmail to run its queue. When connected, you want sendmail to run its queue often enough so that email starts as soon as possible.

So you need 2 sendmail configuration file (/etc/sysconfig/sendmail). Use Linuxconf to disable queuing. This will update the config file above. Copy it in /etc/sysconfig/sendmail.offline.

Then enable queuing every minute. Copy the config file in /etc/sysconfig/sendmail.online

then in your dialout configuration, put this as your post-connect script

      cp /etc/sysconfig/sendmail.online /etc/sysconfig/sendmail; /etc/rc.d/init.d/sendmail restart
     

And in the post-disconnect script

      cp /etc/sysconfig/sendmail.offline /etc/sysconfig/sendmail ; /etc/rc.d/init.d/sendmail restart