Sendmail 8.8.5 configuration for a standalone machine using PPP as a dial-up sporadic network connection.

Audience:

This file should be read by anybody interested in correctly configuring sendmail to work in conjunction with PPP.  It describes how to configure sendmail to correctly work for both online and offline operation and in conjunction with POP servers serving multiple accounts.  It requires root privelege to correctly perform all the steps and may require the installation of a number of "more recent" versions of system software.

Preamble:

The following assumes that you have installed PPP-0.4.6 and have it running. Also, you must install sendmail 8.8.5, a new version of m4, and have a POP3 account for each  user wishing to send email. You can find the necessary files and clients at:

ftp://ftp.thoughtport.com/pub/next/ppp/NeXT-ppp2.2-0.4.6-pkg.tar.gz
ftp://ftp.next.peak.org/pub/next/latest_versions/sendmail.tar.gz
ftp://ftp.next.peak.org/pub/next/apps/devtools/m4.1.4.NIHS.bsd.tar.gz
ftp://ftp.next.peak.org/pub/next/apps/mail/PopOver.v1.5.NIHS.bd.tar.gz

Please note that these instructions will create the necessary sendmail-8.8.5 configuration files.  
You don't need to get discouraged when you read the installation notes for sendmail-8.8.5

Problem Description:

The usual problem encountered while trying to configure sendmail for a dial-up ppp connection is that the outgoing mail should have the "From" and "Reply-To" fields modified since they are by default set to the address of the host that is sending the message. For example, suppose your machine is named socrate  (you can see this info in /etc/hostconfig) and your domain is mathcn.umontreal.ca (you can see this info in /etc/resolv.conf  ... notice the spelling of this file). When user magnan sends mail, the recipient gets the message and sees it as coming from magnan@socrate.mathcn.umontreal.ca.  This is an invalid address because the machine socrate is my home machine and is not registered in the university's domain.  The NeXT_PPP_FAQ gives some answers to this kind of problem (go read it at http://www.thoughport.com:8080/PPP/).  This document is meant to obsolete that information. 

The real problems comes when you have many users on one system that have very diffrent pop accounts addresses. For example on my machine  socrate.mathcn.umontreal.ca three users send some email: root, magnan and martine. These users all have a POP3 account in which they accumulate their email:

User		Pop Account
--------------------------------------------------------
root		magnan@mathcn.umontreal.ca
magnan 	magnan@mathcn.umontreal.ca
martine 	gk691870@er.uqam.ca

So how can I configure sendmail so that the "From" and "Reply-To" fields gets written correctly? Further, how can I guarantee that  mail will be routed properly?  I want locally addressed mail to be delivered locally without traversing the PPP link.   I also want mail to be properly queued when  the PPP link is down. In this situation all mail should go directly to the queue and get posted when the link is brought up.

Here is a solution to all this. I am really not an expert in this domain but I was able to make it work for me by tweaking around with everything. It uses sendmail 8.8.5 user database capabilities.

Solution:

* Log in as root.

* First, you must have a domain name set in /etc/resolv.conf and a name for your machine set in /etc/hostconfig. 
   If you have PPP working, this is probably already done.

* Now, you must configure netinfo so that it also contains a fully qualified name for your machine (i.e.  socrate.mathcn.umontreal.ca as well as just socrate) . To do this open   NetInfoManager.app and go into /machines. You should see at least localhost and broadcasthost as subdirectories in there.  If your machine name is already present, select that and skip the next step (instructions that duplicate localhost).

* Select localhost and duplicate it (Command-d). Double click the new copy and you will see a window like (you may need to set the drop down menu to table to make it look similar to below... all fields may not be present):

¬

Change the name value to your host name, the ip_address to the address you gave to your host (see /etc/hostconfig) and leave the other values alone.  Please note that the IP address you give here is the standalone IP address and is not necessarily related to the IP address your provider gives you for your PPP link. 

* Now, with the name key selected, click "new value" in the "Directory" menu. Replace new_value by host.domain where host is your host name and domain your domain name. Now the window should look similar to:

¬

Also, if you did not do this in the sendmail 8.8.5 installation, you should double-click /locations/sendmail and change the value of the sendmail.cf key to /etc/sendmail.cf.   If the /locations/sendmail property is not present, just continue.

* With the present README.rtfd file you downloaded five files. Edit the file userdb so that all users sending mail on the system have in it an entry of the form:

username:mailname 		valid_email_address_for_this_user_including_domain (usually on the pop server)

* Next you must edit the sendmail configuration file mydomain.m4.  Replace the string "MATHCN.UMontreal.CA" in the line:

define(`confDOMAIN_NAME',`MATHCN.UMontreal.CA')dnl

by your domain name. Also replace "relais.cc.umontreal.ca" in the line :

define(`SMART_HOST',relay:relais.CC.UMontreal.CA)dnl

by the mail server of your internet provider (Ask your internet provider for this info. You can also try the PPP server for this host). This is where all "out-of-domain" mail should be routed. One final change. You need to replace "maths1.mathcn.umontreal.ca" in the line

define(`LUSER_RELAY',relay:MATHS1.MATHCN.UMontreal.CA)dnl

for a permanently connected host in your domain (the biggest server should be a good choice). This is where mail addressed to a non-valid local user should be routed.   In many cases, the last two entries will use the same hostname.

* Edit the file sendmail.cw. For me it looks like 

mathcn mathcn.umontreal.ca
mathcn.umontreal mathcn.umontreal.ca

so you must replace mathcn by the first word in your full domain name and put your full domain name at the right column of each line. If your domain name has more than 3 words you will need to have more lines in the file. If your domain has less that 3 words you will have just one line.  

* Now, everything is ready to be installed. In a new Terminal.app window manager go into the directory where  the present README file resides. Then execute the installation script by typing 

./inst_sendmail

This script will install the necessary files and create an  /etc/sendmail.cf.  Any files that already exist will be backed up using their same name with the new extension .prePPP appended.

* To save some DNS lookups add an entry in NetInfoManager.app (like you did above) for the two hosts you just defined in your mydomain.m4 file.

* Finally, restart your computer and do some tests. You should test if:

- local mail gets sent locally: try sending mail to user
- in domain mail gets sent correctly: try send mail to user_not_on_local_machine@mydomain
- out of domain mail gets sent correctly: try sending mail to anybody outside your domain
- any other test that seems pertinent for your configuration

If everything goes fine I would say that you have succeded. That's all! You survived this configuration...

Please send any question or comments to: magnan@mathcn.umontreal.ca
The latest version of these files will always be at: 

http://brise.ere.umontreal.ca/~magnan/

FranÛois Magnan
MontrÝal, July 5, 1996.

Thanks:

Special Thanks to Robert La Ferla for his help and his worderful port of sendmail 8.8.5 on NS. I would also like to thank Matthew N. Reichman for his helpful email on the part on NetInfo configuration. Finally, thousand thanks to Stephen Perkins for his suggestions to purify these instructions and his installation script.