Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!mcvax!kth!draken!tut!santra!jtv From: jtv@kampi.hut.fi (Jukka Virtanen) Newsgroups: comp.mail.sendmail Subject: MX lookups inside sendmail.cf file for sendmail 5.61 with IDA patches Message-ID: Date: 31 Jul 89 09:25:31 GMT Sender: news@santra.UUCP Distribution: comp Organization: Helsinki University of Technology Lines: 37 Hello, Some time ago I modified my IDA patched sendmail 5.61 so that sendmail.cf rules can find out if a domain has an MX record. It can be used e.g. in ruleset 0 to find out if we can send the mail with smtp or if we need to do some other alternative approach. I defined new tokens ${ and $} to do MX lookup. They are used like the $[ NAME $: DEFAULT $] construct for hostname lookup. $: is an IDA enchancement for defaults in the lookups. # inside ruleset 0... # # Check if a domain has an MX record, and if so, send mail to the # domain the MX record points to with the original address as recipient # R$+<@$+> $: $1<@$2> ? ${ $2 $: $} Does domain have an MX? R$+<@$+>? $1<@$2> Nothing found, strip ? R$+<@$+>?$+ $#ether $@ $3 $: $1<@$2> Yes, send it with smtp # # otherwise do something else # If there is general interest, I might send diffs somewhere. Juki jtv@hut.fi -- *---------------------------------------------------------------------------* jtv@hut.fi Jukka Virtanen jtv@santra.UUCP (mcvax!santra!jtv) Helsinki University of Technology jtv@fingate.bitnet Computing Centre SF-02150, Espoo, FINLAND tel. +358 0 4514315