Configuring Sendmail with the M4 Macro Set
Because the sendmail configuration file uses a cryptic format, the M4 macros were developed to
make configuring sendmail easier. Instead of having to learn the complex commands sendmail uses, the
macros are relatively simple.
NOTE: unless you are familiar with the M4 macros and sendmail
configuration, we strongly advise against modifying your sendmail settings.
The M4 macros, along with some example master configuration files, are already installed on your VPS2. The
default sendmail.cf that your VPS2 comes with is generated from the /etc/mail/freebsd.mc
file, which is a good template to use when creating your own custom sendmail configuration files. The
macros themselves are located in the /usr/share/sendmail/ directory.
Using the M4 macros
In order to use the M4 macros, you must first create a master configuration file (.mc) containing
the features and options you want sendmail to have. The .mc file should be located in the
/etc/mail directory on your VPS2.
Before replacing your current sendmail.cf file, you should create a copy of it in case you need to
revert back to the original. As root, run the following commands from your VPS2 shell.
# cp sendmail.cf sendmail.cf.bak
Run the following command to convert the .mc file to a .cf file that sendmail can use.
# /usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/ /usr/share/sendmail/cf/m4/cf.m4 \ your-file-name.mc > your-file-name.cf |
You can now replace the sendmail.cf with your custom .cf file.
# cp /etc/mail/your-file-name.cf /etc/mail/sendmail.cf
As with any time you make changes to the sendmail configuration, you must restart the sendmail
daemon for the changes to take effect.
# cd /etc/mail
# make restart
Common uses for the M4 macros
There are several different reasons why you may want to modify your sendmail.cf using the M4 macros.
In addition to creating mail filters directly in sendmail, you may want to use
procmail or
SpamAssassin to filter messages.

|