[BUG] False Positive for MIME_DOUBLE_BAD_EXTENSION with CSV Files #5312
Description
Summary
The MIME_DOUBLE_BAD_EXTENSION
rule incorrectly flags emails with .csv
attachments when the MIME type is text/csv
. This results in false positives and unnecessary spam scoring for legitimate emails.
Steps to Reproduce
- Compose an email with a
.csv
file attachment in an email client such as Thunderbird. - Ensure the email client sets the MIME type of the attachment to:
Content-Type: text/csv; charset=UTF-8; name="filename.csv"
- Send the email through a mail server using
rspamd
for spam filtering. - Observe that the email is flagged by
rspamd
with theMIME_DOUBLE_BAD_EXTENSION
rule.
Expected Behavior
Emails with properly defined MIME types such as text/csv
for .csv
files should not be flagged as having a "bad extension." The rule should correctly associate text/csv
with .csv
files as a valid combination.
Observed Behavior
The MIME_DOUBLE_BAD_EXTENSION
rule is triggered, and the email is scored as potential spam. This occurs despite the MIME type being correctly defined as text/csv
for a .csv
file.
Impact
- Legitimate emails with
.csv
attachments are unnecessarily penalized, increasing the likelihood of being marked as spam. - It creates additional overhead for system administrators to whitelist or adjust scoring manually for valid MIME types.
Proposed Solution
- Update the MIME type handling rules to recognize
text/csv
as a valid MIME type for.csv
file extensions. - Ensure
MIME_DOUBLE_BAD_EXTENSION
is not triggered for valid MIME-extension combinations.
Environment
- rspamd version: [Provide your rspamd version here]
- OS: [Provide your OS version here]
- Configuration changes: None specific to MIME or
.csv
handling.
Additional Notes
If further details or testing are required, feel free to contact me. This issue could potentially impact many users relying on standard MIME configurations from popular email clients.
Thank you for addressing this!