Re: [Mimedefang] return values

2017-10-06 Thread Michael Fox
> -Original Message-
> 
> I will fix the filter.
> 
> Regards,
> 
> Dianne.

Excellent.  Thanks.
Michael

___
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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] return values

2017-10-06 Thread Dianne Skoll
Hi,

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

The return value of filter and filter_multipart is ignored.
I sometimes write:

  return action_accept();

as shorthand for:

   action_accept();
   return;

> Issue 2:  bounce or discard, which is it?

Yeah, that makes no sense. :)

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

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

Replace return action_discard(); with return;

I will fix the filter.

Regards,

Dianne.
___
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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


[Mimedefang] return values

2017-10-06 Thread Michael Fox
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
/usr/share/doc/mimedefang/examples/suggested-minimum-filter-for-windows-clie
nts.gz.

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(_multipart)) {
push_status_tag("In filter_multipart routine");
filter_multipart($in, $fname, $extension, $type);
pop_status_tag();
}

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

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

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") {
md_graphdefang_log('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?  

Thanks,
Michael





___
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 MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang