3 rewrite \- mail rewrite rules
8 uses rewrite rules to convert mail destinations into
9 commands used to dispose of the mail.
13 Blank lines and lines beginning with
17 Each rewriting rule consists of (up to) 4 strings:
21 A regular expression in the style of
25 is applied to mail destination addresses.
26 The pattern match is case-insensitive
27 and must match the entire address.
30 The type of rule; see below.
35 style replacement string, with
37 standing for the text matched by the
39 parenthesized subpattern.
44 style replacement string.
47 In each of these fields the substring
49 is replaced by the login id of the
50 sender and the substring
52 is replaced by the name of the local machine.
54 When delivering a message,
56 starts with the first rule and continues down the list until a pattern
57 matches the destination address.
58 It then performs one of the following actions depending on the
64 Append the mail to the file indicated by expanding
66 provided that file appears to be a valid mailbox.
69 Pipe the mail through the command formed from concatenating the
76 Replace the address by the address(es) specified
82 Replace the address by the address(es) output by the
83 command formed by expanding
89 expands the addresses recursively until each address has matched a
93 rule or until the recursion depth indicates a rewriting loop
99 is called with more than one address and
100 several addresses match
102 rules and result in the same
105 the message is delivered to all those addresses
107 composed by concatenating the common expanded
111 This mail bundling is performed to reduce the number
112 of times the same message is transmitted across a
113 network. For example, with the following
117 ([^!]*\.bell-labs\.com)!(.*) | "/mail/lib/qmail '\es' 'net!\e1'" "'\e2'"
125 % mail plan9.bell-labs.com!ken plan9.bell-labs.com!rob
128 there will follow only one execution of the command
131 /mail/lib/qmail presotto net!plan9.bell-labs.com ken rob
138 script used for locally queuing remote mail.
140 In the event of an error, the disposition of the mail depends on the name of the
141 command executing the rewrite. If the command is called
145 the command will print an error and deposit the message in
146 .BR /mail/box/$user/dead.letter .
147 If the command is called
149 usually because it was invoked to deliver mail arriving over the network,
150 the message will be returned to the sender. The returned message will
151 appear to have been sent by user