O'Reilly logo

Sendmail, 3rd Edition by Bryan Costales

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The final Rule Set 4

Just as all addresses are first rewritten by the canonify rule set 3, so are all addresses rewritten last by the final rule set 4. Beginning with V8.10 sendmail, that rule set is declared like this:

Sfinal=4

As the name final implies, the job is to undo any special processing done by the canonify rule set 3, such as focusing. In this section we’ll examine some typical final rule set 4 rules.

Stripping Trailing Dots

Under some versions of sendmail a successful conversion to a fully qualified domain name leaves an extra dot trailing the result. This rule strips that dot:

# strip trailing dot off possibly canonical name
R $* <@ $+. > $*       $1 <@ $2 > $3

Note that this rule recursively removes as many trailing dots as it finds. Also note that the host part remains focused after rewriting.

Restoring Source Routes

Recall that the canonify rule set 3 converted the commas of source route addresses into colons (Section 19.3.3). The final rule set 4 now needs to restore those commas:

R $* : $+ :$+ <@ $+>       $1 , $2 : $3 <@ $4>            <route-addr> canonical

This rule recursively changes all but one (the rightmost) colon back into a comma.

As a special note, under V8 sendmail, envelope-sender route addresses are always surrounded by angle brackets when passed to the delivery agent. If this behavior is inappropriate for your site, beginning with V8.7 it is possible to prevent this heuristic by specifying the F=d delivery agent flag (F=d).

Removing Focus

The final rule set 4 also removes angle ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required