Email, Messaging, & Video Calls Email Make SpamAssassin Mark Spam in the Subject Change this one setting to customize the Subject of every spam email by Heinz Tschabitscher Writer A former freelance contributor who has reviewed hundreds of email programs and services since 1997. our editorial process Heinz Tschabitscher Updated on November 20, 2019 Justin Sullivan / Getty Images Email Yahoo! Mail Gmail Tweet Share Email SpamAssassin includes a file called local.cf that can be edited to show a particular word or phrase in the Subject line of any email marked as spam. It's a good idea to have a glaring word or phrase stamped on spam messages to make sure you don't open file attachments in those emails, which could end up being malware. It's also useful for easily identifying which emails you should delete, or at least watch out for. Another smart use of this setting is so that all spam messages will look identical in the Subject so that you can set up your email client to auto-delete spam based on Subject filters. How to Make SpamAssassin Mark Spam in the Subject Carefully follow these steps to customize SpamAssassin to put anything you want into the Subject of spam emails: With a text editor, open the local.cf file from the SpamAssassin installation folder. Depending on your version, it might be in /rules/ or /etc/mail/spamassassin/. Not sure what text editor to use? See our Best Free Text Editors list for our favorites. Locate the rewrite_header Subject *****SPAM***** line in the local.cf file. If you don't see this line, you're using an older version of SpamAssassin. Read the tip at the bottom of this page. Change *****SPAM***** to be however you want the Subject line to read for spam messages. Be sure to keep the rewrite_header Subject text unchanged. Here's one example of what you could do: rewrite_header Subject D Just to the left of this line is a # symbol. Delete it so that the word "rewrite" is butted up against the left margin. Doing this will remove the comment (#) and actually enable the new spam setting. Save and exit the local.cf file. Tips for Changing SpamAssassin Settings Here are some things to keep in mind when making this change to SpamAssassin's settings: If you don't see the rewrite-header line, it means that the version of SpamAsssassin you're using is not the most recent version. As you can read here, older versions use rewrite_subject 1 subject_tag instead. If your local.cf file uses that syntax, add rewrite_subject 1 to it. If your SpamAssassin preferences file already has rewrite_subject 0, just change it to include the "1" instead.Since your personal SpamAssassin configuration file (~/.spamassassin/user_prefs/) overrides all settings in local.cf, make sure "rewrite_subject" either is not in your personal configuration file or is set to "1", too.Don't forget to remove *****SPAM***** or your custom Subject text from the email if you end up replying to the spam message.