You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by "Dallas L. Engelken" <da...@nmgi.com> on 2006/08/03 22:14:06 UTC

ImageInfo plugin for SA

Greetings,

For those of you that dont want the overhead or hassel of installing all
extras to get OCR running, I give you a simpler (maybe less effective)
option..  It basically determines pixel coverage similar to what
eval:html_image_ratio() does, but html_image_ratio() actually reads
height="" and width="" params from html, and in these stock spams and
such, there is no height/width values to go off of.   So,
eval:pixel_coverage()  will actually read the gif and png headers and
calculate it from the actual image data. 

Put the .pm file that is attached in your M::SA::Plugins dir.  Add to
your init.pre (or v310.pre) the following line.

loadplugin Mail::SpamAssassin::Plugin::ImageInfo

And throw the imageinfo.cf ruleset in your local config dir (tweak
rules/scores as needed).  And dont forgot to restart spamd if you are
running it.   Feel free to tweak the ruleset you meet your needs.  It
has hit well for me today as is, but YMMV.

# grep -c _LARGO spamd.log
868

No outside tools required... yeah!   Sorry for the lack of
documentation, but I just dont have enough time to do it, and I wanted
share this.

All those scores in the cf are just "WAGs", since none have been
masschecked.   Theo, could you sandbox this?

Cya,
Dallas 

Re: ImageInfo plugin for SA

Posted by Matthias Keller <li...@matthias-keller.ch>.
Matthias Keller wrote:
> Michele Neylon:: Blacknight.ie wrote:
>> Spamassassin List wrote:
>>  
>>>> Put the .pm file that is attached in your M::SA::Plugins dir.  Add to
>>>> your init.pre (or v310.pre) the following line.
>>>>       
>>> Where is the usual Plugins dir?
>>>
>>> regards
>>>     
>> It doesn't really matter as you can specify the plugin location in the
>> *.pre file eg.
>> loadplugin Mail::SpamAssassin::Plugin::ImageInfo 
>> /full/path/to/ImageInfo.pm
>>   
>
> Hmm
> I've put it to /etc/mail/spamassassin/plugins
> It seems to load fine but I get some errors every time I run a check:
> warn: plugin: failed to load plugin 
> /etc/mail/spamassassin/ImageInfo.pm: No such file or directory
> It seems it also looks inside the spamassassin directory itself... I 
> guess this is a bug - even tough the plugin seems to run fine I dont 
> like any errors spit out.....
I found the issue: the .cf file loads the plugin aswell but with the 
standard path:
loadplugin Mail::SpamAssassin::Plugin::ImageInfo ImageInfo.pm

I'd suggest having that one removed from the .cf
After I commented it out it runs without any warnings or errors
Matt

Re: ImageInfo plugin for SA

Posted by Marc Perkel <ma...@perkel.com>.
Seems to be working well. But before this new rule set the old spam 
poisoned my bayes so I just purged all my bayes and starting over. That 
way I won't get bayes_00 lowering the point score.

Re: ImageInfo plugin for SA

Posted by MennovB <mv...@xs4all.nl>.

Bill Randle wrote:
> 
> In the last 11 hours since I installed the plugin, it's caught 837
> messages.
> 
Good for you!
I'm now at 11 hours too and in the meantime only 12 image spams came in, 11
were discarded by postfix rules, 1 new one came through and was catched by
SA but was not marked by the image-info rules.
Not really spectacular, maybe I should remove all the spam-rules and
blocklists in Postfix so I get to see some action, or type our 1500
mailaddresses in on a 'remove me' page ;-)

Regards
Menno
-- 
View this message in context: http://www.nabble.com/ImageInfo-plugin-for-SA-tf2047808.html#a5654827
Sent from the SpamAssassin - Users forum at Nabble.com.


Re: ImageInfo plugin for SA

Posted by Bill Randle <bi...@neocat.org>.
On Fri, 2006-08-04 at 04:22 -0700, MennovB wrote:
> 
> Maurice Lucas wrote:
> > 
> > Maybe i'm off there spamlist ;) but I think i'm just lucky for a few
> > hours.
> > 
> I've got zero hits here sofar, very little image-spam comes in and what does
> is discarded by postfix rules.
> We'll see after the weekend..

In the last 11 hours since I installed the plugin, it's caught 837
messages.

	-Bill



Re: ImageInfo plugin for SA

Posted by MennovB <mv...@xs4all.nl>.

Maurice Lucas wrote:
> 
> Maybe i'm off there spamlist ;) but I think i'm just lucky for a few
> hours.
> 
I've got zero hits here sofar, very little image-spam comes in and what does
is discarded by postfix rules.
We'll see after the weekend..

Regards
Menno
-- 
View this message in context: http://www.nabble.com/ImageInfo-plugin-for-SA-tf2047808.html#a5648595
Sent from the SpamAssassin - Users forum at Nabble.com.


Re: ImageInfo plugin for SA

Posted by Maurice Lucas <ms...@taos-it.nl>.
On Fri, 2006-08-04 at 02:21 -0700, MennovB wrote:
> 
> Matthias Keller wrote:
> > 
> > It seems to load fine but I get some errors every time I run a check:
> > warn: plugin: failed to load plugin /etc/mail/spamassassin/ImageInfo.pm: 
> > No such file or directory
> > 
> Yes, I had to comment this line in 70_imageinfo.cf:
> #loadplugin Mail::SpamAssassin::Plugin::ImageInfo ImageInfo.pm
> 
> Then it loads fine.
> I'm still testing with some examples though.

I wanted to test it in a production enviroment, but I don't see any hits
on the moment. But I'm not even seeing a LN also.

Maybe i'm off there spamlist ;) but I think i'm just lucky for a few
hours.

Maurice Lucas


Re: ImageInfo plugin for SA

Posted by MennovB <mv...@xs4all.nl>.

Matthias Keller wrote:
> 
> It seems to load fine but I get some errors every time I run a check:
> warn: plugin: failed to load plugin /etc/mail/spamassassin/ImageInfo.pm: 
> No such file or directory
> 
Yes, I had to comment this line in 70_imageinfo.cf:
#loadplugin Mail::SpamAssassin::Plugin::ImageInfo ImageInfo.pm

Then it loads fine.
I'm still testing with some examples though.

Regards
Menno
-- 
View this message in context: http://www.nabble.com/ImageInfo-plugin-for-SA-tf2047808.html#a5647179
Sent from the SpamAssassin - Users forum at Nabble.com.


RE: ImageInfo plugin for SA

Posted by "Michele Neylon :: Blacknight Solutions" <mi...@blacknight.ie>.
Matthias Keller wrote:
> Michele Neylon:: Blacknight.ie wrote:
>> Spamassassin List wrote:
>> 
>>>> Put the .pm file that is attached in your M::SA::Plugins dir.  Add
>>>> to your init.pre (or v310.pre) the following line.
>>>> 
>>> Where is the usual Plugins dir?
>>> 
>>> regards
>>> 
>> It doesn't really matter as you can specify the plugin location in
>> the *.pre file eg. loadplugin Mail::SpamAssassin::Plugin::ImageInfo
>> /full/path/to/ImageInfo.pm
>> 
> 
> Hmm
> I've put it to /etc/mail/spamassassin/plugins It seems to load fine
> but I get some errors every time I run a check: 
> warn: plugin: failed to load plugin
> /etc/mail/spamassassin/ImageInfo.pm: 
> No such file or directory
> It seems it also looks inside the spamassassin directory itself... I
> guess this is a bug - even tough the plugin seems to run fine I dont
> like any errors spit out.....  
> 
> Matt

Matt

Are you specifying the path or the full path? I've got mine in a $random
directory and it's working fine

Michele

Mr Michele Neylon
Blacknight Solutions
Hosting & Colocation, Brand Protection
http://www.blacknight.ie/
http://blog.blacknight.ie/
Tel. 1850 927 280
Intl. +353 (0) 59  9183072
UK: 0870 163 0607
Direct Dial: +353 (0)59 9183090
Fax. +353 (0) 59  9164239


Re: ImageInfo plugin for SA

Posted by Matthias Keller <li...@matthias-keller.ch>.
Michele Neylon:: Blacknight.ie wrote:
> Spamassassin List wrote:
>   
>>> Put the .pm file that is attached in your M::SA::Plugins dir.  Add to
>>> your init.pre (or v310.pre) the following line.
>>>       
>> Where is the usual Plugins dir?
>>
>> regards
>>     
> It doesn't really matter as you can specify the plugin location in the
> *.pre file eg.
> loadplugin Mail::SpamAssassin::Plugin::ImageInfo /full/path/to/ImageInfo.pm
>   

Hmm
I've put it to /etc/mail/spamassassin/plugins
It seems to load fine but I get some errors every time I run a check:
warn: plugin: failed to load plugin /etc/mail/spamassassin/ImageInfo.pm: 
No such file or directory
It seems it also looks inside the spamassassin directory itself... I 
guess this is a bug - even tough the plugin seems to run fine I dont 
like any errors spit out.....

Matt

Re: ImageInfo plugin for SA

Posted by "Michele Neylon:: Blacknight.ie" <mi...@blacknight.ie>.
Spamassassin List wrote:
>> Put the .pm file that is attached in your M::SA::Plugins dir.  Add to
>> your init.pre (or v310.pre) the following line.
> 
> Where is the usual Plugins dir?
> 
> regards
It doesn't really matter as you can specify the plugin location in the
*.pre file eg.
loadplugin Mail::SpamAssassin::Plugin::ImageInfo /full/path/to/ImageInfo.pm


-- 
Mr Michele Neylon
Blacknight Solutions
Quality Business Hosting & Colocation
http://www.blacknight.ie/
Tel. 1850 927 280
Intl. +353 (0) 59  9183072
Direct Dial: +353 (0)59 9183090
Fax. +353 (0) 59  9164239

Re: ImageInfo plugin for SA

Posted by "Michele Neylon:: Blacknight.ie" <mi...@blacknight.ie>.
Spamassassin List wrote:
>> Put the .pm file that is attached in your M::SA::Plugins dir.  Add to
>> your init.pre (or v310.pre) the following line.
> 
> Where is the usual Plugins dir?
> 
> regards
It doesn't really matter as you can specify the plugin location in the
*.pre file eg.
loadplugin Mail::SpamAssassin::Plugin::ImageInfo /full/path/to/ImageInfo.pm


-- 
Mr Michele Neylon
Blacknight Solutions
Quality Business Hosting & Colocation
http://www.blacknight.ie/
Tel. 1850 927 280
Intl. +353 (0) 59  9183072
Direct Dial: +353 (0)59 9183090
Fax. +353 (0) 59  9164239

Re: ImageInfo plugin for SA

Posted by Spamassassin List <sp...@gmail.com>.
>Put the .pm file that is attached in your M::SA::Plugins dir.  Add to
>your init.pre (or v310.pre) the following line.

Where is the usual Plugins dir?

regards

Re: ImageInfo plugin for SA

Posted by Theo Van Dinter <fe...@apache.org>.
On Thu, Aug 03, 2006 at 03:14:06PM -0500, Dallas L. Engelken wrote:
> All those scores in the cf are just "WAGs", since none have been
> masschecked.   Theo, could you sandbox this?

Sure, as long as you don't mind me making some edits. :)

-- 
Randomly Generated Tagline:
"Where are all the great pot head writers?  There aren't any.  Because no
 one wants to read a book about the most delicious twinkie."
                         - Dave Attell, Insomniac, New York City, 2001

Re: ImageInfo plugin for SA

Posted by Spamassassin List <sp...@gmail.com>.
>Put the .pm file that is attached in your M::SA::Plugins dir.  Add to
>your init.pre (or v310.pre) the following line.

Where is the usual Plugins dir?

regards

Re: ImageInfo plugin for SA

Posted by "Michele Neylon:: Blacknight.ie" <mi...@blacknight.ie>.
Very nice. Over 100 hits on one box in less than half an hour!


-- 
Mr Michele Neylon
Blacknight Solutions
Quality Business Hosting & Colocation
http://www.blacknight.ie/
Tel. 1850 927 280
Intl. +353 (0) 59  9183072
Direct Dial: +353 (0)59 9183090
Fax. +353 (0) 59  9164239

Re: ImageInfo plugin for SA

Posted by Theo Van Dinter <fe...@apache.org>.
On Thu, Aug 03, 2006 at 05:42:17PM -0800, John Andersen wrote:
> So what happens next week when they switch to jpegs?

Sounds like a new function and set of rules. :)

> Btw: Very minor typo in:
> describe       DC_PNG_UNO_LARGO     Message contains a single large inline gif
> 
> You mean png for this one.

fixed. :)

-- 
Randomly Generated Tagline:
"A Young Eel is called this."            - Jeopardy Question
 "What is a baby eel Alex."                - Theo's Response

Re: ImageInfo plugin for SA

Posted by John Andersen <js...@pen.homeip.net>.
On Thursday 03 August 2006 16:50, Theo Van Dinter wrote:
> On Fri, Aug 04, 2006 at 02:38:48AM +0200, Raymond Dijkxhoorn wrote:
> > Could you post the altered one also somewhere ?
>
> Yeah, the files are in my sandbox:
> http://svn.apache.org/repos/asf/spamassassin/rules/trunk/sandbox/felicity/

So what happens next week when they switch to jpegs?

Btw: Very minor typo in:

meta            DC_PNG_UNO_LARGO     __PNG_ATTACH_1 && __PNG_AREA_180K
describe       DC_PNG_UNO_LARGO     Message contains a single large inline gif

You mean png for this one.



-- 
_____________________________________
John Andersen

Re: ImageInfo plugin for SA

Posted by Theo Van Dinter <fe...@apache.org>.
On Fri, Aug 04, 2006 at 09:36:17AM +0200, Jim Knuth wrote:
> > Yeah, the files are in my sandbox:
> > http://svn.apache.org/repos/asf/spamassassin/rules/trunk/sandbox/felicity/
> 
> only the two files, ImageInfo.pm - 70_imageinfo.cf? And the
> others?

When talking about the ImageInfo stuff, yes, just those two -- and you'll
want to move the loadplugin line from the cf to a pre file.

For those folks who don't know what the sandbox areas are, they're
"personal" directories where contributors can commit new rules for
testing.  If you're really interested, I have a link to the wiki doc
about sandboxes at the bottom of the mail.

So to answer the second question -- the other files are my other test
files.  You can peruse them (or any of the other sandboxes) if you
want, but generally remember that those are all rules in development.
If you want new rules/etc that have been tested and what not, stick
with sa-update.



http://wiki.apache.org/spamassassin/RuleSandboxes

-- 
Randomly Generated Tagline:
"I have been a happy man ever since January 1, 1990, when I no longer
 had an email address. I'd used email since about 1975, and it seems to
 me that 15 years of email is plenty for one lifetime."  - Donald Knuth

Re: ImageInfo plugin for SA

Posted by Jim Knuth <jk...@jkart.de>.
Heute (04.08.2006/02:50 Uhr) schrieb Theo Van Dinter,

> On Fri, Aug 04, 2006 at 02:38:48AM +0200, Raymond Dijkxhoorn wrote:
>> Could you post the altered one also somewhere ?

> Yeah, the files are in my sandbox:
> http://svn.apache.org/repos/asf/spamassassin/rules/trunk/sandbox/felicity/


only the two files, ImageInfo.pm - 70_imageinfo.cf? And the
others?


-- 
Viele Gruesse, Kind regards,
 Jim Knuth
 jk@jkart.de
 ICQ #277289867
----------
Zufalls-Zitat
----------
Ein nackter Ritter ist entrĂ¼stet.
----------
Der Text hat nichts mit dem Empfaenger der Mail zu tun
----------
Virus free. Checked by NOD32 Version 1.1691 Build 7788  03.08.2006


Re: ImageInfo plugin for SA

Posted by Raymond Dijkxhoorn <ra...@prolocation.net>.
Hi!

>> Could you post the altered one also somewhere ?
>
> Yeah, the files are in my sandbox:
> http://svn.apache.org/repos/asf/spamassassin/rules/trunk/sandbox/felicity/

Ok, perfect. Running nice.

On one box i have it together with the ocr one. So far the 'cheaper' rule 
is seeing about the same as the ocr.

Bye,
Raymond.

Re: ImageInfo plugin for SA

Posted by Theo Van Dinter <fe...@apache.org>.
On Fri, Aug 04, 2006 at 02:38:48AM +0200, Raymond Dijkxhoorn wrote:
> Could you post the altered one also somewhere ?

Yeah, the files are in my sandbox:
http://svn.apache.org/repos/asf/spamassassin/rules/trunk/sandbox/felicity/

-- 
Randomly Generated Tagline:
"Running Linux 1.2 Because a 486 is a terrible thing to waste." - Unknown

Re: ImageInfo plugin for SA

Posted by Raymond Dijkxhoorn <ra...@prolocation.net>.
Theo,

> On Thu, Aug 03, 2006 at 03:14:06PM -0500, Dallas L. Engelken wrote:
>> All those scores in the cf are just "WAGs", since none have been
>> masschecked.   Theo, could you sandbox this?

> I made some major edits (1/3 smaller and also faster :) ), but the core
> algorithm is the same.  Overall, very good from my results:
>
>  MSECS    SPAM%     HAM%     S/O    RANK   SCORE  NAME
>      0    29412     4952    0.856   0.00    0.00  (all messages)
> 0.00000  85.5896  14.4104    0.856   0.00    0.00  (all messages as %)
>  7.162   8.3673   0.0000    1.000   0.93    3.00  DC_GIF_UNO_LARGO
>  3.681   4.3010   0.0000    1.000   0.79    3.00  DC_IMAGE_SPAM
>  0.576   0.6732   0.0000    1.000   0.24    3.00  DC_PNG_UNO_LARGO
>  0.000   0.0000   0.0000    0.500   0.17    4.00  DC_PNG_MULTI_LARGO
>  0.000   0.0000   0.0000    0.500   0.17    4.00  DC_GIF_MULTI_LARGO

Could you post the altered one also somewhere ?

Thanks,
Raymond.

Re: ImageInfo plugin for SA

Posted by Theo Van Dinter <fe...@apache.org>.
On Thu, Aug 03, 2006 at 03:14:06PM -0500, Dallas L. Engelken wrote:
> All those scores in the cf are just "WAGs", since none have been
> masschecked.   Theo, could you sandbox this?

I made some major edits (1/3 smaller and also faster :) ), but the core
algorithm is the same.  Overall, very good from my results:

  MSECS    SPAM%     HAM%     S/O    RANK   SCORE  NAME
      0    29412     4952    0.856   0.00    0.00  (all messages)
0.00000  85.5896  14.4104    0.856   0.00    0.00  (all messages as %)
  7.162   8.3673   0.0000    1.000   0.93    3.00  DC_GIF_UNO_LARGO
  3.681   4.3010   0.0000    1.000   0.79    3.00  DC_IMAGE_SPAM
  0.576   0.6732   0.0000    1.000   0.24    3.00  DC_PNG_UNO_LARGO
  0.000   0.0000   0.0000    0.500   0.17    4.00  DC_PNG_MULTI_LARGO
  0.000   0.0000   0.0000    0.500   0.17    4.00  DC_GIF_MULTI_LARGO

-- 
Randomly Generated Tagline:
"Today I set a motherboard on fire. Now the bizarre thing is that after 
 the smoke cleared it still worked." - Alan Cox

Re: ImageInfo plugin for SA

Posted by Jason Haar <Ja...@trimble.co.nz>.
Just a comment to Dallas that his (? making a guess there) ImageInfo
module seems to be doing a good job for me.

I had a small sample of image-spam that currently gets past SA. Almost
all of it scored +4/+5 points with his module activated.

I also had a few recent inline-images "real" emails - didn't trigger any
of these rules.

So far I'm impressed :-)

Jason

-- 
Cheers

Jason Haar
Information Security Manager, Trimble Navigation Ltd.
Phone: +64 3 9635 377 Fax: +64 3 9635 417
PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1


Re: ImageInfo plugin for SA

Posted by "Michele Neylon:: Blacknight.ie" <mi...@blacknight.ie>.
Very nice. Over 100 hits on one box in less than half an hour!


-- 
Mr Michele Neylon
Blacknight Solutions
Quality Business Hosting & Colocation
http://www.blacknight.ie/
Tel. 1850 927 280
Intl. +353 (0) 59  9183072
Direct Dial: +353 (0)59 9183090
Fax. +353 (0) 59  9164239

Re: ImageInfo plugin for SA

Posted by MennovB <mv...@xs4all.nl>.
I'm having a bit of troubles to get this ImageInfo to hit anything.
For example the  attached image gives no hit, maybe because it seems to be
snowing on the image or because I configured something wrong.
Could somebody check if this viewer81.gif picture triggers the imageinfo
rule?
(first time I upload a file with nabble so not sure how it will appear)

http://www.nabble.com/user-files/196/viewer81.gif viewer81.gif 

Thanks
Menno van Bennekom

-- 
View this message in context: http://www.nabble.com/ImageInfo-plugin-for-SA-tf2047808.html#a5651232
Sent from the SpamAssassin - Users forum at Nabble.com.


Re: ImageInfo plugin for SA

Posted by Wolfgang Zeikat <wo...@desy.de>.
Will that work in SA 3.0.*?

Sorry for first sending that question to you off list, Dallas.

cheers,

wolfgang



Re: ImageInfo plugin for SA

Posted by Jason Haar <Ja...@trimble.co.nz>.
Just a comment to Dallas that his (? making a guess there) ImageInfo
module seems to be doing a good job for me.

I had a small sample of image-spam that currently gets past SA. Almost
all of it scored +4/+5 points with his module activated.

I also had a few recent inline-images "real" emails - didn't trigger any
of these rules.

So far I'm impressed :-)

Jason

-- 
Cheers

Jason Haar
Information Security Manager, Trimble Navigation Ltd.
Phone: +64 3 9635 377 Fax: +64 3 9635 417
PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1


RE: ImageInfo plugin for SA

Posted by Dave Koontz <dk...@mbc.edu>.
Many Thanks Dallas, this plugin Rocks!  It's amazing how many image only
spams this baby has flagged in the short time I've been running it.


-----Original Message-----
From: Dallas L. Engelken [mailto:dallase@nmgi.com] 
Sent: Thursday, August 03, 2006 4:14 PM
To: dev@spamassassin.apache.org
Cc: users@spamassassin.apache.org
Subject: ImageInfo plugin for SA

Greetings,

For those of you that dont want the overhead or hassel of installing all
extras to get OCR running, I give you a simpler (maybe less effective)
option..  It basically determines pixel coverage similar to what
eval:html_image_ratio() does, but html_image_ratio() actually reads
height="" and width="" params from html, and in these stock spams and
such, there is no height/width values to go off of.   So,
eval:pixel_coverage()  will actually read the gif and png headers and
calculate it from the actual image data. 

Put the .pm file that is attached in your M::SA::Plugins dir.  Add to your
init.pre (or v310.pre) the following line.

loadplugin Mail::SpamAssassin::Plugin::ImageInfo

And throw the imageinfo.cf ruleset in your local config dir (tweak
rules/scores as needed).  And dont forgot to restart spamd if you are
running it.   Feel free to tweak the ruleset you meet your needs.  It
has hit well for me today as is, but YMMV.

# grep -c _LARGO spamd.log
868

No outside tools required... yeah!   Sorry for the lack of
documentation, but I just dont have enough time to do it, and I wanted share
this.

All those scores in the cf are just "WAGs", since none have been
masschecked.   Theo, could you sandbox this?

Cya,
Dallas