LOCAL_RULE_1 and LOCAL_RULE_2 Ruleset 1 is applied to
LOCAL_RULE_1 and LOCAL_RULE_2 Ruleset 1 is applied to all sender addresses and Ruleset 2 is applied to all recipient addresses. They are both usually empty. Interpreting the rule in our example Our sample in Example 18-3 uses the LOCAL_NET_CONFIG macro to declare a local rule that ensures that any mail within our domain is delivered directly using the smtp mailer. Now that we’ve looked at how rewrite rules are constructed, we will be able to understand how this rule works. Let’s take another look at it. Example 18-3. Rewrite Rule from vstout.uucpsmtp.m4 LOCAL_NET_CONFIG # This rule ensures that all local mail is delivered using the # smtp transport, everything else will go via the smart host. R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 We know that the LOCAL_NET_CONFIG macro will cause the rule to be inserted somewhere near the end of ruleset 0, but before any smart host definition. We also know that ruleset 0 is the last ruleset to be executed and that it should resolve to a three-tuple specifying the mailer, user, and host. We can ignore the two comment lines; they don’t do anything useful. The rule itself is the line beginning with R. We know that the R is a sendmail command and that it adds this rule to the current ruleset, in this case ruleset 0. Let’s look at the lefthand side and the righthand side in turn. The lefthand side looks like: $* < @ $* .$m. > $*. Ruleset 0 expects < and > characters because it is fed by ruleset 3. Ruleset 3 converts addresses into a common form and to make parsing easier, it also places the host part of the mail address inside <>s. This rule matches any mail address that looks like: ‘DestUser < @ somehost.ourdomain. > Some Text’. That is, it matches mail for any user at any host within our domain. You will remember that the text matched by metasymbols on the lefthand side of a rewrite rule is assigned to macro definitions for use on the righthand side. In our example, the first $* matches all text from the start of the address until the < character. All of this text is assigned to $1 for use on the righthand side. Similarly the second $* in our rewrite rule is assigned to $2, and the last is assigned to $3.00 We now have enough to understand the lefthand side. This rule matches mail for any user at any host within our domain. It assigns the username to $1, the hostname to $2, and any trailing text to $3. The righthand side is then invoked to process these. Let's now look at what we're expecting to see outputed. The righthand side of our example rewrite rule looks like: $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3. When the righthand side of our ruleset is processed, each of the metasymbols are interpreted and relevant substitutions are made.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Linux Web Hosting services