AIX/HP-UX Interoperability Guide (continued)
[Last Chapter: 12. NFS]
AIX user agents are mail, mailx, and Mail, all of which are the same program since these are all hard links to the same executable. This program most closely resembles the mailx program found on HP-UX systems. Another user agent, mhmail, just composes, sends, and files messages. The default routing agent is the sendmail program, and the default delivery agents are /usr/bin/bellmail (for local users), Basic Networking Utilities (BNU, a version of UUCP), and SMTP (for TCP/IP).
The default /etc/sendmail.cf file defines configuration for local, TCP/IP, and BNU delivery. This should be enough for most sites, but if you need further customization, do the following:
# sendmail -bz
# refresh -s sendmail
sendmail
by default should start up at bootup. If it doesn't, then uncomment
the following line from /etc/rc.tcpip:
start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"
To start the sendmail daemon using the SRC:
# startsrc -s sendmail -a "-bd -q30m"
To stop the sendmail daemon using the SRC type the following:
# stopsrc -s sendmail
To start the sendmail daemon using the command line:
# sendmail -bd -q30m
To stop the sendmail daemon using the KornShell kill command:
# kill $(cat /etc/sendmail.pid)
AIX keeps mail aliases in /etc/aliases. In addition to aliases you provide, this file must contain an alias for each of the following:
To compile the aliases database file type one of the following:
# sendmail -bi
# newaliases
This command creates the following dbm files:
In AIX the mail queue directory is /var/spool/mqueue. The naming convention for the files in this directory is virtually the same as that for HP-UX:
A file beginning with
|
is a
|
df
|
data file
|
qf
|
queue control file
|
tf
|
temporary file
|
xf
|
transcript file
|
nf
|
backup file
|
lf
|
lock file
|
The sendmail queue processing interval, as in HP-UX, is set with the -q option to the sendmail command.
To process the mail queue once:
# sendmail -q
To process the mail queue every 15 minutes:
# sendmail -q15m
To process the mail queue every 30 seconds:
# sendmail -q30s
To change the processing interval permanently, edit the following line in /etc/rc.tcpip to the value you desire:
qpi=30m
The qpi variable is used as an argument in the next line:
start /usr/lib/sendmail "$src_running" "-bd -q${qpi}"
Mail logging by default goes to the file /var/spool/mqueue/log. This is specified in the /etc/syslog.conf file. If you want to log to a different file just edit /etc/syslog.conf and refresh syslogd:
# refresh -s syslogd
AIX supports the mailstats command. For this command to work the /etc/sendmail.st file must exist with permissions 660.
HP-UX user agents are mail, mailx, and elm. mail is the standard AT&T program, whereas mailx is HP-UX's version of BSD's /usr/ucb/mail. The default routing agent is the sendmail program, and the supported delivery agents are /bin/rmail (for local users), UUCP, HP's OpenMail, X.400, and SMTP.
You have two ways to configure mail. You can:
SAM installs the default sendmail configuration file, makes sendmail executable, creates the system-wide mail alias database files from the aliases source file, and invokes the daemon.
The following steps tell how to use SAM to install sendmail:
When you installed the ARPA Services product, all files and directories needed to use sendmail were installed in the correct directories with the proper permissions except the alias file (/usr/lib/aliases), the sendmail configuration file (/usr/lib/sendmail.cf), and the sendmail executable file (/usr/lib/sendmail).
To install sendmail, you must do the following:
The supplied configuration file, /etc/newconfig/sendmail.cf is appropriate for many installations without modification. In particular, when initially installing sendmail, simply copying the supplied configuration file into place provides basic connectivity and permits you to integrate your system into your mail environment without immediately having to edit the configuration file. In addition, a number of localizations and routing options are provided. Descriptions of these options and detailed editing instructions are provided in the supplied configuration file itself.
To install the supplied configuration file unmodified, copy the file /etc/newconfig/sendmail.cf to /usr/lib/sendmail.cf. To make any of the supported modifications, copy /etc/newconfig/sendmail.cf to /usr/lib/sendmail.cf and edit /usr/lib/sendmail.cf according to the instructions in the file itself.
To make sendmail executable, as superuser, issue the command:
# chmod 5555 /usr/lib/sendmail
sendmail is normally run setuid to root (mode 5555). The default configuration is believed to be safe. However, it is possible to misconfigure sendmail so that it inappropriately promotes the privilege of ordinary users.
If sendmail does not run setuid to root, this risk is eliminated. Note that this causes sendmail to ignore the "S" mailer flag (not specified in the mailers defined in the default configuration file) and the values of the "u" and "g" configuration options, since it is unable to setuid to these users when executing mailers.
sendmail can be run non-setuid (mode 1555) if the following changes to the default configuration are made:
# /usr/lib/sendmail -bi
# chmod 666 /usr/lib/aliases.dir /usr/lib/aliases.pag
Making these changes creates some security risk. Anyone will be able to delete mail from the mail queue. However, no one will be able to read other people's mail in the mail queue.
The /etc/newconfig aliases file is an example alias file that contains default aliases needed by sendmail. To create system-wide mail aliases, copy /etc/newconfig/aliases to /usr/lib/aliases. You can add any aliases that are appropriate for your system by editing the /usr/lib/aliases file. Once sendmail is executable issue the following command:
This creates the alias database files, /usr/lib/aliases.dir and /usr/lib/aliases.pag.
To start the sendmail daemon, as superuser, issue the following command:
# /usr/lib/sendmail -bd -q30m
The -bd mode initializes the sendmail daemon to receive mail from the network. The -q30m flag causes sendmail to process the mail queue every 30 minutes.
Whenever your system is rebooted, if sendmail is executable, the /etc/netbsdsrc script does the following:
If the sendmail configuration file or frozen configuration changes, you should kill and restart the sendmail daemon so that it re-reads the configuration file.
The command
# /usr/lib/sendmail -bk
run by the superuser, kills a sendmail daemon started with -bd, whether or not it was started with the -q interval flag. It does not kill a sendmail daemon started only with -q interval. You must kill this type of daemon by finding its process ID and killing it explicitly.
NOTE: Do not kill sendmail with kill -9. This may cause sendmail to corrupt the alias database. Use kill-15 instead.
The sendmail frozen configuration file is /usr/lib/sendmail.fc. To freeze the configuration file, issue one of the following commands as superuser:
# /usr/lib/sendmail -bz
# /etc/freeze
Then restart the sendmail daemon:
# /usr/lib/sendmail -bd -q30m
To use SAM to refreeze the configuration and kill and restart the sendmail daemon, do the following:
The HP-UX mail queue directory is /usr/spool/mqueue. The naming conventions for the files in this directory are nearly identical to those found in AIX. See AIX "The Mail Queue" for more information on the file name formats.
sendmail logs its mail messages through the syslogd logging facility. The syslogd configuration on diskless clients should forward all logging that results from sending mail to the cluster root server. The syslogd configuration on cluster servers and standalone systems by default write mail logging to the file /usr/spool/mqueue/syslog. To change this file, edit the /etc/syslog.conf file
There several ways to create a central mail hub or server. You can use MX records in DNS, you can use the aliases database, or you can configure sendmail.cf. Below are two examples of using sendmail.cf. This example assumes the machines are on the same network, are part of the same DNS domain, and have the same users available.
Configuring AIX's sendmail.cf file to route to an HP-UX hub is quite simple. Consider the following lines from /etc/sendmail.cf:
################################################################### # # Host name for central mail server (YOU MAY OPTIONALLY DEFINE THIS) # # Optionally defined macro specifying name of host to which you want # to relay all local mail. This is used if there is a central mail # server that should receive all mail for a given area. # # When this macro is defined, mail that would otherwise be delivered # to "user" on the local machine is delivered to "user@server" on the # server machine. Note that this is similar to what would occur if # the mail spool directory were remote-mounted from the mail server. # For this reason, this macro can be used to achieve the same effect # as remote-mounting the mail spool directory, but without the access # and locking problems that can sometimes occur with remotely mounted # filesystems. # #DLMailServerName # ###################################################################
If, for example, your mail hub's hostname was elmo, you would need to create a line that reads:
DLelmo
Mail sent to dylan@sadie, for example, would be directed to the machine elmo, even if elmo was an HP-UX box, provided of course that sadie's /etc/sendmail.cf file contains the above line and that the user dylan was recognized on both systems. The user dylan would then have to either log on to sadie to get his messages, or the /usr/mail directory on sadie would have to be mounted on /var/spool/mail on elmo. NFS mounts of the respective mail spooling directories on both systems seem to have no problem with permissions as long as they are exported read-write with either root access granted to machines within the domain or with the anonymous userid set to 0.
Remember that making the above change in /etc/sendmail.cf is not enough: you have to rebuild /etc/sendmail.cfDB and refresh the sendmail daemon.
This direction is a bit harder to implement. There are several steps involved:
DS
should have the hub's name appended. For example:
DSsadie
R$+<@$+> $#tcp$@$2$:$1<@$2> user@domain
R$+<@$+> $#tcp$@$S$:$1<@$2> user@domain to SMTP relay
R$+ $#local$:$1 name
R$+ $#tcp$A$S$:$1
#R$+ $:$1<@$w> add local domain
To:
R$+ $:$1<@$S> add local domain
Assuming that the above sendmail.cf file belongs to the HP-UX machine called elmo, mail sent to dylan@elmo would be routed to dylan@sadie, an AIX machine. You can export /usr/mail from elmo for NFS mounting to /var/spool/mail on sadie. Again, the export must either grant root access or set the anonymous userid to 0.
AIX and HP-UX have similar mail agents in mail and mailx, respectively, but there the similarity ends. AIX's mailx is actually a hard link to mail. HP-UX's mail program is the old AT&T version and is not found in AIX. elm is packaged with HP-UX but not AIX.
Each of the two system's sendmail
files look and feel much the same, though their locations are
different. Below lists the major files and their locations.
AIX
|
HP-UX
|
/etc/sendmailsendmail
|
/usr/lib/sendmailsendmail
|
/etc/sendmail.cf
|
/usr/lib/sendmail.cf
|
/etc/aliases
|
/usr/lib/aliases
|
/etc/aliasesDB/DB.dir
|
/usr/lib/aliases.dir
|
/etc/aliasesDB/DB.pag
|
/usr/lib/aliases.pag
|
/etc/sendmail.cfDB
|
/usr/lib/sendmail.fc
|
/var/spool/mail
|
/usr/mail
|
/var/spool/mqueue
|
/usr/spool/mqueue
|
/usr/share/lib/Mail.rc
|
/usr/lib/mailx/mailx.rc
|
/usr/sbin/mailq
|
/usr/bin/mailq
|
/usr/sbin/mailstats
|
/usr/bin/mailstats
|
/etc/sendmailsendmail.st
|
/usr/lib/sendmailsendmail.st
|
Provide feedback to: alan_roberts@hp.com