You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Jezz <je...@fairbrass.co.nz> on 2011/07/12 15:21:07 UTC

DecodeShortURLs plugin

Hi folks,
I've been getting a bit of spam lately that is slipping easily past my 
SpamAssassin - mostly "work from home" stuff that is just plain text and a 
single URL which uses a URL shortening service, and it doesn't hit on much.

I've tried to add the DecodeShortURLs plugin (from 
http://www.fsl.com/support/DecodeShortURLs.pm and 
http://www.fsl.com/support/DecodeShortURLs.cf) which I think/hope will help 
a lot with detecting the spammy URLs.

However, when I tried to impliment this plugin, I discovered that it 
requires the Sys::Syslog module, and I don't have that module included on my 
system. The reason is that I'm running SpamAssassin on Windows, as part of 
the Windows-based MDaemon mail server. And I guess the MDaemon developers 
didn't include the Syslog module as it's obviously not a required module for 
Windows usage (at least not with their implimentation of SpamAssassin).

So my question is this: is there any way I can get the DecodeShortURLs 
plugin working without the Syslog module requirement? Eg. can I get this 
plugin to only view Syslog as an optional and not mandatory prerequisite? I 
certainly don't need the Syslog functionality of this plugin, and the plugin 
itself allows me to "turn off" Syslog logging by adding 
"url_shortener_syslog 0" to the .cf file. Yet it seems to still require the 
Syslog module in order to work (otherwise I get errors when I run a lint 
check).

Any suggestions??

Thanks!



Re: DecodeShortURLs plugin

Posted by Jezz <je...@fairbrass.co.nz>.
<da...@chaosreigns.com> wrote in message 
news:20110712164439.GC20505@chaosreigns.com...
> On 07/12, Jezz wrote:
>> So my question is this: is there any way I can get the
>> DecodeShortURLs plugin working without the Syslog module
>> requirement? Eg. can I get this plugin to only view Syslog as an
>> optional and not mandatory prerequisite? I certainly don't need the
>> Syslog functionality of this plugin, and the plugin itself allows me
>> to "turn off" Syslog logging by adding "url_shortener_syslog 0" to
>> the .cf file. Yet it seems to still require the Syslog module in
>> order to work (otherwise I get errors when I run a lint check).
>
> It's likely to be as easy as commenting out a "use Sys::Syslog" line in 
> the
> plugin.
>
> You may be more likely to get help from its creator (Steve Freegard,
> as listed on http://wiki.apache.org/spamassassin/CustomPlugins) than
> this list, because it's not a part of spamassassin (although it was
> certainly appropriate for you to ask here).
>
> You may want to suggest to him that he only execute the "use Sys::Syslog"
> if you have not turned off the syslog functionality.  Even if you get it 
> to
> work by just commenting out a line, it might be nice to get that working
> for others in the future.
>


Unfortunately I already tried that without much luck. Specifically, I 
outright deleted line 99 of the DecodeShortURLs.pm file which says:

use Sys::Syslog qw(:DEFAULT setlogsock);

Then I ran another lint and I didn't get any errors at all - rather, I got 
the following in the results, indicating all was okay:

--------
Jul 13 12:49:02.518 [1436] dbg: plugin: loading 
Mail::SpamAssassin::Plugin::DecodeShortURLs from 
C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm
--------

But then I tested it by scanning a spam message I had saved. The spam 
contained a URL which used a shortening service that was listed in the 
DecodeShortURLs.cf file. But none of the DecodeShortURLs rules were hit, 
such as HAS_SHORT_URL which I would have expected to see. No other errors 
came up either. So I'm baffled why it's not working.

Incidentally, I did write to Steve Freegard last week, asking for his help 
with this, but so far I haven't had a reply (of course it could be he's 
away/busy/whatever, I'm certainly not meaning to be impatient) - so I 
thought I'd ask here in case someone else might have an idea. :)



Re: DecodeShortURLs plugin

Posted by Martin Hepworth <ma...@gmail.com>.
Put SA on a dedicated gateway machine then you have problems of SA
using up resources on the main mailserver, maybe would sort the
issue???

Martin

On Tuesday, 12 July 2011,  <da...@chaosreigns.com> wrote:
> On 07/12, Jezz wrote:
>> So my question is this: is there any way I can get the
>> DecodeShortURLs plugin working without the Syslog module
>> requirement? Eg. can I get this plugin to only view Syslog as an
>> optional and not mandatory prerequisite? I certainly don't need the
>> Syslog functionality of this plugin, and the plugin itself allows me
>> to "turn off" Syslog logging by adding "url_shortener_syslog 0" to
>> the .cf file. Yet it seems to still require the Syslog module in
>> order to work (otherwise I get errors when I run a lint check).
>
> It's likely to be as easy as commenting out a "use Sys::Syslog" line in the
> plugin.
>
> You may be more likely to get help from its creator (Steve Freegard,
> as listed on http://wiki.apache.org/spamassassin/CustomPlugins) than
> this list, because it's not a part of spamassassin (although it was
> certainly appropriate for you to ask here).
>
> You may want to suggest to him that he only execute the "use Sys::Syslog"
> if you have not turned off the syslog functionality.  Even if you get it to
> work by just commenting out a line, it might be nice to get that working
> for others in the future.
>
> --
> "Where are you going and what do you wish?"
> - The Old Moon, to Winkin' Blinkin' and Nod
> http://www.ChaosReigns.com
>

-- 
-- 
Martin Hepworth
Oxford, UK

Re: DecodeShortURLs plugin

Posted by da...@chaosreigns.com.
On 07/12, Jezz wrote:
> So my question is this: is there any way I can get the
> DecodeShortURLs plugin working without the Syslog module
> requirement? Eg. can I get this plugin to only view Syslog as an
> optional and not mandatory prerequisite? I certainly don't need the
> Syslog functionality of this plugin, and the plugin itself allows me
> to "turn off" Syslog logging by adding "url_shortener_syslog 0" to
> the .cf file. Yet it seems to still require the Syslog module in
> order to work (otherwise I get errors when I run a lint check).

It's likely to be as easy as commenting out a "use Sys::Syslog" line in the
plugin.

You may be more likely to get help from its creator (Steve Freegard,
as listed on http://wiki.apache.org/spamassassin/CustomPlugins) than
this list, because it's not a part of spamassassin (although it was
certainly appropriate for you to ask here).

You may want to suggest to him that he only execute the "use Sys::Syslog"
if you have not turned off the syslog functionality.  Even if you get it to
work by just commenting out a line, it might be nice to get that working
for others in the future.

-- 
"Where are you going and what do you wish?"
- The Old Moon, to Winkin' Blinkin' and Nod
http://www.ChaosReigns.com

Re: DecodeShortURLs plugin

Posted by Jezz <je...@fairbrass.co.nz>.
"Axb" <ax...@gmail.com> wrote in message 
news:4E1C820D.3000109@gmail.com...
> On 2011-07-12 15:21, Jezz wrote:
>>
>> So my question is this: is there any way I can get the DecodeShortURLs
>> plugin working without the Syslog module requirement? Eg. can I get this
>> plugin to only view Syslog as an optional and not mandatory
>> prerequisite? I certainly don't need the Syslog functionality of this
>> plugin, and the plugin itself allows me to "turn off" Syslog logging by
>> adding "url_shortener_syslog 0" to the .cf file. Yet it seems to still
>> require the Syslog module in order to work (otherwise I get errors when
>> I run a lint check).
>>
>> Any suggestions??
>
> whathappens if you comment out those lines
>
> #url_shortener_log /tmp/DecodeShortURLs.txt
> #url_shortener_cache /tmp/DecodeShortURLs.sq3
> #url_shortener_syslog 1
>

I tried commenting out those three lines. Then I linted SpamAssassin and got 
the following:

Jul 13 12:31:47.190 [2020] dbg: plugin: loading 
Mail::SpamAssassin::Plugin::DecodeShortURLs from 
C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm
Jul 13 12:31:47.251 [2020] warn: plugin: failed to parse plugin 
C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm: Can't locate Sys/Syslog.pm 
in @INC (@INC contains: C:\Perl\site\lib C:\MDaemon\SpamAssassin) at 
C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm line 99.
Jul 13 12:31:47.251 [2020] warn: BEGIN failed--compilation aborted at C: 
[...]\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm line 99.


So even commenting out those lines doesn't help, as the plugin still 
requires the Syslog module which I don't have. :( 



Re: DecodeShortURLs plugin

Posted by Axb <ax...@gmail.com>.
On 2011-07-14 18:03, Jezz wrote:
>
> "Axb" <ax...@gmail.com> wrote in message
> news:4E1E129B.7020207@gmail.com...
>> On 2011-07-13 23:35, Jezz wrote:
>>
>> LWP is what the plugin uses to fetch the web site so if you don't have
>> that available it won't work at all.
>> if MDaemon provides a port of sa-update LWP may be supported
>>
>> shot in the dark:
>>
>> what happens if you comment out as:
>> # use Sys::Syslog qw(:DEFAULT setlogsock);
>>
>> Calling SteveF... would you hack syslog out of the plugin for Win32
>> users?
>>
>> :)
>>
>
> I tried commenting out that line, and then did a lint, and it gave me no
> errors at all - not regarding LWP either. Tell me, should I expect to
> see an
> error regarding LWP if, I in fact, didn't have that package?
>
> MDaemon does indeed provide a port of sa-update. However it's theoretically
> possible that Mouk may not have included a particular package (eg. LWP)
> within the spamd executable even though it is included in the sa-update
> executable. I have noticed in the past some small discrepancies in the
> packages which Mouk includes, or doesn't include, between those two
> executables. So I may need to ask him directly about that.
>
> Nevertheless, I'm interested in knowing if I should expect to see some kind
> of error, when I do a lint, if I don't have LWP yet a plugin is requiring

LWP is "the browser" that grabs the cloacked URI and "follows" to the 
target.
Without it, the plugin is useless.

http://search.cpan.org/~gaas/libwww-perl-6.02/lib/LWP.pm
tells you what it does.


Re: DecodeShortURLs plugin

Posted by Jezz <je...@fairbrass.co.nz>.
"Axb" <ax...@gmail.com> wrote in message
news:4E1E129B.7020207@gmail.com...
> On 2011-07-13 23:35, Jezz wrote:
>
> LWP is what the plugin uses to fetch the web site so if you don't have
> that available it won't work at all.
> if MDaemon provides a port of sa-update LWP may be supported
>
> shot in the dark:
>
> what happens if you comment out as:
> # use Sys::Syslog qw(:DEFAULT setlogsock);
>
> Calling SteveF... would you hack syslog out of the plugin for Win32 users?
>
> :)
>

I tried commenting out that line, and then did a lint, and it gave me no
errors at all - not regarding LWP either. Tell me, should I expect to see an
error regarding LWP if, I in fact, didn't have that package?

MDaemon does indeed provide a port of sa-update. However it's theoretically
possible that Mouk may not have included a particular package (eg. LWP)
within the spamd executable even though it is included in the sa-update
executable. I have noticed in the past some small discrepancies in the
packages which Mouk includes, or doesn't include, between those two
executables. So I may need to ask him directly about that.

Nevertheless, I'm interested in knowing if I should expect to see some kind
of error, when I do a lint, if I don't have LWP yet a plugin is requiring
it.



Re: DecodeShortURLs plugin

Posted by Axb <ax...@gmail.com>.
On 2011-07-13 23:35, Jezz wrote:
>
> "Axb" <ax...@gmail.com> wrote in message
> news:4E1DF659.2070308@gmail.com...
>> On 2011-07-13 20:23, Jezz wrote:
>>> "Axb" <ax...@gmail.com> wrote in message
>>> news:4E1C820D.3000109@gmail.com...
>>>> On 2011-07-12 15:21, Jezz wrote:
>>>
>>> So even commenting out those lines doesn't help, as the plugin still
>>> requires the Syslog module which I don't have. :(
>>
>> MDaemon uses a compiled Windows version of SpamAssassin.
>> The plugin has more requirements which AltN's version may not support
>>
>> DBD::SQLite
>> and possibly LWP::UserAgent
>>
>> You'll most probably be better off asking Mouk of AltN (if he's still
>> there) to add DecodeShortURL support in their package.
>>
>> You could also hack the hell out of the plugin to remove all those
>> requirements.
>> MDameon's Beta mailing list may get you further.
>>
>> Sorry...
>>
>
> Hmm - but the way I understand the plugin, the SQLite and UserAgent
> packages are only optional packages for the plugin, not mandatory as the
> Syslog package is. And I'm not getting any lint errors regarding the
> SQLite and UserAgent packages either, which (I would assume) indicates
> that they are not a problem. Surely they would pop up as errors when I
> do a lint, if they were mandatory requirements and I didn't have them in
> my compilation of SpamAssassin?

LWP is what the plugin uses to fetch the web site so if you don't have 
that available it won't work at all.
if MDaemon provides a port of sa-update LWP may be supported

shot in the dark:

what happens if you comment out as:
# use Sys::Syslog qw(:DEFAULT setlogsock);

Calling SteveF... would you hack syslog out of the plugin for Win32 users?

:)


Re: DecodeShortURLs plugin

Posted by Jezz <je...@fairbrass.co.nz>.
"Axb" <ax...@gmail.com> wrote in message 
news:4E1DF659.2070308@gmail.com...
> On 2011-07-13 20:23, Jezz wrote:
>> "Axb" <ax...@gmail.com> wrote in message
>> news:4E1C820D.3000109@gmail.com...
>>> On 2011-07-12 15:21, Jezz wrote:
>>
>> So even commenting out those lines doesn't help, as the plugin still
>> requires the Syslog module which I don't have. :(
>
> MDaemon uses a compiled Windows version of SpamAssassin.
> The plugin has more requirements which AltN's version may not support
>
> DBD::SQLite
> and possibly LWP::UserAgent
>
> You'll most probably be better off asking Mouk of AltN (if he's still 
> there) to add DecodeShortURL support in their package.
>
> You could also hack the hell out of the plugin to remove all those 
> requirements.
> MDameon's Beta mailing list may get you further.
>
> Sorry...
>

Hmm - but the way I understand the plugin, the SQLite and UserAgent packages 
are only optional packages for the plugin, not mandatory as the Syslog 
package is. And I'm not getting any lint errors regarding the SQLite and 
UserAgent packages either, which (I would assume) indicates that they are 
not a problem. Surely they would pop up as errors when I do a lint, if they 
were mandatory requirements and I didn't have them in my compilation of 
SpamAssassin?



Re: DecodeShortURLs plugin

Posted by Axb <ax...@gmail.com>.
On 2011-07-13 20:23, Jezz wrote:
> "Axb" <ax...@gmail.com> wrote in message
> news:4E1C820D.3000109@gmail.com...
>> On 2011-07-12 15:21, Jezz wrote:
>>>
>>> So my question is this: is there any way I can get the DecodeShortURLs
>>> plugin working without the Syslog module requirement? Eg. can I get this
>>> plugin to only view Syslog as an optional and not mandatory
>>> prerequisite? I certainly don't need the Syslog functionality of this
>>> plugin, and the plugin itself allows me to "turn off" Syslog logging by
>>> adding "url_shortener_syslog 0" to the .cf file. Yet it seems to still
>>> require the Syslog module in order to work (otherwise I get errors when
>>> I run a lint check).
>>>
>>> Any suggestions??
>>
>> whathappens if you comment out those lines
>>
>> #url_shortener_log /tmp/DecodeShortURLs.txt
>> #url_shortener_cache /tmp/DecodeShortURLs.sq3
>> #url_shortener_syslog 1
>>
>
> I tried commenting out those three lines. Then I linted SpamAssassin and
> got
> the following:
>
> Jul 13 12:31:47.190 [2020] dbg: plugin: loading
> Mail::SpamAssassin::Plugin::DecodeShortURLs from
> C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm
> Jul 13 12:31:47.251 [2020] warn: plugin: failed to parse plugin
> C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm: Can't locate Sys/Syslog.pm
> in @INC (@INC contains: C:\Perl\site\lib C:\MDaemon\SpamAssassin) at
> C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm line 99.
> Jul 13 12:31:47.251 [2020] warn: BEGIN failed--compilation aborted at C:
> [...]\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm line 99.
>
>
> So even commenting out those lines doesn't help, as the plugin still
> requires the Syslog module which I don't have. :(

MDaemon uses a compiled Windows version of SpamAssassin.
The plugin has more requirements which AltN's version may not support

DBD::SQLite
and possibly LWP::UserAgent

You'll most probably be better off asking Mouk of AltN (if he's still 
there) to add DecodeShortURL support in their package.

You could also hack the hell out of the plugin to remove all those 
requirements.
MDameon's Beta mailing list may get you further.

Sorry...




Re: DecodeShortURLs plugin

Posted by Jezz <je...@fairbrass.co.nz>.
"Axb" <ax...@gmail.com> wrote in message
news:4E1C820D.3000109@gmail.com...
> On 2011-07-12 15:21, Jezz wrote:
>>
>> So my question is this: is there any way I can get the DecodeShortURLs
>> plugin working without the Syslog module requirement? Eg. can I get this
>> plugin to only view Syslog as an optional and not mandatory
>> prerequisite? I certainly don't need the Syslog functionality of this
>> plugin, and the plugin itself allows me to "turn off" Syslog logging by
>> adding "url_shortener_syslog 0" to the .cf file. Yet it seems to still
>> require the Syslog module in order to work (otherwise I get errors when
>> I run a lint check).
>>
>> Any suggestions??
>
> whathappens if you comment out those lines
>
> #url_shortener_log /tmp/DecodeShortURLs.txt
> #url_shortener_cache /tmp/DecodeShortURLs.sq3
> #url_shortener_syslog 1
>

I tried commenting out those three lines. Then I linted SpamAssassin and got
the following:

Jul 13 12:31:47.190 [2020] dbg: plugin: loading
Mail::SpamAssassin::Plugin::DecodeShortURLs from
C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm
Jul 13 12:31:47.251 [2020] warn: plugin: failed to parse plugin
C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm: Can't locate Sys/Syslog.pm
in @INC (@INC contains: C:\Perl\site\lib C:\MDaemon\SpamAssassin) at
C:\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm line 99.
Jul 13 12:31:47.251 [2020] warn: BEGIN failed--compilation aborted at C:
[...]\MDaemon\SpamAssassin\etc\DecodeShortURLs.pm line 99.


So even commenting out those lines doesn't help, as the plugin still
requires the Syslog module which I don't have. :(



Re: DecodeShortURLs plugin

Posted by Axb <ax...@gmail.com>.
On 2011-07-12 15:21, Jezz wrote:
> Hi folks,
> I've been getting a bit of spam lately that is slipping easily past my
> SpamAssassin - mostly "work from home" stuff that is just plain text and
> a single URL which uses a URL shortening service, and it doesn't hit on
> much.
>
> I've tried to add the DecodeShortURLs plugin (from
> http://www.fsl.com/support/DecodeShortURLs.pm and
> http://www.fsl.com/support/DecodeShortURLs.cf) which I think/hope will
> help a lot with detecting the spammy URLs.
>
> However, when I tried to impliment this plugin, I discovered that it
> requires the Sys::Syslog module, and I don't have that module included
> on my system. The reason is that I'm running SpamAssassin on Windows, as
> part of the Windows-based MDaemon mail server. And I guess the MDaemon
> developers didn't include the Syslog module as it's obviously not a
> required module for Windows usage (at least not with their
> implimentation of SpamAssassin).
>
> So my question is this: is there any way I can get the DecodeShortURLs
> plugin working without the Syslog module requirement? Eg. can I get this
> plugin to only view Syslog as an optional and not mandatory
> prerequisite? I certainly don't need the Syslog functionality of this
> plugin, and the plugin itself allows me to "turn off" Syslog logging by
> adding "url_shortener_syslog 0" to the .cf file. Yet it seems to still
> require the Syslog module in order to work (otherwise I get errors when
> I run a lint check).
>
> Any suggestions??

whathappens if you comment out those lines

#url_shortener_log /tmp/DecodeShortURLs.txt
#url_shortener_cache /tmp/DecodeShortURLs.sq3
#url_shortener_syslog 1