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 VPS v2. The default that your VPS v2 comes with is generated from the /etc/mail/ 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 VPS v2.

Before replacing your current 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 VPS v2 shell.

# cp

Run the following command (all on one line) 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 > 

You can now replace the with your custom .cf file.

# cp /etc/mail/ /etc/mail/

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 using the M4 macros. In addition to creating mail filters directly in sendmail, you may want to use procmail or SpamAssassin to filter messages.

Please note: the information on this page applies to ITS web hosting plans. It may or may not apply to other environments. If you are looking for a feature described here, or better support from your hosting provider, please consider hosting your site with ITS!

1555 N Naperville/Wheaton Road, Suite 107
Naperville, IL 60563
phone 630.420.2550
fax 630.420.2771