I just downloaded the current development release, 3.1.6, and saw that
my patch for whitelisting with access.db didnt make it into it. In my
original posting when i announced the patch i forgot to actually
attach it and posted it in a second mail, but this seems to have been
overlooked. So here it conmes again:
Bye,
Georg
--cut---
diff -r -u milter-greylist-3.0.org/README milter-greylist-3.0/README
--- milter-greylist-3.0.org/README 2006-10-06 11:14:39.000000000 +0200
+++ milter-greylist-3.0/README 2007-02-28 16:05:31.000000000 +0100
@@ -105,6 +105,15 @@
when the {greylist} macro is defined and set as WHITE.
O Milter.macros.envrcpt={greylist}
+When using access DB as a whitelisting source, you will also need some
+rules for the ruleset "Local_check_rcpt" which assign a value to the
+macro {greylist}.
+Kstorage macro
+SLocal_check_rcpt
+R$+ $: $(storage {greylist} $) $&{client_addr}
+R$+ $: $>A <$1> <?> <+Connect> <$1>
+R<$+> <$*> $: $(storage {greylist} $@ $1 $) $2
+
Alternatively, you can use the following m4 macro definitions
if you build sendmail.cf with m4 (contributed by Hubert Ulliac).
Here again, confMILTER_MACROS_* are shared with other milters,
@@ -124,6 +133,18 @@
milter-greylist instead of overwriting what has already been done. This
should simplify an automatic generation of sendmail.cf.
+To add the rules for defining the {greylist} macro via m4, add the following
+lines to your m4 input file:
+
+LOCAL_CONFIG
+Kstorage macro
+LOCAL_RULESETS
+SLocal_check_rcpt
+R$+ $: $(storage {greylist} $) $&{client_addr}
+R$+ $: $>A <$1> <?> <+Connect> <$1>
+R<$+> <$*> $: $(storage {greylist} $@ $1 $) $2
+
+Note that there must be tabs and no spaces before the "$:"!
3 Configuring milter-greylist
diff -r -u milter-greylist-3.0.org/milter-greylist.c milter-greylist-3.0/milter-greylist.c
--- milter-greylist-3.0.org/milter-greylist.c 2007-02-28 12:24:35.000000000 +0100
+++ milter-greylist-3.0/milter-greylist.c 2007-02-28 15:52:23.000000000 +0100
@@ -348,11 +348,13 @@
/*
* If sendmail rules have defined a ${greylist} macro
- * with value WHITE, then it is whitelisted
+ * with value WHITE (or RELAY or OK), then it is whitelisted
*/
if ((conf.c_noaccessdb == 0) &&
((greylist = smfi_getsymval(ctx, "{greylist}")) != NULL) &&
- (strcmp(greylist, "WHITE") == 0)) {
+ ((strcmp(greylist, "WHITE") == 0) ||
+ (strcmp(greylist, "RELAY") == 0) ||
+ (strcmp(greylist, "OK") == 0))) {
mg_log(LOG_DEBUG,
"whitelisted by {greylist}");
priv->priv_elapsed = 0;
--cut---