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