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

[courier-users] rctpfilter

0 views
Skip to first unread message

Jeff Jansen

unread,
Dec 16, 2009, 10:05:04 AM12/16/09
to
I have a user who wants to block *a lot* of addresses. I was going to put them
all into a rcptfilter.

Does anyone know in terms of execution speed whether it's better to '||' all the
addresses together as one big "if" statement, or to list each address as its own
"if"?

if (("$SENDER" eq "a...@a.com") || ("$SENDER" eq "b...@b.com") || ... )
...

verses

if ("$SENDER" eq "a...@a.com")
...
if ("$SENDER" eq "b...@b.com")
...

TIA

Jeff Jansen

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
courier-users mailing list
courie...@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Sam Varshavchik

unread,
Dec 16, 2009, 5:51:51 PM12/16/09
to
Jeff Jansen writes:

> I have a user who wants to block *a lot* of addresses. I was going to put them
> all into a rcptfilter.
>
> Does anyone know in terms of execution speed whether it's better to '||' all the
> addresses together as one big "if" statement, or to list each address as its own
> "if"?
>
> if (("$SENDER" eq "a...@a.com") || ("$SENDER" eq "b...@b.com") || ... )
> ...
>
> verses
>
> if ("$SENDER" eq "a...@a.com")
> ...
> if ("$SENDER" eq "b...@b.com")
> ...

There would be no measurable difference to logically-equivalent code. Also,
the lookup() function will be logically equivalent. Using lookup() may be
marginally faster if there are common addresses that are frequently blocked,
and they are listed first.


0 new messages