Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to add a spamassassin rule based on if a message coming from a particular sender has an attachment or not. Is there a way to filter messages from a certain sender so that mails without attachment get a low score but mails with attachments get labeled as spam ?

share|improve this question

Maybe check if the string 'Content-Disposition: attachment;' is found somewhere in the mail.

Check the Mail::SpamAssassin::Plugin::MIMEEval plugin. You can maybe force the score when __MIME_BASE64 is matched. Look at

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.