Delete mail marked by SpamAssassin

S

Sumsar

Guest
Hello!

I know this has been raised several times before - but I was unable to find any answer in the previous posts. Therefore I am hoping somebody now have the words of wisdom.

I want the server to delete all mail marked as spam by SpamAssassin (which means all mails with the line "X-Spam-Flag: YES" in the header).

As many seem to have found out, I also realized, that the filters are run BEFORE SpamAssassin and not after.

Has there been found a solution to this? My ISP just says they will wait for an updated Cpanel, but I'd kind of like this problem to be fixed right now :)

All help is appreciated.

Rasmus (Denmark)
 

hormigo

Well-Known Member
Sep 9, 2002
104
0
166
we need that to.
We try to delete all market emails but the first problem is the exim filters check emails before than SpamAssassin mark mails as a spam.

I think that only can be fixed in future updates

Regards
 

sej7278

Member
Jan 12, 2003
20
0
151
Yup, I've got so fed-up with spam that I've changed my primary Email address.

Hopefully a future Cpanel upgrade will either make SA execute before Exim, or replace Exim with Procmail (from which you can call spamc).
 

sexy_guy

Well-Known Member
Mar 19, 2003
847
0
166
Originally posted by Sumsar
Hello!

I know this has been raised several times before - but I was unable to find any answer in the previous posts. Therefore I am hoping somebody now have the words of wisdom.

I want the server to delete all mail marked as spam by SpamAssassin (which means all mails with the line "X-Spam-Flag: YES" in the header).

As many seem to have found out, I also realized, that the filters are run BEFORE SpamAssassin and not after.

Has there been found a solution to this? My ISP just says they will wait for an updated Cpanel, but I'd kind of like this problem to be fixed right now :)

All help is appreciated.

Rasmus (Denmark)
Get yourself a copy of MailScanner and a anti-virus package. Configure MailScanner to use spamassasin. Tell Spamassassin in MailScanner that any msg that scores a spam rating higher then point 8 should be deleted. End of story. It works great. Your only problem would be finding somebody who can install this on your Cpanel box and unless you know what to modify in Mailscanner script you may have a major problem getting it to work. Mine was installed by a professional and i couldnt be happier. Not only does Mailscanner clean our spam but it also does RBL lookups and wipes out viruses. ;)
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
Originally posted by Sumsar
I want the server to delete all mail marked as spam by SpamAssassin (which means all mails with the line "X-Spam-Flag: YES" in the header).

As many seem to have found out, I also realized, that the filters are run BEFORE SpamAssassin and not after.

Has there been found a solution to this? My ISP just says they will wait for an updated Cpanel, but I'd kind of like this problem to be fixed right now :)
That is incorrect info. The filters are run AFTER Spamassassin. The only exception to this is the main email account.
 

Uneeeq

Member
Feb 4, 2003
19
0
151
I found an answer to this just yesterday

setup your filter first

then create a brand spanking new email address via cpanel

set that email address as DEFAULT email address

restart exim
service exim restart

- it works!

I have not tested accounts that were created before we created the filter, so I do not know if the old accounts do not inherit the new filter, but I am sure with some poking around we can find that filter file and recopy it to all old accounts as well, probably located in etc/vfilters
 

robnelli

Member
Apr 16, 2004
14
0
151
I have had a similar problem with many clients' email and spam. They don't use their email accounts anymore but they constantly fill up with spam and mail from places no longer of interest. I wrote a Mail_Cleanup program that handles the problem and I tell my clients up front. Using the client's Cpanel, I enable SpamAssassin and have the spam routed to the Spam mailbox. I then install my Mail_Cleanup perl program in the site's cgi-bin and schedule the program to run weekly via cron with the cron results mailed back to me. The program can also make a backup copy of the mailboxes (except the spambox) before replacing it with cleaned-up mailboxes if you feel a need for added reduced risk. The configuration file for the program allows for setting the retention period for mail and for spam. I usually set the spam retention to 21 days and mail to 60 days. This way I know that all mail is eventually cleaned up. I've attached the file in a zip file for anyone's use. Happy cleaning!!
 

Attachments

dory36

Well-Known Member
Aug 30, 2003
179
0
166
Not sure what the fuss is about with the filter order.

I set up SA, and in the cpanel/mail menu set the filters to handle spam the way I wanted, and it works as I would expect when spam is sent to any email address in the account.

As for purging spam folders, here is an untried idea.

Set up a cron job that will run every month and:
- delete each user's trash folder
- rename the spam folder to be the trash folder

It's down low on my list of things to do for myself if I don't find a better solution by the time it pops to the top.

Bill
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
Originally posted by sexy_guy
Get yourself a copy of MailScanner and a anti-virus package. Configure MailScanner to use spamassasin. Tell Spamassassin in MailScanner that any msg that scores a spam rating higher then point 8 should be deleted. End of story. It works great. Your only problem would be finding somebody who can install this on your Cpanel box and unless you know what to modify in Mailscanner script you may have a major problem getting it to work. Mine was installed by a professional and i couldnt be happier. Not only does Mailscanner clean our spam but it also does RBL lookups and wipes out viruses. ;)
You seem to have wasted your money! :p

You can do these and a lot more with the stand-alone Cpanel version of Spamassassin and Exim. You don't need the Mailscanner to dabble in blacklists or spam.
 

Keegan

Well-Known Member
Oct 22, 2001
93
1
318
cPanel Access Level
DataCenter Provider
robnelli said:
I have had a similar problem with many clients' email and spam. They don't use their email accounts anymore but they constantly fill up with spam and mail from places no longer of interest. I wrote a Mail_Cleanup program that handles the problem and I tell my clients up front. Using the client's Cpanel, I enable SpamAssassin and have the spam routed to the Spam mailbox. I then install my Mail_Cleanup perl program in the site's cgi-bin and schedule the program to run weekly via cron with the cron results mailed back to me. The program can also make a backup copy of the mailboxes (except the spambox) before replacing it with cleaned-up mailboxes if you feel a need for added reduced risk. The configuration file for the program allows for setting the retention period for mail and for spam. I usually set the spam retention to 21 days and mail to 60 days. This way I know that all mail is eventually cleaned up. I've attached the file in a zip file for anyone's use. Happy cleaning!!

Does anyone have this file or can you re-upload it somewhere? The file is corrupt on download.