-
-
Notifications
You must be signed in to change notification settings - Fork 3
rewriting.5
rewriting - syntactic changes to mail-address host names
new-inject and ofmipd support a generic rewriting system for Internet mail addresses. Each host name is transformed according to a series of instructions, as described here. The instructions are followed in order, each at most once.
An instruction is either =post:new, *post:new, ?post:new, or -post:new. =post:new means that the host name post is replaced by new. *post:new means that any host name of the form prepost is replaced by prenew. ?post:new means that any host name of the form prepost, where pre does not contain dots or brackets, is replaced by prenew. -post:new means that any host name of the form prepost is replaced by new.
For example, the instruction *.: removes a trailing dot if there is one; =:vangogh converts an empty host name into vangogh; ?:.cs.b adds .cs.b to any host name without dots or brackets; *.b:.berkeley.edu changes vangogh.cs.b into vangogh.cs.berkeley.edu; -.local:cs.berkeley.edu converts me.local**** into cs.berkeley.edu.
Rewriting instructions are normally listed in the rewrite control file, one instruction per line.
If rewrite does not exist, new-inject and ofmipd use the control files defaultdomain, defaulthost, and plusdomain in the following instructions:
*.:
=:defaulthost
*+:.plusdomain
?:.defaultdomain
In other words: (1) If the host name ends with a dot, remove the dot. (2) If the host name is empty, add defaulthost. (3) If the host name ends with a plus sign, change the plus sign to a dot and add plusdomain. (4) If the host name does not contain dots or brackets, add a dot and add defaultdomain.
The defaultdomain, defaulthost, and plusdomain control files can be overridden by the environment variables $QMAILDEFAULTDOMAIN, $QMAILDEFAULTHOST, and $QMAILPLUSDOMAIN respectively. They all default to me.
new-inject(1), rewritehost(3), indimail-control(5), ofmipd(8),