Michael Fox
2017-10-06 16:28:32 UTC
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(&filter_multipart)) {
push_status_tag("In filter_multipart routine");
filter_multipart($in, $fname, $extension, $type);
pop_status_tag();
}
if (defined(&filter)) {
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 ***@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listi
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(&filter_multipart)) {
push_status_tag("In filter_multipart routine");
filter_multipart($in, $fname, $extension, $type);
pop_status_tag();
}
if (defined(&filter)) {
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 ***@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listi