Skip to content

[BUG] False Positive for MIME_DOUBLE_BAD_EXTENSION with CSV Files #5312

Open
@robertzajda

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

  1. Compose an email with a .csv file attachment in an email client such as Thunderbird.
  2. Ensure the email client sets the MIME type of the attachment to:
Content-Type: text/csv; charset=UTF-8; name="filename.csv"
  1. Send the email through a mail server using rspamd for spam filtering.
  2. Observe that the email is flagged by rspamd with the MIME_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!

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions