SpamAssassin - Summary breakdown expression.
Posted: Wed Apr 25, 2007 5:16 am
I've got the following SpamAssassin summary that I'm trying to breakdown in to three parts: score, rule and description:
1.8 SUBJECT_DRUG_GAP_VIA Subject contains a gappy version of '<span style='color:red;text-decoration:blink' title='Alert a moderator!'>grilled spam</span>'
-0.0 NO_RELAYS Informational: message was not relayed via SMTP
0.4 SUBJ_ALL_CAPS Subject is all capitals
1.5 DRUG_ED_CAPS BODY: Mentions an E.D. drug
0.8 BODY_ENHANCEMENT2 BODY: Information on getting larger body parts
1.5 URIBL_JP_SURBL Contains an URL listed in the JP SURBL blocklist
[URIs: hitem.hk]
0.5 URIBL_WS_SURBL Contains an URL listed in the WS SURBL blocklist
[URIs: hitem.hk]
2.0 URIBL_OB_SURBL Contains an URL listed in the OB SURBL blocklist
[URIs: hitem.hk]
0.0 DRUGS_ERECTILE Refers to an erectile drug
So far I've come up with:
[\n]*[ |-]?([0-9]*\.[0-9]*)[ ]*([a-z0-9_]*)[ ]*([a-z0-9 \':\(\)\.\%\-]*)
This matches the score, rule and description for all lines, except for the blocklist URI results, which it matches in a seperate result. I need the URI result to added to the end of the relevant description. I can't for the life of me get this work without breaking the whole expression. Can anyone help?
I need to store the score, rule and description in a database. I've been using preg_match.
Remeber I'm a newbie, please be patient with me!
Thanks in advance.
1.8 SUBJECT_DRUG_GAP_VIA Subject contains a gappy version of '<span style='color:red;text-decoration:blink' title='Alert a moderator!'>grilled spam</span>'
-0.0 NO_RELAYS Informational: message was not relayed via SMTP
0.4 SUBJ_ALL_CAPS Subject is all capitals
1.5 DRUG_ED_CAPS BODY: Mentions an E.D. drug
0.8 BODY_ENHANCEMENT2 BODY: Information on getting larger body parts
1.5 URIBL_JP_SURBL Contains an URL listed in the JP SURBL blocklist
[URIs: hitem.hk]
0.5 URIBL_WS_SURBL Contains an URL listed in the WS SURBL blocklist
[URIs: hitem.hk]
2.0 URIBL_OB_SURBL Contains an URL listed in the OB SURBL blocklist
[URIs: hitem.hk]
0.0 DRUGS_ERECTILE Refers to an erectile drug
So far I've come up with:
[\n]*[ |-]?([0-9]*\.[0-9]*)[ ]*([a-z0-9_]*)[ ]*([a-z0-9 \':\(\)\.\%\-]*)
This matches the score, rule and description for all lines, except for the blocklist URI results, which it matches in a seperate result. I need the URI result to added to the end of the relevant description. I can't for the life of me get this work without breaking the whole expression. Can anyone help?
I need to store the score, rule and description in a database. I've been using preg_match.
Remeber I'm a newbie, please be patient with me!
Thanks in advance.