Re: Subject Rewrite Based on Score
Hi, > It still is spawning a Perl process per message. You can do away with > that processing hog, if you use the add_header rule I mentioned before > and have SA do it instead. You may be right. I'll have to investigate doing this for this specific user only. Thanks for the info. Thanks, Alex
Re: Subject Rewrite Based on Score
On Thu, 2009-10-08 at 14:45 -0400, MySQL Student wrote: > > That sounds overly complicated and like a lot of wasted cycles. Calling > > a Perl script for each message? What you just described sounds a hell of > > lot like this light-weight SA configuration: > > Yes, I should have mentioned that it is a copy of the mail that users > receive and only visible by a single account. It also only occurs once > every four hours as the mail is pulled from the spool. It still is spawning a Perl process per message. You can do away with that processing hog, if you use the add_header rule I mentioned before and have SA do it instead. -- char *t="\10pse\0r\0dtu...@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4"; main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}
Re: Subject Rewrite Based on Score
Hi, > That sounds overly complicated and like a lot of wasted cycles. Calling > a Perl script for each message? What you just described sounds a hell of > lot like this light-weight SA configuration: Yes, I should have mentioned that it is a copy of the mail that users receive and only visible by a single account. It also only occurs once every four hours as the mail is pulled from the spool. Regards, Alex
Re: Subject Rewrite Based on Score
From: "Jason Bertoch" Sent: Thursday, 2009/October/08 09:01 Shane Webster wrote: Spamassassin Version 3.2.5 I am curious if it is possible to rewrite the subject based on the value of the score. A example of this would be if a score of 4.0 was given the subject would state [Potential Spam], but if it was 5.0-10.0 then it is [SPAM] if it was greater then 10.0 it would be [SUPER SPAM]. I understand this may seem odd but I am just trying to fill the request of the client and what they want. It can be done, but not with SpamAssassin. You'll need to work with the program that calls SA. I use MIMEDefang for conditional actions, but there are others. rewrite_header Subject *SPAM* _SCORE(00)_ ** The result looks like this for spam: Subject: *SPAM* 065.8 ** RE: Pharmacy Online Sale 88% OFF! Note that you can sort the spam by score by sorting by subject. {^_^}
Re: Subject Rewrite Based on Score
On Thu, 8 Oct 2009, LuKreme wrote: You can do this easily with procmail. DOGPILE! :) -- John Hardin KA7OHZhttp://www.impsec.org/~jhardin/ jhar...@impsec.orgFALaholic #11174 pgpk -a jhar...@impsec.org key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79 --- You do not examine legislation in the light of the benefits it will convey if properly administered, but in the light of the wrongs it would do and the harms it would cause if improperly administered. -- Lyndon B. Johnson --- 7 days since a sunspot last seen - EPA blames CO2 emissions
Re: Subject Rewrite Based on Score
On Thu, 2009-10-08 at 13:47 -0400, MySQL Student wrote: > We do something similar here using a procmail/formail script which > calls a perl script to match on X-Spam-Status then rewrite the subject > to include the bayes score prepended to the subject. *boggle* That sounds overly complicated and like a lot of wasted cycles. Calling a Perl script for each message? What you just described sounds a hell of lot like this light-weight SA configuration: rewrite_header Subject _BAYES_ However, rather than munging the Subject, I'd strongly suggest to use something like this, and have SA add a dedicated header. add_header spam Bayes _BAYES_ See the Template Tags section in the Conf documentation. > We then use a few procmail rules to filter the mail based on the bayes > score for analysis. Yes, use the dedicated header as per above. There is NO need to mess with the Subject or any commonly user-visible header, for analysis. Even less so, when using something like procmail, which perfectly understands headers. -- char *t="\10pse\0r\0dtu...@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4"; main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}
Re: Subject Rewrite Based on Score
On 8-Oct-2009, at 09:39, Shane Webster wrote: I am curious if it is possible to rewrite the subject based on the value of the score. A example of this would be if a score of 4.0 was given the subject would state [Potential Spam], but if it was 5.0-10.0 then it is [SPAM] if it was greater then 10.0 it would be [SUPER SPAM]. I understand this may seem odd but I am just trying to fill the request of the client and what they want. You can do this easily with procmail. :0 * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\* | formail -I"Subject: SUPER SPAM" :0E :0 * ^X-Spam-Level: \*\*\*\*\* | formail -I"Subject: SPAM" :0E :0 * ^X-Spam-Level: \*\*\*\*\ | formail -I"Subject: Probable SPAM" -- There is a tragic flaw in our precious Constitution, and I don t know what can be done to fix it. This is it: Only nut cases want to be president.
Re: Subject Rewrite Based on Score
On tor 08 okt 2009 19:26:10 CEST, Shane Webster wrote I actually would be doing that but the filter does not know how to handle int(), try using: X-Spam-Level header so -- xpoint
Re: Subject Rewrite Based on Score
Hi, > I actually would be doing that but the filter does not know how to > handle int(), so I would have to build a filter for all possible number > combinations, but if I could just get SA to do the basic math for me and > write a header or subject I can filter off of that. We do something similar here using a procmail/formail script which calls a perl script to match on X-Spam-Status then rewrite the subject to include the bayes score prepended to the subject. We then use a few procmail rules to filter the mail based on the bayes score for analysis. Regards, Alex
Re: Subject Rewrite Based on Score
On Thu, 8 Oct 2009, Shane Webster wrote: I actually would be doing that but the filter does not know how to handle int(), so I would have to build a filter for all possible number combinations, You could check the asterisks in X-Spam-Level: if match X-Spam-Level: ** subject -> [ULTRA SPAM] else if match X-Spam-Level: * subject -> [SPAM] else if match X-Spam-Level: *** subject -> [POSSIBLE SPAM] -- John Hardin KA7OHZhttp://www.impsec.org/~jhardin/ jhar...@impsec.orgFALaholic #11174 pgpk -a jhar...@impsec.org key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79 --- The difference is that Unix has had thirty years of technical types demanding basic functionality of it. And the Macintosh has had fifteen years of interface fascist users shaping its progress. Windows has the hairpin turns of the Microsoft marketing machine and that's all.-- Red Drag Diva --- 7 days since a sunspot last seen - EPA blames CO2 emissions
Re: Subject Rewrite Based on Score
On Thursday 08 October 2009 19:26:10 Shane Webster wrote: > I actually would be doing that but the filter does not know how to > handle int(), so I would have to build a filter for all possible number > combinations, but if I could just get SA to do the basic math for me and > write a header or subject I can filter off of that. If integer thresholds suffice for the purpose, you can just match on the number of asterisks (or whichever characters) in the X-Spam-Level header field. Mark
Re: Subject Rewrite Based on Score
I actually would be doing that but the filter does not know how to handle int(), so I would have to build a filter for all possible number combinations, but if I could just get SA to do the basic math for me and write a header or subject I can filter off of that. On Thu, 2009-10-08 at 20:21 +0300, Jari Fredriksson wrote: > > Spamassassin Version 3.2.5 > > > > I am curious if it is possible to rewrite the subject > > based on the value of the score. A example of this would > > be if a score of 4.0 was given the subject would state > > [Potential Spam], but if it was 5.0-10.0 then it is > > [SPAM] if it was greater then 10.0 it would be [SUPER > > SPAM]. I understand this may seem odd but I am just > > trying to fill the request of the client and what they > > want. > > > > I would appreciate any incite, I am willing to do the > > scripting for this if needed, but I would appreciate a > > point in the right direction please. > > > > It is possible to use X-Spam-Level: header to check out the spamminess level. > That may or not be what your client needs. I use that for the exact purpose I > image they are needing. > > It's sometimes better to offer an alternative solution to what the client > asks.. > > Dunno. > > > >
Re: Subject Rewrite Based on Score
> Spamassassin Version 3.2.5 > > I am curious if it is possible to rewrite the subject > based on the value of the score. A example of this would > be if a score of 4.0 was given the subject would state > [Potential Spam], but if it was 5.0-10.0 then it is > [SPAM] if it was greater then 10.0 it would be [SUPER > SPAM]. I understand this may seem odd but I am just > trying to fill the request of the client and what they > want. > > I would appreciate any incite, I am willing to do the > scripting for this if needed, but I would appreciate a > point in the right direction please. > It is possible to use X-Spam-Level: header to check out the spamminess level. That may or not be what your client needs. I use that for the exact purpose I image they are needing. It's sometimes better to offer an alternative solution to what the client asks.. Dunno.
Re: Subject Rewrite Based on Score
I will look into doing this, thank you. On Thu, 2009-10-08 at 19:02 +0200, Karsten Bräckelmann wrote: > On Thu, 2009-10-08 at 12:01 -0400, Jason Bertoch wrote: > > Shane Webster wrote: > > > I am curious if it is possible to rewrite the subject based on the value > > > of the score. A example of this would be if a score of 4.0 was given the > > > subject would state [Potential Spam], but if it was 5.0-10.0 then it is > > > [SPAM] if it was greater then 10.0 it would be [SUPER SPAM]. I > > > understand this may seem odd but I am just trying to fill the request of > > > the client and what they want. > > The generic option available with SA is, to use the score template tag > for the rewrite_header config. > > > It can be done, but not with SpamAssassin. You'll need to work with the > > program that calls SA. > > This actually should quite easily be doable with a plugin. > > Basically, you need a plugin that defines a template tag, with the value > depending on the score. Then use that template tag for Subject > rewriting. > >
Re: Subject Rewrite Based on Score
On Thu, 2009-10-08 at 12:01 -0400, Jason Bertoch wrote: > Shane Webster wrote: > > I am curious if it is possible to rewrite the subject based on the value > > of the score. A example of this would be if a score of 4.0 was given the > > subject would state [Potential Spam], but if it was 5.0-10.0 then it is > > [SPAM] if it was greater then 10.0 it would be [SUPER SPAM]. I > > understand this may seem odd but I am just trying to fill the request of > > the client and what they want. The generic option available with SA is, to use the score template tag for the rewrite_header config. > It can be done, but not with SpamAssassin. You'll need to work with the > program that calls SA. This actually should quite easily be doable with a plugin. Basically, you need a plugin that defines a template tag, with the value depending on the score. Then use that template tag for Subject rewriting. -- char *t="\10pse\0r\0dtu...@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4"; main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}
Re: Subject Rewrite Based on Score
To be honest it sounds like you want MailScanner. Eddie Hallahan Enterprise Management Consulting www.emcuk.com Enterprise Management Consulting is a company registered in England and Wales with company number 3134544. VAT registration number is 681038440. Shane Webster wrote: > Spamassassin Version 3.2.5 > > I am curious if it is possible to rewrite the subject based on the value > of the score. A example of this would be if a score of 4.0 was given the > subject would state [Potential Spam], but if it was 5.0-10.0 then it is > [SPAM] if it was greater then 10.0 it would be [SUPER SPAM]. I > understand this may seem odd but I am just trying to fill the request of > the client and what they want. > > I would appreciate any incite, I am willing to do the scripting for this > if needed, but I would appreciate a point in the right direction > please. > > Thank you, > >Shane M. Webster > >
Re: Subject Rewrite Based on Score
Shane Webster wrote: Spamassassin Version 3.2.5 I am curious if it is possible to rewrite the subject based on the value of the score. A example of this would be if a score of 4.0 was given the subject would state [Potential Spam], but if it was 5.0-10.0 then it is [SPAM] if it was greater then 10.0 it would be [SUPER SPAM]. I understand this may seem odd but I am just trying to fill the request of the client and what they want. It can be done, but not with SpamAssassin. You'll need to work with the program that calls SA. I use MIMEDefang for conditional actions, but there are others.
Subject Rewrite Based on Score
Spamassassin Version 3.2.5 I am curious if it is possible to rewrite the subject based on the value of the score. A example of this would be if a score of 4.0 was given the subject would state [Potential Spam], but if it was 5.0-10.0 then it is [SPAM] if it was greater then 10.0 it would be [SUPER SPAM]. I understand this may seem odd but I am just trying to fill the request of the client and what they want. I would appreciate any incite, I am willing to do the scripting for this if needed, but I would appreciate a point in the right direction please. Thank you, Shane M. Webster