mail_host patch

Spike Ilacqua
Fri Jun 6 20:51:38 UTC 2003

> What happens if the envelope Mail_From value is not in the form
> or <> ?
> 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

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

# 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?

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


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dccm.c.patch2
URL: <>

More information about the DCC mailing list

Contact by mail or use the form.