[Mimedefang] Filtering on SMTP authentication but would like to check for virus

David F. Skoll dfs at roaringpenguin.com
Fri Mar 16 12:47:07 EDT 2012

On Fri, 16 Mar 2012 16:41:30 +0000
Andrew Watkins <andrew at dcs.bbk.ac.uk> 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



More information about the MIMEDefang mailing list