sendmail, 4th Edition

$+

Match one or more tokens LHS operator

The $+ operator is very handy when you need to match at least one token in the workspace. For example, recall that the host part of an address containing zero tokens is bad, but one containing one or more tokens is good:

 george@   zero tokens is bad  george@wash   one token is good  george@wash.dc.gov   many tokens is good  

A rule that seeks to match the host part of an address might look like this:

 R $- @ $+            $:  < @  > 

Here, the LHS matches any complete addressthat is, an address that contains a user part that is a single token (such as george ), an @ character, and a host part that is one or more tokens (such as wash or wash.dc.gov ). [15] Any address that matches is rewritten by the RHS to focus on the host part. Focusing an address means to surround the host part in angle braces. Thus, for example, george@wash will become george<@wash >.

[15] Note that this simple example will not match more complex user parts , such as george+nospam or bob.smith . Examine the sendmail.cf file to see how more complex user parts can be handled.

Note that the $+ operator can be used only on the LHS of rules, and can be referenced by a $ digit operator on the RHS.



Sendmail
sendmail, 4th Edition
ISBN: 0596510292
EAN: 2147483647
Year: 2002
Pages: 1174

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net