# Postfix + amavisd + spamassassin help

## petrjanda

Hi,

Ive got virtual users in ldap and use the above mentioned combo to filter spam, and it works fine. I just need to move spam marked SPAM into a folder called Junk.

My current config does this:

1) Postfix receives mail

2) Postfix sends to to amavis on port 10024

3) Amavis returns mail to Postfix on port 10025

4) And Postfix delivers it to /usr/local/virtual/user@domain.com/Maildir

I need every email that has a header: X-Spam-Flag: YES

to go to a Junk folder instead of the Maildir/new

----------

## audiodef

See the postfix link in my sig. cach0rr0 is very knowledgeable about such things. See also this thread: https://forums.gentoo.org/viewtopic-t-872027-highlight-.html?sid=82817b8a932f00e19fbebb1ab605496f

----------

## cach0rr0

have you considered setting up sieve rules within your IMAP server? (if it supports sieve?)

Probably the best route; set up a global set of sieve rules that move the message automagically. I use Cyrus, which does support sieve without issue - whether this is simple for you to do depends on the server you chose. 

You may also be able to do something like this via procmail, though i dont and havent used it in...god, enough years that I feel old. 

Doing this with amavisd-new is possible, but a bit kludgy

http://www.ijs.si/software/amavisd/amavisd-new-docs.html#quarantine

*normally* with amavis, one has a shared quarantine folder for every user, but with a bit of trickery you can provide per-user quarantine.

It's really a bit "cleaner" to do it on the IMAP side - so to that end, it'd be useful to know what IMAP server you've chosen

----------

## petrjanda

Yes I managed to set it up. Changed to Dovecot-LDA (was using just virtual postfix local delivery agent) an setup global sieve rules.

----------

