[Mimedefang] Bug in filter_end() handling?

Philip Prindeville philipp_subx at redfish-solutions.com
Tue Dec 11 13:43:39 EST 2012


I'm looking at do_scan() and in particular:

    if (defined(&filter_begin)) {
        push_status_tag("In filter_begin");
        filter_begin($entity);
        pop_status_tag();
        # If stream_by_domain tells us to discard, do so...
        if ($TerminateAndDiscard) {
            write_result_line("D", "");
            signal_unchanged();
            md_syslog('debug', "filter_begin set TerminateAndDiscard flag.  Don't panic; it's most likely a message being streamed.");
            signal_complete();
            return;
        }
    }

and noticing that there's no matching check for $TerminateAndDiscard  after calling filter_end():

    # Call post-scan filter if defined
    if (defined(&filter_end)) {
        $InFilterEnd = 1;
        push_status_tag("In filter_end");
        filter_end($rebuilt);
        pop_status_tag();
        $InFilterEnd = 0;
    }


It might not be optimal to wait until filter_end() to call stream_by_recipients(), but I'm not sure there's a technical reason why it can't be done other than lost efficiency.

Am I missing anything?

-Philip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20121211/b9ac5368/attachment.html>


More information about the MIMEDefang mailing list