mail_host patch

Spike Ilacqua spike@indra.com
Fri Jun 6 20:51:38 UTC 2003


> What happens if the envelope Mail_From value is not in the form
> user@example.com or <user@example.com> ?
> I think the patch covers the <> possibility, but what about source
> routes, the % kludge, ! paths, and who knows what else?

Yes, "<>" is already handled, mail_host is not set, which is what
sendmail does as well.

Source routing needed addressing, and I've done so with this new patch.

There really arn't any other cases.  As I read the RFCs, the address
given with MAIL FROM *must* end in "@host.dom".  Any "!"s or "%" would
be on the left side of the address, and would be ignored by both my code
and by sendmail when setting "{mail_host}", since "{mail_host}" is the
*SMTP* server sendmail would send a bounce to.

Now it's not impossible to do some parsing in the cf and set your own
variable.  I haven't tested this, but the general gist would be

define(`confMILTER_MACROS_ENVFROM',confMILTER_MACROS_ENVFROM``, {from_host}, {dcc_isspam}, {dcc_notspam}'')dnl

LOCAL_CONFIG
# used to create macros to send to milter interface
Kstorage macro

LOCAL_RULESETS
SLocal_check_mail
# clear the storage
R$*			$: $(storage {from_host} $) $1
# Canonify the address
R$*                             $: $>canonify $1
# Store the host name in {from_host}
R$+ < @ $* . > $*		$: $(storage {from_host} $@ $2 $)

But this still begs the question of what mail_host should be.  What
would you expect in the case of?

foo%bar.com@baz.com
bar!foo@baz.com
@baz.com:foo@bar.com

I *belive* that in all three cases sendmail will set "{mail_host}" to
"baz.com", as my code will.  Canonify however will give you "bar.com" in
the last case.  Obviously the ruleset could be writen to give you just
about any result.

->Spike

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dccm.c.patch2
URL: <http://www.rhyolite.com/pipermail/dcc/attachments/20030606/60a28516/attachment.ksh>


More information about the DCC mailing list

Contact vjs@rhyolite.com by mail or use the form.