Bug 7952 - Add rule types for text body and HTML body separately
Summary: Add rule types for text body and HTML body separately
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC Windows XP
: P2 enhancement
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-09 17:42 UTC by Loren Wilton
Modified: 2022-02-09 17:42 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Loren Wilton 2022-02-09 17:42:59 UTC
At times it would be desirable to have rules that only scanned the text/plain or only the text/html parts of a message, and not both combined as I believe 'body' and 'rawbody' rules currently do.

It would be desirable to have both cooked and raw forms of these rule types, corresponding to 'body' and 'rawbody'. In particular it would be desirable to have a rule type that can look at the raw HTML formatting/text as it exists in the mail message.

This could be done either as new entity names like 'textbody', 'rawtextbody', 'htmlbody', etc., or could be done by adding modifiers like 'body:text' and 'rawbody:html'. Personally I'd prefer the explicitness of the first option, but I would expect either to perform the same functionality.

One possible use of such a rule would be looking for anything after </html> in the HTML part of the message. Note that the current chunking implementation of the body rules could get in the way of this working reliably in all cases. While technically a separate subject, it might be worth reviewing and possibly eliminating the chunking done on the body rules in conjunction with adding the new rule types. That was created when processors were a good deal slower than currently, and it has been noted many times in the past that this can make otherwise good rules less effective than they could be.