mail_manual_setup(7) — Special Files
NAME
mail_manual_setup − Describes how to manually set up and start mail
DESCRIPTION
Manually setting up and starting your mail system involves stopping and starting the sendmail utility, making changes to the /var/adm/sendmail/sendmail.cf and /var/adm/sendmail/hostname.m4 files, and running the newaliases command. This reference page also provides information about the four mail utilities included in the DEC OSF/1 operating system, and the sendmail utility.
Setting Up Your Mail System
Setting up your mail delivery system requires that you understand how the sendmail utility works and how to modify the /var/adm/sendmail/sendmail.cf file and the m4 files.
The sendmail Utility
The sendmail utility is a general-purpose mail router that enables a user to send mail to users on the same and other systems. In most cases, the mail utilities rely on sendmail to parse mail addresses and to resolve system aliases. Specifically, when a message is sent, the message goes through the following delivery process:
1.The mail utility passes the message to the sendmail utility.
2.The sendmail utility checks its aliases database for full expansion of system names.
3.The sendmail utility parses the address of the receiver of the mail according to a set of rules. If the message is going to a user on the same system as the sender, sendmail passes the message to the mail utility for delivery. If the message is going to a user on a remote system, sendmail forwards the message to the sendmail utility (or the equivalent utility for systems other than DEC OSF/1) on the remote system by using one of the following protocols, as specified in the address:
•DECnet
Used to send mail with DECnet (for example, host::user).
•uux
Used to send mail with the UNIX-to-UNIX Copy Program (UUCP) (for example, decosf!user).
•SMTP
Used to send mail with the Transmission Control Protocol/Internet Protocol (TCP/IP) facility (for example, user@decosf.dec.com).
4.Once the message arrives on the correct system, the sendmail (or equivalent) utility passes the message to the mail utility for delivery to the receiver’s mailbox.
The sendmail Configuration File
The sendmail configuration file, sendmail.cf, contains the instructions for how your mail is sent and delivered, and how it is parsed. This file includes several tunable macros that you can modify to suit your environment, and one macro that you should be aware of but cannot modify. For more information, see the sendmail(8) reference page.
Using m4 Files
An alternate way to fine tune your mail configuration is to first run the mailsetup script (see the Network Configuration manual. The mailsetup script generates the following files:
•/var/admin/sendmail/sendmail.m4
•/var/admin/sendmail/hostname.m4
•/var/admin/sendmail/Makefile.cf.hostname
You can edit the /var/admin/sendmail/hostname.m4 file, modifying the define lines. The file contains comment lines (lines that begin with dnl), that provide additional information. For example, the following define line specifies that RFC976-style addressing is disabled:
define (_RFC976, {})dnl
To enable RFC976-style addressing, modify the line as follows:
define (_RFC976, {T})dnl
The T enables RFC976-style addressing. After you edit the file, change to the /var/adm/sendmail directory and issue the following command:
# make -f Makefile.cf.hostname:
This command generates a hostname.cf file. To use the new configuration, copy the hostname.cf file to sendmail.cf and restart sendmail by using the /sbin/init.d/sendmail restart command.
For more information, see the m4(1) and sendmail.m4(8) reference pages.
User Configurable Mail Locking
Different mailers use different methods to lock mailbox files. DEC OSF/1 enables you to configure the locking style. To do this, use the /usr/sbin/rcmgr set command to set MAILLOCKING in the /etc/rc.config file.
Valid values for MAILLOCKING are as follows:
•0 or 4 − Specifies lockf.
•1 − Specifies lockfile.
•2 − Specifies Multi-channel Memo Distribution Facility (MMDF). This applies to MH only.
•5 − Specifies that both lockf and lockfile are used.
Restrictions
Spool files are locked while being modified by using the lockf call and by using a lock file (/var/spool/mail/$USER.lock). When spool files are NFS-mounted the NFS lockd daemon should be running on both the client and server machine. Any user-added program that modifies the spool area must use lockf, the lock file method of locking, or both.
ULTRIX Version 4.3 and earlier versions use lock file locking. Queue files (which reside in the /var/spool/mqueue directory) are locked using lockf. Sharing mqueue over NFS is supported with NFS locking (lockd) enabled.
Starting the Mail System
To start the mail system, use the following procedure:
1.Edit the /var/adm/sendmail/sendmail.cf file to change the macro definitions described in the Network Configuration .
2.Issue the newaliases command to initialize the sendmail aliases database as follows:
# newaliases
3.Stop the current sendmail process by using the following command:
# /sbin/init.d/sendmail stop
4.Start the sendmail utility as follows:
# /sbin/init.d/sendmail start
SMTP Mail Service started
Alternatively, steps 2 through 5 can be accomplished by using the restart option to the sendmail startup script as follows:
# /sbin/init.d/sendmail restart
This command does the following:
•Initializes the sendmail aliases database
•Stops the current sendmail process
•Freezes the sendmail.cf configuration file
•Starts the sendmail utility
Setting Up the Post Office Protocol
The Post Office Protocol (POP) offers users an alternative to the standard mail system. To enable users on your system to use POP for mail, you must enable the mh POP server (popd). To make this option available to users, perform the following steps:
1.Create an account called pop, with /var/spool/pop as the home directory and make pop the owner.
2.Change the owner of /usr/lib/mh/spop to pop by entering the following command:
# chown pop /usr/lib/mh/spop
3.Create a file in the /var/spool/pop directory called POP.
4.Add an entry into the POP file in the following format for every user who uses mh:
user::user:::user@<client_address>::::0
5.Run the popaka program for every user entered in the POP database. This produces a string.
6.Enter the string produced from running the popaka program in the systemwide alias file.
7.Run newaliases.
8.Run popd in the background and redirect the output to a null file.
If you are running in a Network Information Service (NIS) environment, perform the following steps to enable users on client machines to reply to or send mail so that the return address is correctly sent to the POP server machine:
1.Ensure that NIS aliases for the POP user point to the POP server machine.
2.Run mailsetup and select the quick option or modify the send mail configuration file to specify the POP server machine.
3.Check the svc.conf to ensure the local, yp aliases exist. If not, add them.
RELATED INFORMATION
aliases(4), mail(1), mail_intro(7), mailx(1), POP (5), pop (8), popaka (8), popd (8), popwrd (8), rc0(8), sendmail.cf(3), syslog(3)