HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   HOWTO: Prevent sending copy of spam to remote mailbox (http://www.howtoforge.com/forums/showthread.php?t=59176)

PVi1 21st October 2012 14: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 3.0.4.6, 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:
Code:

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
  stop;
}

# Send a copy of email to bb
redirect "some@email.in";

keep;

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,

Peter

till 21st October 2012 18:26

Thanks, I've added it to the bugtracker.


All times are GMT +2. The time now is 08:30.

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