RV Products Forums: SPAM moved into subfolder - RV Products Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

SPAM moved into subfolder Not only tag spam mails, but move them into subfolder

#1 User is offline   jonasplus 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 07-April 07

Posted 07 April 2007 - 06:45 PM

Hi guys,

These scripts & howto are great. Thanks.
Reduced the spamload of my users (and myself) quite considerably.

One thing - I'd like to move spam messages into a subfolder and tag them, NOT only tag them.
Pretty much like the "spambox" in cpanel spamassasin configuration.

Especially for mobile devices this is extremely helpful, then the inbox isn't full with spams, which then saves data when checking the mailbox.

At the moment I'm relying on spamassasin per-domain to re-filter the messages and move them into the subfolder, but that's not a good solution (increases CPU- & memory-load and is sometimes unreliable)

I know that exim is capable of moving messages, but for me it somehow didn't work.

Have any of you done that before?

Or, if not, can you point me in the right direction?

Thanks!
Jonas
0

#2 User is offline   jonasplus 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 07-April 07

Posted 15 April 2007 - 08:30 PM

idea? anyone?

Exim filters - should be possible to move messages?

Or if you haven't done it yourself, maybe an idea where to find an answer?

Thanks!
0

#3 User is offline   pairote 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 4,345
  • Joined: 13-June 03

Posted 17 April 2007 - 02:29 PM

In WHM exim configuration, search localuser_spam. You need to write your own router similar to localuser_spam. Place it on the box below localuser_spam. It will look like this. Use it as your own risk. We didn't test it.

QUOTE
localuser_exisspam:
driver = accept
headers_remove="X-Exiscan-SA-Spam"
condition = ${if eqi{$h_X-Exiscan-SA-Spam:}{yes}{true}{false}}
check_local_user
domains = ! lsearch;/etc/userdomains
transport = local_delivery_spam


You also need to edit system filter file. Find below

QUOTE
##
# Rewrite subject if email scored between 9 and 15.
##
if
"${if def:header_X-Exiscan-SA-New-Subject: {there}}" is "there"
and ("${lookup{${lc:$sender_address}}lsearch*@{/usr/local/cpanel/base/eximacl/rv_spam_sender_address_whitelist}{1}{fail}}" is "fail")
# A message may have many recipients, so many local parts and domains, but
# the system filter is run only once. If the domains are different, all domains MUST listed in the whitelist,
# otherwise email will be rejected.
and foranyaddress ${lc:$recipients}("${lookup{${thisaddress}}lsearch*@{/usr/local/cpanel/base/eximacl/rv_spam_receiver_domain_whitelist}{1}{fail}}" is
"fail")
then
headers remove Subject
headers add "Subject: $h_X-Exiscan-SA-New-Subject:"
headers remove X-Exiscan-SA-New-Subject
endif


And add

QUOTE
.....
headers remove Subject
headers add "Subject: $h_X-Exiscan-SA-New-Subject:"
headers remove X-Exiscan-SA-New-Subject
headers add "X-Exiscan-SA-Spam: Yes"
.....

0

#4 User is offline   jonasplus 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 07-April 07

Posted 08 May 2007 - 03:08 AM

Hi Pairote,

Thanks for your tip!

I now have the following in the system file /usr/local/cpanel/base/eximacl/antivirusandspam.exim:

QUOTE
##
# Rewrite subject if email scored between 9 and 15.
##
if
"${if def:header_X-Exiscan-SA-New-Subject: {there}}" is "there"
and ("${lookup{${lc:$sender_address}}lsearch*@{/usr/local/cpanel/base/eximacl/rv_spam_sender$
# A message may have many recipients, so many local parts and domains, but
# the system filter is run only once. If the domains are different, all domains MUST listed in t$
# otherwise email will be rejected.
and foranyaddress ${lc:$recipients}("${lookup{${thisaddress}}lsearch*@{/usr/local/cpanel/bas$
then
headers remove Subject
headers add "Subject: $h_X-Exiscan-SA-New-Subject:"
headers remove X-Exiscan-SA-New-Subject
headers add "X-Exiscan-SA-Spam: Yes"
endif


And in the Exim config I added this to the box below
QUOTE
localuser_exisspam:
driver = accept
headers_remove="X-Exiscan-SA-Spam"
condition = ${if eqi{$h_X-Exiscan-SA-Spam:}{yes}{true}{false}}
check_local_user
domains = ! lsearch;/etc/userdomains
transport = local_delivery_spam


Spam gets tagged correctly, but still not delivered into the subfolder. I tested with the spamassin test message.

I now disable the per-domain spam-assasin and the "spambox".
0

#5 User is offline   jonasplus 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 07-April 07

Posted 11 May 2007 - 06:28 AM

Okay, I figured out a way. Not the cleanest way, but it works.

When enabling spambox in cpanel it creates a file .spamassassinboxenable in the user directory.
I left this file there.

I then changed
QUOTE
then
headers remove Subject
headers add "Subject: $h_X-Exiscan-SA-New-Subject:"
headers remove X-Exiscan-SA-New-Subject
endif


to
QUOTE
$
then
headers remove Subject
headers add "Subject: $h_X-Exiscan-SA-New-Subject:"
headers remove X-Exiscan-SA-New-Subject
headers add "x-spam-exim: Yes"
endif


And that does it for me! Sweet.

It seems to me that the new exim filter in WHM didn't work properly. So I added "headers add "x-spam-exim: Yes" in order to use the cpanel exim filter. And that's working fine. Cool.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic