Generating the sendmail Configuration File

Once you have completed your m4 macro configuration file editing, you use the m4 macro processor to create the final sendmail configuration file. For the following examples, we assume that your macro configuration file is located at /usr/lib/mail/myconfig.mc.

If you used the built-in include directive mentioned in “Including the Sendmail m4 Macro Definitions” , run the following command.

# m4 /usr/lib/mail/myconfig.mc > /tmp/sendmail.cf
					

If you did not use the built-in include directive, you can still run m4, using the following arguments.

# m4 /usr/lib/mail/m4/cf.m4 /usr/lib/mail/myconfig.mc > /tmp/sendmail.cf
					

Now that you have a sendmail configuration file located at /tmp/sendmail.cf, you need to relocate it to /etc/mail/sendmail.cf so that sendmail can see it. To do so, as root, run the following command.

# cp /tmp/sendmail.cf /etc/mail/sendmail.cf
					

You can now stop and restart the sendmail daemon to make your changes take effect. Make sure that you have already created any necessary external database map files with makemap(1) (described in “External Configuration Files” ) before you carry out the next step.

# /etc/init.d/sendmail stop
# /etc/init.d/sendmail start
					

Testing the Rewriting Rules—the -bt Flag

When you build a configuration file, you can perform a certain amount of testing by using the test mode of sendmail. For example, you can invoke sendmail as

% sendmail -bt -Ctest.cf
						

which then reads the configuration file test.cf and enters test mode. For example,

ADDRESS TEST MODE
Enter <ruleset> <name>
>

In this mode, you enter lines of the following form, where rwset is the rewriting set you want to use and name is a name to which the set is applied.

ADDRESS TEST MODE
Enter <ruleset> <name>
> rwset name
						

Test mode shows you the steps it takes as it proceeds, finally showing you the name it ends up with. You can use a comma-separated list of rwsets for sequential application of rules to an input; ruleset 3 is always applied first. The following example first applies ruleset 3 to the input monet:bollard. Ruleset 1 is then applied to the output of ruleset 3, followed similarly by rulesets 21 and 4.

ADDRESS TEST MODE
Enter <ruleset> <name>
> 1,21,4 monet:bollard
						

If you need more detail, you can also use the -d21.99 flag to turn on more debugging. The following example turns on an incredible amount of information; a single word name can result in several pages of information.

% sendmail -bt -d21.99
						

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.139.62