Rule Set 1

Rule set 1 is intended to process all sender addresses. It is rarely used but can find application at sites where all outgoing mail should appear to come from a central mail server. Rules to handle this host hiding might look like this:

R $* <@ $=w> $*      $@ $1 <@ $M> $3        user@localhost => user@ourdomain

In the LHS, the $=w matches any name from a list of names by which the local host is known. In the RHS, the $M contains the name of the mail server. If the mail is not from the local host, it is unchanged.

Other uses for rule set 1 might include the following:

  • Normalizing senders, for example, making mail from the users operator and dumper appear to come from root

  • Hiding user login names by mapping them (through an external database) to the form firstname.lastname

Needless to say, great care should be exercised in adding schemes such as these to your configuration file.

See LOCAL_RULE_1 (LOCAL_RULE_1 and LOCAL_RULE_2 mc macros on page 596) for a way to add rules to rule set 1.

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.