Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How many times is a rule in the LOCAL_RULE_0 called?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sciurus  
View profile  
 More options Sep 26 2008, 11:36 am
Newsgroups: comp.mail.sendmail
From: Sciurus <sciu...@mail.ru>
Date: Fri, 26 Sep 2008 08:36:48 -0700 (PDT)
Local: Fri, Sep 26 2008 11:36 am
Subject: How many times is a rule in the LOCAL_RULE_0 called?
I have added this rule in my sendmail.mc
LOCAL_RULE_0
R$*                             $: $(syslog syslog:LR0:0: $1 $) $1

I can see that my rule was called 4 times.

Sep 26 18:32:57 apache sendmail[28918]: m8QCWfUk028918:
syslog:LR0:0:smorrison<@aps1.net.>
Sep 26 18:32:57 apache sendmail[28918]: m8QCWfUk028918:
syslog:LR0:0:paradise<@anrb.ru.>
Sep 26 18:33:18 apache sendmail[28918]: m8QCWfUk028918:
from=<smorri...@aps1.net>, size=4205, class=0, nrcpts=1,
msgid=<000901c91fd5$06ea09ef$030c4180@qbsnu>, proto=ESMTP, daemon=MTA,
relay=[93.127.33.26]
Sep 26 18:33:18 apache sendmail[29383]: m8QCWfUk028918:
syslog:LR0:0:smorrison<@aps1.net.>
Sep 26 18:33:18 apache sendmail[29383]: m8QCWfUk028918:
syslog:LR0:0:paradise<@anrb.ru.>
Sep 26 18:33:19 apache sendmail[29383]: m8QCWfUk028918:
to=<parad...@anrb.ru>, delay=00:00:22, xdelay=00:00:01,
mailer=smtp, pri=124205, relay=mail.anrb.ru. [212.193.134.2],
dsn=2.0.0, stat=Sent (m8QCtfSn019896 Message accepted for delivery)

The first output is sender and the second output is recipient.
But after "from=" these records repeat themselves.
Id est LOCAL_RULE_0 rules are being executed twice firstly and twice
after.
Does it mean that any action in the LOCAL_RULE_0 will be executed 4
times?
For example, I make dnsbl-check in the LOCAL_RULE_0  to redirect spam
to some local user.
Do 4 identical dnsbl lookups happen for one mail?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrzej Adam Filip  
View profile  
 More options Sep 26 2008, 12:59 pm
Newsgroups: comp.mail.sendmail
From: Andrzej Adam Filip <a...@onet.eu>
Date: Fri, 26 Sep 2008 18:59:21 +0200
Local: Fri, Sep 26 2008 12:59 pm
Subject: Re: How many times is a rule in the LOCAL_RULE_0 called?

Sciurus <sciu...@mail.ru> wrote:
> I have added this rule in my sendmail.mc
> LOCAL_RULE_0
> R$*                             $: $(syslog syslog:LR0:0: $1 $) $1

> I can see that my rule was called 4 times.

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

> [...]
> 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".

> Do 4 identical dnsbl lookups happen for one mail?

--
[pl>en Andrew] Andrzej Adam Filip : a...@onet.eu : a...@xl.wp.pl
Ask not what's inside your head, but what your head's inside of.
  -- J. J. Gibson

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sciurus  
View profile  
 More options Sep 27 2008, 10:51 am
Newsgroups: comp.mail.sendmail
From: Sciurus <sciu...@mail.ru>
Date: Sat, 27 Sep 2008 07:51:21 -0700 (PDT)
Local: Sat, Sep 27 2008 10:51 am
Subject: Re: How many times is a rule in the LOCAL_RULE_0 called?

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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrzej Adam Filip  
View profile  
 More options Sep 28 2008, 5:08 pm
Newsgroups: comp.mail.sendmail
From: Andrzej Adam Filip <a...@onet.eu>
Date: Sun, 28 Sep 2008 23:08:31 +0200
Local: Sun, Sep 28 2008 5:08 pm
Subject: Re: How many times is a rule in the LOCAL_RULE_0 called?

I would suggest you to
a) ignore delivery mode.
b) check $&{opMode} to be sure the rule will not be called during
   rebuilding of alias database

If you are concerned about performance then you may store "per message"
result of dnsbl lookups in queue file. Use macro map to set value of
macro.

I think it is the right path to search for best solution for your problem.

--
[pl>en Andrew] Andrzej Adam Filip : a...@onet.eu : a...@xl.wp.pl
...there can be no public or private virtue unless the foundation of action is
the practice of truth.
  -- George Jacob Holyoake


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »