Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Milter control based on rewrite rules?

6 views
Skip to first unread message

Andras Spitzer

unread,
Oct 27, 2003, 9:30:09 AM10/27/03
to
Hi!

Is it possible to skip the milter at the level of rewrite rules?
(AFAIK not at the moment) For example I do an ldap map lookup in the
rewrite rules and based on the result I want to skip the milter
inferface at this mail processing. For example at the end of the
rewrite rules when it returns the triple : $# mailer $@ host $: rcpt,
there should an optional fourth parameter for the milter control.
Maybe it's not a good idea because it would take more resources. Of
course this would be able to bypass only the milter check parts comes
after the rewrite rules.

Just to make it clear, for example I have my users in ldap and they
have a "virus-check" attribute which can have values "no" or "yes". I
can resolve this in the rewrite processing, and if the user has "no" I
would want to bypass the virusmilter.

Maybe it's not the problem of sendmail, and this should be implemented
in the milter itself?

Andras

Chris Adams

unread,
Oct 28, 2003, 5:40:22 PM10/28/03
to
Once upon a time, Andras Spitzer <sen...@swordsaint.net> said:
>Just to make it clear, for example I have my users in ldap and they
>have a "virus-check" attribute which can have values "no" or "yes". I
>can resolve this in the rewrite processing, and if the user has "no" I
>would want to bypass the virusmilter.

Pass a macro from sendmail to the milter, and have the milter stop
processing if the macro is set. For example, something like:

in your .mc file:
########################################################################
define(`confMILTER_MACROS_CONNECT',`{skip_check}');

LOCAL_RULESETS
SLocal_check_relay
# first clear the skip_check macro
R$* $: $(storage {skip_check} $) $1
# go do something to figure out what to do
# if we want to skip the check, then set the macro
R<SKIP> $* $: $(storage {skip_check} $@ skip $) $1

########################################################################

in your milter source code, in your xxfi_rcptto function:
########################################################################
if (smfi_getsymval (ctx, "{skip_check}") != NULL)
return SMFIS_ACCEPT;
########################################################################
--
Chris Adams <cma...@hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.

0 new messages