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
Page 1 of 1
SPAM moved into subfolder Not only tag spam mails, but move them into subfolder
#2
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!
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!
#3
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.
You also need to edit system filter file. Find below
And add
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
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
# 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"
.....
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"
.....
#4
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:
And in the Exim config I added this to the box below
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".
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
# 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
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".
#5
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
to
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.
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
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
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.
Share this topic:
Page 1 of 1
Help










