I have a postfix server running amavis and SpamAssassin to help filter spam. Messages that are detected as spam look like this when delivered into the user's Maildir:
From tom@tom-mint Fri Mar 15 01:46:20 2013 Return-Path: <tom@tom-mint> X-Original-To: firstname.lastname@example.org Delivered-To: email@example.com X-Virus-Scanned: Debian amavisd-new at my-server.com X-Spam-Flag: YES X-Spam-Score: 6.463 X-Spam-Level: ****** X-Spam-Status: Yes, score=6.463 tagged_above=2 required=6.31 tests=[DRUGS_ERECTILE=2.221, FH_FROMEML_NOTLD=0.18, FSL_HELO_NON_FQDN_1=0.001, HELO_NO_DOMAIN=0.001, RCVD_IN_PBL=3.558, RDNS_DYNAMIC=0.363, TO_NO_BRKTS_DYNIP=0.139] autolearn=no Date: Fri, 15 Mar 2013 01:46:19 -0400 To: firstname.lastname@example.org Subject: ***SPAM*** hello User-Agent: Heirloom mailx 12.5 6/20/10 Content-Type: text/plain; charset=us-ascii From: tom@tom-mint (Tom) Status: RO buy some viagra!
Note specifically the subject, which is prepended with
***SPAM***, and the
X-Spam-Flag: YES header.
What's the best way to configure
postfix to store these messages in a special junk folder?
From my research, it seems like I will need to use a different mail delivery tool than postfix to accomplish this, but I am not sure what approach is the best. There seems to be a lot of dated information, and I am wondering whether postfix is capable of placing messages into a folder or not.
The mail directories are all Maildir.