[comp.mail.sendmail] Patch to sendmail to give access to MX in rewrite rules

rickert@mp.cs.niu.edu (Neil Rickert) (05/28/91)

In article <1991May28.162345.6682@csv.viccol.edu.au> timcc@csv.viccol.edu.au (Tim Cook) writes:
>The following patches add the ability to look up MX records from the
>RHS of a rewrite rule, just like the current host and database lookup
>features.  The syntax is:
>
>   ${ host $: default $}

>As an example, this is something along the lines of what I use it for
>(in Rule 0):
>
>   R$*<@$*>$*			$:$1<@$2>${$2$:nomx$}/$3
>   R$*<@$*>nomx/$*		$#tcp$@$G$:$1<@$2>$3
>   R$*<@$*>$*/$*		$#tcp$@$2$:$1<@$2>$4
>
>The above example looks for an MX record for the specified host, and
>adds what it finds to what we have.  If it does not find any MX
>records, it adds the default, "nomx".  This symbolic value is then
>used to decide whether to pass the message in question to a host that
>might know more about hosts and networks that do not have MX records
>(this gateway host being "$G"), or instead to mail directly to the

  What is missing from your description is an explanation of what purpose,
if any, this new facility will serve.

  Consider:

	Many hosts which accept mail do not bother to have an MX record.

	The RFCs state clearly that if an A-record exists, and no MX record
	exists, the mailer should act as if there were an MX record pointing
	back to itself.

	The $[ .. $] will return an answer if their is either an MX record or
	an A record.

 The patch and your demonstration rules allow sendmail to behave differently
for a host with an A record but no MX record.  This seems to be wrong behavior
to apply on a general basis.  If might happen to be correct behavior for a
limited set of local hosts you are familiar with, but in that case the
MAILERTABLE facilities of the IDA setup can be used for the same purpose.

 You sample rules seem to do something very similar to the RELAY_MAILER
RELAY_HOST option in the IDA rulesets, except that they will unnecessarily
send to the relay all mail addressed to hosts with A records but no MX
records.

-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115                                   +1-815-753-6940