[Mimedefang] mimedefang specific users
alan premselaar
alien at 12inch.com
Mon Jun 2 22:22:01 EDT 2003
On 6/3/03 3:47 AM, "B. Tolka" <btolka at hsc.wvu.edu> wrote:
[...]
>
> The function code is:
>
> sub stream_by_receipient () {
^^^ i'm hoping this is just a typo in your mail ...
> my(@on_list, @off_list, $recip);
> foreach $recip (@Recipients) {
> if (should_check_for_spam($recip)) {
> push(@off_list, $recip);
> } else {
> push(@on_list, $recip);
> }
> }
>
> if ($#on_list >= 0 && $#off_list >= 0) {
> # Some on, some off -- remail
> resend_message(@on_list);
> resend_message(@off_list);
> $TerminateAndDiscard = 1;
> return 1;
> }
> return 0;
> }
>
>
> Any help is appreciated
If I'm reading this correctly, it looks like you could accomplish what you
have in your code more simply by doing:
sub stream_by_recipient {
if ($#Recipients) {
resend_message(@Recipients);
$TerminateAndDiscard = 1;
return 1;
}
return 0;
}
since @on_list and @off_list are scoped inside of the stream_by_recipient
subroutine, there doesn't appear to be any way for resend_message to know if
it's sending to the on_list or the off_list. it's just taking a list of
recipients and resending the message to them.
there also doesn't appear to be any code to control a call to
check_spamassassin (i don't recall the exact subroutine name off the top of
my head) based on being on_list or off_list either.
based on your snipet of code, i can only assume that should_check_for_spam()
simply reads a list of users that have "opted in" for spam checking from a
file or database somewhere.
so, it looks like you need to rethink your logic a little bit. I don't do
anything with streaming by recipient in my setup, so i don't have any
specific knowledge about how to implement what you want to do, but i'll
offer any help i can.
hope this is useful information.
alan
More information about the MIMEDefang
mailing list