Ryan,
> What is the code responsible for this message being output trying to
> communicate exactly?
>
> my(@b); @b = @{$r->banned_parts} if defined $r->banned_parts;
> my($b_chopped) = @b > 2; @b = (@b[0,1],'...') if $b_chopped;
> my($msg) = "BANNED, message contains " . (@b==1 ? 'part' : 'parts') .
> ": " . join(", ", @b) . ($b_chopped ? ", ..." : "");
> $msg =~ s/[ \t]{6,}/ ... /g;
> $hdr_edits->add_header('X-Amavis-Alert', $msg);
>
> I understand that this code is meant to alert users that a banned file was
> found in the email but every time I see this it ends up being simply
> "BANNED, message contains part". The logic in the string formation never
> amounts to anything beyond "part".
Strange. The $r->banned_parts was not supposed to be empty
when a decision to add X-Amavis-Alert header field is taken.
The purpose of $b_chopped is just to clip the list of
banned parts so that a message is not too long.
> What is @b and $b_chopped supposed to contain? The names of the banned
> attachments?
Yes. Actually attributes of banned parts (mime type, file(1) short type,
suggestend name).
This has changed somewhat in 2.6.2 - before troubleshooting further
you may want to see if 2.6.2 fixes the problem you are seing:
RELEASE_NOTES:
- macro F now only shows the first (if any) banned leaf part name,
preceded by comments from a banning rule regexp (if any), instead of
a list of multiple banned parts each with its full MIME/archive path.
Note that Perl syntax for a comment within a regexp is: (?# ... )
For example, given the following rule...
$banned_filename_re = new_RE(
qr'^\.(exe-ms|dll)$(?# rule #9)', # banned file(1) types
);
... a macro expansion of macros banning_rule_key, banning_rule_comment,
banning_rule_rhs, banned_parts and F will be:
banning_rule_key: (?-xism:^\\.(exe-ms|dll)$(?# rule #9))
banning_rule_comment: rule #9
banning_rule_rhs: 1
banned_parts:
multipart/mixed | application/octet-stream,.exe,.exe-ms,videos.exe
F: rule #9:application/octet-stream,.exe,.exe-ms,videos.exe
Likewise a SMTP response (with D_REJECT) would match a macro F as
before and would yield:
554 5.7.0 Reject, id=42721-01 - BANNED: rule #9:application/octet\
-stream,.exe,.exe-ms,videos.exe
A default administrator and recipient notification (still using a macro
F in their template), a main log entry, as well as a DSN and a rejection
message, will now be shorter and hopefully less confusing to an end user.
A full list of banned part paths (as previously produced by a macro F)
is now available under a new name as a macro 'banned_parts' and can be
used in custom templates to retain previous behaviour if desired.
Suggested by Andreas Schulze and Peer Heinlein;
Mark
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/