next up previous contents
Next: Per-User Map Multiplexing Up: Multiplexing SMTP Previous: Splitting Incoming Email

   
Rule Based Multiplexing

It was initially thought that the best way to split email would be to make an arbitrary division in the address space for users and route mail based on this. For instance, if a system is set up where mail is split over two servers it could be determined that addresses beginning with the letters a-k have mail delivered to one server and mail for all other addresses is delivered to the other server. A is be programmed into the MTA to efficiently arbitrate mail between the two servers. Under sendmail1 a simple rule in the sendmail configuration file as follows would split mail as described.

Kalf regex -s1 -a<@alf.bigisp.com.> (^[a-k][^@]*)<@bigisp.com.>
Kbarney regex -s1 -a<@barney.bigisp.com.> (^[^a-k][^@]*)<@bigisp.com.>

These maps define how an address will be translated. The alf map looks for addresses that begin with a-k and are addressed to @bigisp.com. If this is found then then an address @alf.bigisp.com is returned. The barney map looks for addressed that do not begin with a-k and are addressed to @bigisp.com and returns and address @barney.bigisp.com To use regex maps you need either sendmail 8.8 patched with map-regex or sendmail 8.9. In either case you need to compile with DBMDEF= -DMAP_REGEX set in the Makefile [Krü].

These maps should be placed under the definition of Dn in sendmail.cf or under LOCAL_CONFIG in sendmail.mc the m4 preprocessor is used to generate you sendmail.cf. Now place the following under ruleset 98 in sendmail.cf or LOCAL_RULE_0 in sendmail.mc.

R$*                  $: $(alf $1 $)
R$*                  $: $(barney $1 $)
RERROR $*            $#error $: $1

The first line will apply the alf map which translates users beginning with the letters a-k. The second line translates all other users as defined by the barney map. The RERROR line causes the rules to abort it an error has been encountered. [All], [wEA97].


next up previous contents
Next: Per-User Map Multiplexing Up: Multiplexing SMTP Previous: Splitting Incoming Email
Horms
2000-11-17