WebFaction
Community site: login faq

I have an oSTicket install that pulls all the incoming emails from a mailbox and turns them in to tickets. The mailbox gets A LOT of spam, and osTicket's "ban list" is practically a failure when it comes to real spam where the email address is made up, so I would like to use the Advanced Filtering (procmailrc) to add "[SPAM]" to the beginning of the subject, instead of redirecting it or moving it to a different mailbox, that way they all still get made in to tickets but it's much easier to see which ones to just immediately delete. From the documentation I found how to catch the spam, and from the internet I found a way to change the subject, but together it doesn't seem to work:

:0:
* ^X-Spam-Level: \*\*
|sed -e 's/^Subject:[ ]*/Subject: [SPAM?] /'

Suggests as to how to fix this would be greatly appreciated. Thanks!

asked 27 Mar '14, 21:35

Justin Hawkwood
1314
accept rate: 0%

edited 27 Mar '14, 21:36


The trick is to set a shell in your procmailrc, like this:

SHELL=/bin/bash
:0 fw
* ^X-Spam-Level: \*\*
|sed -e 's/^Subject:[ ]*/Subject: [SPAM?] /'

Hope that helps!

permanent link

answered 27 Mar '14, 21:39

seanf
12.2k42136
accept rate: 37%

Excellent! Thanks much.

(01 Apr '14, 19:48) Justin Hawkwood
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×34
×3

question asked: 27 Mar '14, 21:35

question was seen: 3,170 times

last updated: 01 Apr '14, 19:48

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM