David,
You are right about the global variable, should have read the section
more thoroughly.
Cheers the code sample works like a charm.
Thanks
Andrew
On 03/16/12 16:47, David F. Skoll wrote:
On Fri, 16 Mar 2012 16:41:30 +0000
Andrew Watkins<[email protected]> wrote:
But the problem is that you should only use the read_commands_file()
in filter_sender() or filter_recipient().
That's a problem?
I just wanted to avoid a global variable.
You don't need a global variable. Setting a global variable in
filter_sender wouldn't work anyway; read the mimedefang-filter(5) man page
carefully, especially the GLOBAL VARIABLE LIFETIME section.
Instead, do something like:
sub filter_begin {
my ($entity) = @_;
my $authenticated = ($SendmailMacros{'auth_type'}&&
$SendmailMacros{'auth_authen'});
# Do virus scanning here
if (!$authenticated) {
# Do spam-scanning here
}
}
Regards,
David.
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID. You may ignore it.
Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
--
Andrew Watkins * Birkbeck College
http://notallmicrosoft.blogspot.com/
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID. You may ignore it.
Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang