amavis wrote:

> Hi,

> How do I direct all mails tagged as say "SPAM" to a separate mailbox  
> for a particular domain.

> The destination mailbox is on a separate server.
> Please help.
> Thank you.
> -Sysadmin

I will assume you are using the default 'local' quarantine method.
Let's also assume you are currently quarantining to a mailbox:
$spam_quarantine_to = '[EMAIL PROTECTED]';
Mail that scores at $sa_kill_level_deflt will be quarantined there.
There is a problem with this. I will quote Mark from previous posts:

####################################################################
If the intention is for the 'quarantined' mail to be directly viewable
by original recipients without pre-processing, then the quarantining
mechanism is not the right way. Quarantining stores one copy per message,
not one per recipient, which looses personalized header fields inserted,
and reveals all original envelope recipients, violating sender's privacy.
Releasing from a quarantine or viewing quarantined mail by users
requires some pre-processing, like hiding X-Envelope-To.

The correct solution lies in adding address extensions as a way
to tag spam (at tag2 level), ensure the mail is delivered (D_PASS
or having kill_level safely high), then use MTA's virtual mapping
to rewrite modified address (with address extension appended)
to some other mailbox on some host. See the:
  http://www.ijs.si/software/amavisd/amavisd-new-docs.html#addrext
and follow the example at the end of that section.

This approach ensures that each recipient receives mail the way
it was intended for them, with proper personalized headers inserted,
with bypass*, while/blacklists, spam levels, etc. properly observed.

Rewriting a recipient address (by adding an extension and redirecting)
results in a clean mail that can be seen (or forwarded to) directly
by end-user if needed. A mail is also cloned as needed in case
of it having multiple recipients (e.g. from different subdomains),
perhaps each with different settings.

Using native quarantining mechanisms does not preserve sender's
privacy as it stores all envelope information in mail header - which
should be removed before handing mail for user inspection.
Also proper mail cloning is not done: even in case of multiple
quarantines all copies would be equal (e.g. each listing _all_ envelope
recipients).
####################################################################

This is not a concern for me personally because there is no one in my
organization that has a clue what an email header is and even if they
did, would not care who a message was BCC'd to. So I could use
something like this:

$spam_quarantine_to = '[EMAIL PROTECTED]';

@spam_quarantine_to_maps = (
  { '.example.net' => '[EMAIL PROTECTED]',
  },
  $spam_quarantine_to, # current setting for everyone else
);

To use plus addressing to deliver to a single mailbox for each domain
would first require you rethink settings like sa_kill_level and
sa_tag2_level because mail would be directed to to the spam-bin
mailboxes at sa_tag2_level. You would probably also want to disable
rewriting of the subject line, so 'quarantined' mail does not get the
***SPAM*** entry (search for spam_modifies_subj in amavisd.conf-sample).
You would raise sa_tag2_level to sa_kill_level and raise
sa_kill_level to a higher number (maybe 15 or so). If the mail
scored at 15, it would quarantine using the conventional quarantine
method (use of plus addressing would not change that fact). Set it
higher, or set $final_spam_destiny = D_PASS; if you don't want to use
conventional quarantine. At something like 15, you could still use my
example @spam_quarantine_to_maps above.

You would need to enable plus addressing in both amavisd.conf and
main.cf, and create an additional virtual alias map (pcre or regexp).

contents of /etc/postfix/virtual_pcre
/^(.*)[EMAIL PROTECTED]/   [EMAIL PROTECTED]
/^(.*)[EMAIL PROTECTED]/   [EMAIL PROTECTED]

main.cf:
$recipient_delimiter = +
virtual_alias_maps =
  hash:/etc/postfix/virtual
  pcre:/etc/postfix/virtual_pcre

amavisd.conf:
$recipient_delimiter = '+';
@addr_extension_spam_maps = ('spam');
(and the other @addr_extension_*_maps

read amavisd.conf-sample for more examples of using different settings
for different recipients/domains.

Gary V


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to