I'm setting up Postfix 2.5.1, Dovecot 1.1.1 on FreeBSD 7 and will be using an external (commercial) spam filtering service that forwards the emails to my Postfix/Dovecot mailserver. I have the option to either keep the spam at the external service, or forward them to the local system. I'm thinking of bringing them local, and automatically placing them to spam folder (probably by using the Sieve plugin, but that's another issue). The external service tags the spam Subject lines with **SPAM**, and currently there is no option to change that to a header tag on their side. I would like to do that locally so that the Subjects of all of the spam messages in their spam boxes would not start with "**SPAM**".
So the question is: How do I detect "**SPAM**" on the subject line, remove it (i.e. rewrite the Subject line), and add something like "X-Spam: yes" into the header of the messages whose Subject includes "**SPAM**"? Thanks for any advise, insights on this! Ville