[Mimedefang] return values

Michael Fox news at mefox.org
Fri Oct 6 12:28:32 EDT 2017

Perhaps another couple of newbie questions.  But I'm having some difficulty
understanding the return actions from filter() and filter_multipart() as
they appear in the example

Issue 1:  filter and filter_multipart:  return value or not?

/usr/bin/mimedefang.pl does not seem to expect a return value from either
filter() or filter_multipart().

        if (defined(&filter_multipart)) {
            push_status_tag("In filter_multipart routine");
            filter_multipart($in, $fname, $extension, $type);

        if (defined(&filter)) {
            push_status_tag("In filter routine");
            filter($in, $fname, $extension, $type);

. yet in the example "suggested-minimum-filter.", sometimes they return
nothing and sometimes they return a true/false value returned from another

    Returns nothing:
        return if message_rejected(); # Avoid unnecessary work

    Returns result of another function:
        return action_accept();

Shouldn't filter() and filter_multipart() simply use "return;" (with no
return value)?  If not, please help me understand.

Issue 2:  bounce or discard, which is it?

In the "suggested-minimum-filter." filter function, there is this:

    # Block message/partial parts
    if (lc($type) eq "message/partial") {
        action_bounce("MIME type message/partial not accepted here");
        return action_discard();

I'm confused by the "return action_discard()".  How can it be both bounced
AND discarded?  


More information about the MIMEDefang mailing list