HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Installation/Configuration (
-   -   HOWTO: Prevent sending copy of spam to remote mailbox (

PVi1 21st October 2012 15:59

HOWTO: Prevent sending copy of spam to remote mailbox
1 Attachment(s)
Hello all,

yesterday evening I have found, that my ispconfig is sending copy of spam to user configured remote mailboxes(Send copy to).

Situation: local user mailbox account with filled in "Send copy to" option
OS: Ubuntu 10.04.4 LTS amd64, ispconfig, postfix,amavisd, spamassasin, SIEVE, dovecot...

When my server received SPAM, this was properly identified and moved to JUNK folder, which is OK, but after that it continued with sending copy of this SPAM to the use configured remote email(eg. gmail). I don't want to be known as a spammer so I have slightly patched the sieve_filter_1.2.master file and have swapped the position of "Move spam to spam folder" and "Send a copy of email to" code blocks.
After that I have edited all accounts which has Send copy to option filled in and this caused regeneration of sieve rules. Moreover I have checked that each of these accounts has enabled option "Move Spam Emails to Junk directory".

After the minute all sieve rules was regenerated(you can check them in /var/vmail/{$domain}/{$email}/.sieve) like this:

require ["fileinto", "regex", "date", "relational", "vacation"];

# Move spam to spam folder
if header :contains "X-Spam-Flag" "YES" {
  fileinto "Junk";
  # Stop here so that we do not reply on spams

# Send a copy of email to bb
redirect "";


The stop keyword prevents of further sieve rules processing, so email is not redirected.

I have attached the patch for sieve_filter_1.2.master.

This tweak works fine for me.

Best regards,


till 21st October 2012 19:26

Thanks, I've added it to the bugtracker.

All times are GMT +2. The time now is 06:39.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.