> Use the modification below to see the difference between the calls:
> LOCAL_RULE_0
> R$* $: $(syslog syslog:LR0:0:&${addr_type}: $1 $) $1
> e s => enveloper sender
> e r => envelope recipient
> h => header recipient address or header sender address
1. Thank you very much for this tip. I failed to take it into account.
But now I get dnsbl-check twice.
The first check is doing before string "from=" and the second check is
doing after "from="
I added $&{DeliveryMode} and noticed that it's value equals "b" in
the first case and "i" in the second case:
Sep 27 18:43:46 apache sendmail[23513]: m8RChhGE023513: syslog:
01:jjkhhandyandy<@halifax.com.hk.>\233<e.s>\233<b>
Sep 27 18:43:46 apache sendmail[23513]: m8RChhGE023513: syslog:
01:paradise<@anrb.ru.>\233<e.r>\233<b>
Sep 27 18:43:47 apache sendmail[23513]: m8RChhGE023513:
from=<jjkhhandya...@halifax.com.hk>, size=650, class=0,
nrcpts=1,msgid=<000401c920a0$0703c717$78d91499@cubfskjp>, proto=ESMTP,
daemon=MTA,
relay=pool-72-87-102-181.prvdri.east.verizon.net[72.87.102.181]
Sep 27 18:43:47 apache sendmail[23536]: m8RChhGE023513: syslog:
01:jjkhhandyandy<@halifax.com.hk.>\233<e.s>\233<i>
Sep 27 18:43:47 apache sendmail[23536]: m8RChhGE023513: syslog:
01:paradise<@anrb.ru.>\233<e.r>\233<i>
Sep 27 18:43:47 apache sendmail[23536]: m8RChhGE023513:
to=<parad...@anrb.ru>, delay=00:00:01, delay=00:00:00,
mailer=local, pri=120650, dsn=2.0.0, stat=Sent
So to get only one dnsbl-check I use the following now:
R$* $: $1 $| <$&{addr_type}> $| <$&{deliveryMode}>
R$* $| <e r> $| <i> $: $1 $| $>Dnsbl_Check
R$* $| <$*> $| <$*> $: $1
Is it correct to use <$&{deliveryMode}> at this point ?
> > Does it mean that any action in the LOCAL_RULE_0 will be executed 4
> > times?
> Or more :-) [multiple enveloper recipients, multiple addresses in headers]
> > For example, I make dnsbl-check in the LOCAL_RULE_0 to redirect spam
> > to some local user.
> Limit the redirecting code only to situation where &${addr_type} is
> equal "e r".
2. The second question is about multiple recipients.
As you said in that case LOCAL_RULE_0 will be executed several times
so I shall get several dnsbl-lookups.
To prevent this I tryed to use "e s" instead of "e r" but without
success.
I add new macros to save result of dnsbl-lookup and for second,
third,etc recipients I check only $&{Spamcop_lookup}
D{Spamcop_lookup}0
R$* $: $&{Spamcop_lookup}
R0 $: 0 $| $&{client_addr}
R0 $| $-.$-.$-.$- $: 0 $| <$(dnsbl $4.$3.$2.$1.bl.spamcop.net.
$: OK $)>
R0 $| $* $: $(storage {Spamcop_lookup} $@ $1 $) $1
It works and now I get only one dnsbl-lookup.
But may be there is more correct way to do it?