find it difficult to deliver messages to some locations (such as some
underdeveloped areas of the world, where email services are unreliable and
sporadic). In those situations, you can configure Postfix to function as a smart
host by passing email on to another sender instead of attempting to deliver the
email directly. You can use a line such as the following in the main.cf file
to enable a smart host:
Click here to view code image
relayhost = mail.isp.net
This line causes Postfix to pass any mail it receives to the server
mail.isp.net rather than attempt to deliver it directly. Smart hosting will
not work for you if your ISP blocks any mail relaying. Some ISPs block
relaying because it is frequently used to disseminate spam.
Setting Message Delivery Intervals
As mentioned earlier in this chapter, Postfix typically attempts to deliver
messages as soon as it receives them, and it attempts to deliver them again at
regular intervals after that. If you have only periodic connections to the
Internet, as with a dial-up connection, you likely would prefer Sendmail to
hold all messages in the queue and attempt to deliver them whenever you
connect to your ISP.
As dialup connections have become the exception rather than the rule and are
now quite rare, Ubuntu does not configure them by default and does not
include the pppd daemon in the default installation. If you need this, install
pppd from the Ubuntu software repositories. You can then configure Postfix
to hold messages for later delivery by adding the following line to
/etc/ppp/peers/ppp0:
Click here to view code image
/usr/sbin/sendmail -q
This line causes Postfix to automatically send all mail when you connect to
your ISP.
However, Postfix still attempts to send mail regardless of whether the
computer is online or offline, which means your computer may dial out just to
send email. To disable this, you need to enter the following line into
mail.cf:
Click here to view code image
defer_transports = smtp