SPAM moved into subfolder, Not only tag spam mails, but move them into subfolder |
![]() ![]() |
SPAM moved into subfolder, Not only tag spam mails, but move them into subfolder |
Apr 7 2007, 06:45 PM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 8 Joined: 7-April 07 Member No.: 3,230 |
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 |
|
|
|
Apr 15 2007, 08:30 PM
Post
#2
|
|
|
Newbie ![]() Group: Members Posts: 8 Joined: 7-April 07 Member No.: 3,230 |
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! |
|
|
|
Apr 17 2007, 02:29 PM
Post
#3
|
|
|
Administrator ![]() ![]() ![]() Group: Admin Posts: 4,252 Joined: 13-June 03 Member No.: 1 |
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" ..... |
|
|
|
May 8 2007, 03:08 AM
Post
#4
|
|
|
Newbie ![]() Group: Members Posts: 8 Joined: 7-April 07 Member No.: 3,230 |
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". |
|
|
|
May 11 2007, 06:28 AM
Post
#5
|
|
|
Newbie ![]() Group: Members Posts: 8 Joined: 7-April 07 Member No.: 3,230 |
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. |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 2nd September 2010 - 10:39 PM |