[Mimedefang] Blacklist_to or spam trap?
Stefano McGhee
SMcGhee at ARCweb.com
Wed Jan 15 16:42:02 EST 2003
Jim,
That IS an interesting solution and I see how it could be more
efficient. However, I recently started using stream_by_recipient to allow
some users to "opt-out" of SA filtering. That is, of course, called in
filter_begin. Your solution involves a change to filter_recipient. (I
imagine that would involve adding a switch to the init script for MD as
well as defining a filter_recipient function in my mimedefang-filter file.)
I was worried about the filter recipient taking place too late, but
according to the fabulous comments provided at the I top of the filter
file, I see that filter_recipient is called ahead of filter_begin. This
would seem to work. I'll give it a try. Thanks for the code sample. I'll
look it over and test it. BTW, isn't the 0 deprecated? :-)
return (0, "Invalid recipient in envelope")
Is it now
return (REJECT, "Invalid recipient in envelope")
Thanks a lot,
Stefano
> Putting this check in as part of SpamAssassin means the
> whole message
> has to be read and processed because of a bad recipient. I
> would think a
> better place to check for this would be in filter_recipient,
> so that you
> can reject it earlier in the session. This is untested, but
> it should do
> what you want:
>
> @FormerEmployees = qw(user1 user2 user3 user4 user5 user6
> user7 user8);
> filter_recipient {
> my ($recipient, $sender, $ip, $hostname, $first, $helo) = @_;
> foreach $baduser (@FormerEmployees) {
> if ($recipient =~ /^$baduser\@/) {
> return (0, "Invalid recipient in envelope")
> }
> }
> }
>
> HTH...
>
> Jim
> *-------------------------------------------------------------
> ------------*
> * James H. McCullars I Phone: (256) 824-2610
> *
> * Director of Systems & Operations I Fax: (256) 824-6643
> *
> * Computer & Network Services I Internet:
> mccullj at email.uah.edu *
> * The University of Alabama I
> -----------------------------------*
> * in Huntsville I
> *
> * Huntsville, AL 35899 I This space for rent -
> CHEAP! *
> *-------------------------------------------------------------
> ------------*
>
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>
More information about the MIMEDefang
mailing list