Having had a dig through PerMsgStatus::get_raw_body_text_array(), it spots non-textual MIME sections and skips them.
Please could that be changed to a configuration option I can set a run-time when the object is created?
I know all the arguments about large memory footprints, etc, and am already limiting the size of the message which can be fed to SA in the first place. So I can work round all that stuff.
I really do need to be able to apply rules to the content of attachments (OpenOffice docs for example) where the attachments are not straight text but in a different format. I can get the rules to work, that's not the problem. It's just that I cannot tell SA to decode *everything* in the message (except possibly images, checking them against text rules is pretty meaningless).
Is this simple to write? Please could it be added to the next version?
(If anyone knows how to do this, I would be very grateful of a patch in the mean time).
Many thanks,
Jules.
It turned out to be pretty easy:
--- Conf.pm.orig 2003-04-01 01:28:13.000000000 +0100 +++ Conf.pm 2003-08-16 21:10:05.000000000 +0100 @@ -157,6 +157,7 @@ $self->{fold_headers} = 1; $self->{always_add_headers} = 1; $self->{always_add_report} = 0; + $self->{decode_attachments} = 0;
$self->{use_dcc} = 1; $self->{dcc_path} = undef; # Browse PATH @@ -1081,7 +1082,17 @@ $self->{spamtrap_template} = ''; next; }
-=item use_dcc ( 0 | 1 ) (default 1) +=item decode_attachments ( 0 | 1 ) (default 0) + +Whether to decode non-text attachments. + +=cut + + if (/^decode_attachments\s+(\d+)$/) { + $self->{decode_attachments} = $1; next; + } + +=item dcc_timeout n (default: 10)
Whether to use DCC, if it is available.
--- PerMsgStatus.pm.orig 2003-08-16 20:04:35.000000000 +0100 +++ PerMsgStatus.pm 2003-08-16 21:04:12.000000000 +0100 @@ -944,11 +944,14 @@
if (/^Content-Type: (\S+?\/\S+?)(?:\;|\s|$)/i) {
$ctype = $1;
- $ctypeistext = 1;
- if ($ctype =~ /^(text\/\S+|message\/\S+|multipart\/alternative)/i) {
- $ctypeistext = 1; next;
+ if ($self->{conf}->{decode_attachments}) {
+ $ctypeistext = 1;
} else {
- $ctypeistext = 0; next;
+ if ($ctype =~ /^(text\/\S+|message\/\S+|multipart\/alternative)/i) {
+ $ctypeistext = 1; next;
+ } else {
+ $ctypeistext = 0; next;
+ }
}
}
}
-- Julian Field Teaching Systems Manager [EMAIL PROTECTED] Dept. of Electronics & Computer Science Tel. 023 8059 2817 University of Southampton Southampton SO17 1BJ
------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk