It is a good idea to place this command in the post-connect field of the dialout configuration (if you are using Linuxconf to configure the PPP dialout).
Note that on some distributions (redhat,mandrake and conectiva and slackware are fine), you will need to fiddle the sendmail startup script by hand to control the queue delay.
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
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