21st Century I.T. Solutions

Davrom Consulting Pty Ltd

Established Since 2001
PO Box 1644, Sunnybank Hills, Qld, 4109
Phone/Fax: +61-7-32720267
ABN: 81 096 990 804

Return to the articles main page

The following article was written by David.M.Clark for SCO World Magazine.

Title: Working with Sendmail and MMDF
Issue: November 1996

The future of MMDF

Those who attended SCO Forum this year (1996) were informed that Sendmail would be the default Mail Transfer Agent (MTA) in all of SCO's future releases of operating system products. SCO FastStart defaults the email system to Sendmail at installation time and SCO Gemini will not include the traditional MMDF (Multichannel Memorandum Distribution Facility) MTA. It is possible that SCO will make MMDF available as a supplement for future releases of Gemini but this has yet to be decided upon.

While SCO focused on MMDF as its primary default MTA other vendors chose Sendmail which is now the most common MTA on Internet UNIX servers. Since the release of SCO UNIX, MMDF has been a powerful and easily administered email engine with the support for Sendmail being left up to the diehards who have the time and patience to attack the forboding code associated with Sendmail's setup.

(SCO MMDF administers its various email routing over different "channels" (SMTP, Local) which are configured via an easy to use front script invoked from the command line or selected in the graphical desktop. The script helps the admisitrator to define and implement email communication by automatically updating associated channel and domain files (*.chn and *.dom) located in the /usr/mmdf/table. A channel definition file called /usr/mmdf/mmdftailor contains references to the various channel and domain files used by the MMDF system. A system of alias files help the routing of email to specific users over the various channels which further promote ease of administration.

There are some advantages to manually modifying the channel files but this is not essential to implementing a working email system and in most cases, is all that is required. All in all, MMDF has served us well over the years.

Demystifying Sendmail

So how difficult is Sendmail configuration? Sendmail uses a single configuration file called "sendmail.cf" which is located in the /usr/lib directory and is built from a source file, "sendmail.src", located in the /usr/lib/sendmail.d directory. All email routes (Local, TCP/IP) are configured in this one central file. The disadvantage is that the file is somewhat cryptic but by familiarising yourself with some of the basic elements, you can actually decipher what some of the entries pertain to. Learning how to configure network based Sendmail at this point in time will certainly prepare you for future interconnectivity with the SCO email environment.

SCO have included a basic script that allows you to setup a functional Sendmail based system and this is invoked by typing "mkdev cf" at the command line while logged in as the root user. This script stores your responses to menu options in the sendmail.ans file located in the /usr/lib/sendmail.d directory. The script builds the sendmail.cf file by combining the contents of the sendmail.ans file with the master template file sendmail.src. The sendmail.cf file is then used by the sendmail binary located in the /usr/lib directory to handle the email.


Changing from MMDF to Sendmail

Making the change from MMDF to Sendmail is very simple and only takes a few minutes to de-install/install and setup. It is essential that your server is correctly setup with respect to its TCP/IP domain name such as "sco.com". The "domainname" command can be used to set your domain name but you must also reflect this in the /etc/default/tcp and /etc/hosts files. A typical scenario will be changing over from an existing MMDF installation to Sendmail on a TCP/IP based LAN. The server may also have a "smarthost" on the network with unknown email addresses being passed to it. This server under MMDF is known as the "badhost".

Before invoking the SCOAdmin Software Manager, ensure that you backup the user mailboxes in the /usr/spool/mail directory. You will then need to stop the MMDF deliver daemon by entering the command "/etc/init.d/mmdf stop". Next, it is a good idea to copy the contents of the /usr/mmdf directory to another location so you can make cross references between the two environments once Sendmail is installed.

You need to invoke the SCOAdmin Software Manager and remove the MMDF Mail Component from the OpenServer installed software list. This will remove the /usr/spool/mail directory and the MMDF associated directories (/usr/mmdf and /usr/spool/mmdf). Once MMDF has been removed, install the SCO Sendmail package from your installation media under the SCO Openserver Enterprise System, UNIX Mail Utilities.

Once the software has been installed you will need to execute the "mkdev cf" command which will produce a menu of options. To configure your server for functional TCP/IP based email communication, you only need to answer menu options "2. Edit Domain", "4. Edit Alternate Host Names" and "5. Miscellaneous Items". Option 5 has two submenu options that require input, options 3 for Smarthost and option 4 regarding Internet connection. You can answer question "2. Edit Domain" by either entering your domain name or letting the system obtain the answer by exectuing the "hostname" command. For the "hostname" command to work correctly for the Sendmail system, you must ensure that you have correctly setup your domain name for TCP/IP. You must answer question "4. Enter Alternate Host Names" as this option will check your host name using the "uname -n" command and appending the current Domain name to it. If you have a server in your network which is used to resolve unknown email addresses (smarthost) such as addresses external to your domain or not known on the currect server, then enter the name of this server in response to the "5. Miscellaneous Items" menu selection, answering question "3. Is there a smart mailhost on your network?". The "smarthost" has the same function as the "badhost/baduser" host entries for MMDF. It is important that the smarthost be kept up to date with internal organisation user email addresses to ensure email is effectively passed within the organistation. If the smarthost is also your Internet gateway server, then any unkown email addresses that do not match the existing internal domain name will be passed out to the Internet for resolution.

Even if your server is not connected to the Internet, you must answer "y" to the submenu option of "5. Miscellaneous Items", "4. Is this machine on the Internet" as this will ensure that the SMTP (Simple Mail Transfer Protocol) component is configured for TCP/IP connectivity.

Once you have answered all the menu options, select menu item "8. Generate sendmail.cf file" which will take the answers you have given that are stored in the sendmail.ans file, combine these answers with the sendmail.src file to create the final sendmail.cf file. The sendmail binary then uses this current information in the sendmail.cf file to obtain its configuration information. The sendmail binary may or may not start when you exit the menu but it can easily be re-started by entering the commmand "/etc/init.d/sendmail start". You now have Sendmail installed and operational.

The sendmail.cf file contains a set of entries that define how your system will handle the email. Here are some of the key elements extracted from the sendmail.cf file that will help you become familiar with its function. The sendmail.cf file uses two letter definitions (macros) that are used in combination throughout the file to help channel the email.


DDccc.com - The DD entry defines our local domain name
Dwhombre.ccc.com - The Dw entry is our fully qualified host name.
Cwhombre.ccc.com hombre hombre.ccc.com - The Cw entry contains a list of
our host alias names
DUhombre - The DU entry defines our UUCP host name
DFtaco - The DF entry defines our smarthost in our network
DnMAILER-DAEMON - The Dn entry defines the user name for failed email
OA/usr/lib/mail/aliases - The OA entry defines the location of alias file
Om - The Om entry causes the sender of an email to be sent a copy of the
message if they are listed in an alias that they are email to.
OQ/usr/spool/mqueue - The OQ entry defines the directory where queued email
is stored
OT3d - The OT entry defines the timeout interval for undelivered email

Modifying Sendmail Default Setup

If your server is not on the Internet and/or your organisation is not running DNS (Domain Name Servives) then you will need to manually edit the sendmail.src file and change the DNS line from:

     
          # Use DNS by default
          OI
     to:
          # Use DNS by default
          #OI

Changing this entry prevents email failing as Sendmail attempts to find the DNS server. It is better to edit the sendmail.src file and not the sendmail.cf file as this file is overwritten each time "mkdev cf" is executed.

The mmdftailor

One interesting point is that Sendmail does setup a file in the /usr/mmdf directory called "mmdftailor" which contains some old familiar entries from the MMDF configuration. The "mmdftailor" file is owned by root and and not the mmdf user and is still used by the "mail" binary when sending email. One modification that is required for this file is to break up the server name and domain name to ensure that your email address, for email reply purposes, is sent in the format of user_name@domain_name (danc@delphius.com.au) as opposed to user_name@server_name.domain_name (danc@dolphin.delphius.com.au). The following format of the mmdftailor file resolves this problem:


     MLNAME "delphius"
     MLDOMAIN com.au
     MLOCMACHINE "dolphin"
     MDLVRDIR	"/usr/spool/mail"
     MMBXNAME	""
     MMBXPROT	0600

If you find that your email addresses appear to have the domain name appended to them twice, you will need to edit the sendmail.src file and replace the "DwZZFULLNAMEZZ" entry with "Dwserver_name", where "server_name" is the name of the local server. After modifying sendmail.src you will need to invoke "mkdev cf" again and select option "8. Generate sendmail.cf file" to regenerate a new sendmail.cf file. It is important that you check the mmdftailor once you have run menu option 8 as the contents may be converted back to default values.

Configuring aliases

Setting up the aliases for Sendmail is simpler than MMDF as there is only one file to edit. An added advantage if you are migrating from MMDF to Sendmail is that the alias.n file format is same. The format of the the /usr/mmdf/table/alias.n file format is identical to the new aliases file for sendmail called: /usr/lib/mail/aliases. This uses the syntax:


     MAILER-DAEMON: Postmaster
     Postmaster:    mailman
     davidc:        davidc@trex
     danc:          danc@dolphin
     support:       davidc, danc, grant@bark.com.uk

The MMDF alias file contains three lines to process "lists" of users whereas the Sendmail aliases file only requires one line, for example the alias file containing the lines:


home:	home-outbound@list-processor
home-outbound:	davidc,rom,matthew,daniel
home-request:	davidc

would simply be changed to:

home:   davidc,rom,matthew,daniel

A simple way to combine the old MMDF alias files with the new Sendmail /usr/lib/mail/aliases file would be to cat the three files together and then edit the file making the relevant changes with a text editor.

To have the Sendmail aliases take affect, you need to execute the "newaliases" program and you do not need to stop and start the Sendmail daemon.

Testing the configuration

Once you have completed the installation of Sendmail and made the necessary changes to both the sendmail.cf and aliases file, you can test that the setup has been successful by executing the sendmail daemon directly in verbose mode. It is worth testing the configuration by sending an email firstly to a local system user, then to local group alias and then finally to a remote user on another server. For example, to send an echoed message to three addresses you type:

echo "testing" | /usr/lib/sendmail -v fred
echo "testing" | /usr/lib/sendmail -v sales
echo "testing" | /usr/lib/sendmail -v wilbur@gcanyon

Each of these tests will show a dialogue on the screen as sendmail attempts to deliver your message.

If the sendmail daemon does not appear have started then execute the command "/etc/init.d/sendmail start", you can then qualify if the sendmail deamon has started with the command "ps -ef | grep sendmail | grep -v grep". This should produce output similar to:

root 26802 1 0 Nov-15 ? 00:00:01 /usr/lib/sendmail -bd -q1h

The options shown here for sendmail are "-bd", run the daemon as a background task and the "-q1h" indicates that mail will be processed in the queue every hour.

The mailq command allows users to view the currently queued email in the /usr/spool/mqueue directory. Any undelivered email is listed in the mailq output. An example of the mailq output is:


		Mail Queue (1 request)
--Q-ID-- --Size-- -----Q-Time----- ------------Sender/Recipient------------
HAA24139*    1424 Mon Nov 18 07:25 davidc
				   sipowits@nypdb
				   davidc
				   simone@nypdb

What you lose with Sendmail

For some years now users have enjoyed the use of the MMDF "rcvtrip" facility which allows you to configure ".maildelivery" file in thier home directories to manage things like automaticall replies to users whilst away and enhanced email forwarding. These loses can be compensated for by writing a cron bases shell script to perform similar tasks.

If you are combining Sendmail and MMDF servers in the same network, you email will pass around without error as both MTAs use SMTP. The only issues you will encounter is the distribution of aliases across the LAN.

Getting more help

The SCO Online Documentation is well written and easy to follow and can help you with some of the basic fundamental setup issues. There is also a very highly recommended book called "Sendmail" by Bryan Costales, published by O'Rielly and Assocatiates. A good central source of information can be accessed on the Internet on "www.sendmail.org" where you can search through the varions FAQs and additional information sources from the users groups.




Return to the articles main page