On Wed, Jan 20, 2010 at 01:04:11PM -0500, Brian Evans - Postfix List 
  wrote:
> On 1/20/2010 12:49 PM, Aaron Clausen wrote:
> > Some anti-spam software that works with Exchange can deliver spam 
> > messages to a Spam folder in a user's mailbox.  Is there any 
> > facility in Postfix to allow that?
> >   
> Which mailbox folder mail is sent to is up to the delivery agent.
> 
> Postfix's built in agents, local(8) and virtual(8), are 
> intentionally simple and have no such feature.

It's easy to do with either, actually. Configure amavisd-new to tag
spam with "-spam", and in Postfix:

recipient_delimiter = -
mydestination = example.com [ ... ]
virtual_mailbox_domains = example.net [ ... ]

$ postmap -q u...@example.net maptype:/path/to/virtual_mailbox_maps
example.net/user/
$ postmap -q user-s...@example.net maptype:/path/to/virtual_mailbox_maps
example.net/user/.Spam/
$ cat ~user/.forward-spam
/home/user/Mail/.Spam/

SQL query tricks might be employed to automatically handle the case
of *-s...@example.net queries, if the chosen maptype is SQL. For a
hash: map, simply script the duplication of regular user entries;
also add the -spam case to your new user creation routine.

Note, examples in documentation of both Postfix and amavisd-new show
the use of "+" as recipient_delimiter. For reasons which have been
discussed on this list, the hyphen "-" is probably better in most
cases. Underscore "_" and dot "." are also good choices.
-- 
    Offlist mail to this address is discarded unless
    "/dev/rob0" or "not-spam" is in Subject: header

Reply via email to