HOWTO: Prevent sending copy of spam to remote mailbox

Discussion in 'Installation/Configuration' started by PVi1, Oct 21, 2012.

  1. PVi1

    PVi1 New Member

    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
     [COLOR="Red"] stop;[/COLOR]
    # Send a copy of email to bb
    redirect "[email protected]";
    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,


    Attached Files:

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thanks, I've added it to the bugtracker.

Share This Page