|
|
The syslog daemon must be configured to log mail events before
you attempt to run Sendmail. The FOS syslog daemon configuration
file is /SYSLOG/PUB/syslog.conf, and the syslog daemon is started by
streaming /SYSLOG/PUB/JSYSLOGD. The default syslog.conf file
will log Sendmail messages to /tmp/syslog.log.
Sendmail uses two configuration files: /etc/mail/submit.cf when a
user on the local machine is submitting a new
e-mail message, and /etc/mail/sendmail.cf for all other functions
including the mail daemon. These
*.cf configuration files are generated from several *.mc macro files
which are expanded by the m4 macro processor program.
If you only need to make simple configuration changes such
as uncommenting a statement or changing an existing statement parameter,
you can edit the *.cf files directly. But if you are adding major
new functionality, you will need to regenerate the *.cf files from
the *.mc files. It is good Sendmail practice to ALWAYS make configuration
changes by editing the *.mc files and then expanding them into their *.cf form.
To regenerate /etc/mail/submit.cf:
:HELLO SERVER.SENDMAIL
:XEQ SH.HPBIN.SYS -L
shell/iX> cd /SENDMAIL/CURRENT/cf/cf
shell/iX> cp submit-mpeix.mc.sample
submit-mpeix.mc
Edit submit-mpeix.mc with the bytestream file editor
(i.e., vi) of your choice to make your changes.
shell/iX> m4 ../m4/cf.m4 submit-mpeix.mc
>submit-mpeix.cf
shell/iX> cp submit-mpeix.cf
/etc/mail/submit.cf
To regenerate /etc/mail/sendmail.cf:
:HELLO SERVER.SENDMAIL
:XEQ SH.HPBIN.SYS -L
shell/iX> cd /SENDMAIL/CURRENT/cf/cf
shell/iX> cp generic-mpeix.mc.sample
generic-mpeix.mc
Edit generic-mpeix.mc with the bytestream file editor
(i.e., vi) of your choice to make your changes.
shell/iX> m4 ../m4/cf.m4 generic-mpeix.mc
>generic-mpeix.cf
shell/iX> cp generic-mpeix.cf
/etc/mail/sendmail.cf
The default copy of /etc/mail/sendmail.cf assumes that your local
machine will be delivering e-mail directly to the recipient's mail server.
If you instead need to relay all of your outbound e-mail through a central
relay server, you can simply edit /etc/mail/sendmail.cf to specify
the relay host name, i.e.,:
# "Smart" relay host (may be null)
DSmy.relay.host.name
Alternatively you can modify the generic-mpeix.mc file as shown below
and then rebuild the sendmail.cf file as explained previously:
define(`SMART_HOST', `my.relay.host.name')
In addition to the *.cf configuration files, some Sendmail
features require the use of additional configuration files known
as database maps. Database maps consist of ASCII key/value pairs
that have been compiled into a binary database format. Maps are
created by the makemap command, and can be
modified by the editmap command. For example:
:HELLO SERVER.SENDMAIL
:XEQ SH.HPBIN.SYS -L
shell/iX> /bin/cat - >/etc/mail/access
imaspammer.com REJECT
:EOD
shell/iX> makemap hash /etc/mail/access
</etc/mail/access
An ASCII file called /etc/mail/access is created with an entry that
tells Sendmail to reject all e-mail sent from the imaspammer.com
domain. The makemap command is then used to read this ASCII file from
stdin via I/O redirection. The first parameter of makemap describes the
database format to be used (Berkeley DB hash or btree), and the second
parameter is the name of the binary output file that will be created after
".db" is appended to the name.
It is important to note that while /etc/mail/sendmail.cf will refer to
the ASCII database file name (i.e., /etc/mail/access), Sendmail will
actually be reading the data from the binary database filename (i.e.,
/etc/mail/access.db). So whenever you make a change to ASCII database
map file data, you must run makemap to create the binary database *.db
file, and then restart Sendmail for the changes to be visible.
For more details about database maps, please see "man makemap" and
"man editmap".
Starting the Mail Daemon
Make sure that a syslog daemon is running before you start the mail daemon.
To start the FOS syslog daemon, :STREAM JSYSLOGD.PUB.SYSLOG.
Simply :STREAM JDAEMON.PUB.SENDMAIL to start the mail daemon.
Stopping the Mail Daemon
The following command performed in the POSIX shell while logged
on to SERVER.SENDMAIL or any SM user will stop the mail daemon job:
kill $(head -n 1 /etc/mail/sendmail.pid)
|