# Configuring pyzor (SOLVED)

## JC99

Hello everyone,

I have 2 problems.

1) I "emerge pyzor" and it says...

 *Quote:*   

> DeprecationWarning: the sha module is deprecated; use the hashlib module instead

 

How do I use hashlib module instead. Where do I configure this?

2) How do I configure pyzor. I add "use_pyzor 1" to my /etc/spamassassin/local.cf file but when I check email headers there is no mention of pyzor being used?Last edited by JC99 on Mon Jan 25, 2010 7:32 pm; edited 3 times in total

----------

## cach0rr0

no idea regarding #1 (ill look at my config and see if i can find anything - im just jotting this down as a reminder to look)

EDIT: Ok, I see the same on mine if I just run `pyzor` on the command line. My pyzor is functional far as I can tell, so I'd imagine you can safely ignore it. 

```

gentoob0x spamassassin # pyzor

/usr/lib64/python2.6/site-packages/pyzor/__init__.py:11: DeprecationWarning: the sha module is deprecated; use the hashlib module instead

  import sha

/usr/lib64/python2.6/site-packages/pyzor/client.py:12: DeprecationWarning: the multifile module has been deprecated since Python 2.5

  import multifile

```

I assume it's working because

 *grep -i pyzor /var/log/mail.log | head -n 1 wrote:*   

> 
> 
> Jan 24 05:32:35 gentoob0x amavis[14562]: (14562-02) SPAM, <yepaweca4969@tele2.at> -> <root@whitehathouston.com>, Yes, score=18.534 tag=2 tag2=4 kill=5 tests=[DCC_CHECK=1.37, DIGEST_MULTIPLE=0.001, DKIM_POLICY_SIGNSOME=0, HTML_IMAGE_ONLY_32=1.318, HTML_IMAGE_RATIO_02=0.55, HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.672, MISSING_DATE=0.001, MISSING_MID=0.001, PYZOR_CHECK=2.834, RAZOR2_CF_RANGE_51_100=0.5, RAZOR2_CF_RANGE_E8_51_100=1.5, RAZOR2_CHECK=0.5, RB_GENR_HTMLTable=0.1, RB_GENR_HttpLink=0.1, RDNS_DYNAMIC=0.1, RH_GENR_HeloDomain=0.3, RS_GENR_PercentValue=0.9, RS_GENR_SavePercent=1, URIBL_AB_SURBL=1.613, URIBL_JP_SURBL=2.857, URI_HEX=1.316], autolearn=disabled, quarantine VHNqlW0few+N (spam-quarantine)

 

</EDIT>

regarding #2, my local.cf is just

```

rewrite_header Subject [**SPAM**]

required_score 6.0

use_bayes 0

skip_rbl_checks 0

ok_languages de en no sv

ok_locales en

bayes_path /var/amavis/.spamassassin/bayes

include /etc/mail/spamassassin/custom/20_header.cf

include /etc/mail/spamassassin/custom/20_body.cf

```

certain portions of it are overridden in amavis.conf, but that's neither here nor there. 

For me to enable Pyzor, it was just a matter of uncommenting it in /etc/mail/spamassassin/v310.pre

```

loadplugin Mail::SpamAssassin::Plugin::Pyzor

```

You'll get a cert error, but I have all of my mail system settings up here - https://whitehathouston.com/topics/index.php/WHHMail

Hope that helps

----------

## JC99

1) Ok, I will leave it as is for now

2)I checked /etc/mail/spamassassin/v310.pre and "loadplugin Mail::SpamAssassin::Plugin::Pyzor" is already uncommented yet Pyzor is not working. I don't know why?

----------

## cach0rr0

what indicator do you have that it isn't working? 

I ask because my hit rate with pyzor is...well, exceptionally low, so if you're purely checking for its tag in headers, you'll find it quite rarely. 

To confirm the plugin is being loaded, try this:

```

spamassassin -D --lint

```

you should see something like

```

[29166] dbg: plugin: loading Mail::SpamAssassin::Plugin::Pyzor from @INC                 

[29166] dbg: pyzor: local tests only, disabling Pyzor            

```

----------

## JC99

Yeah, I was looking at headers for any mention of pyzor. Thanks for letting me know the hit rate is low.

ok, I ran that command and here was the output...

 *Quote:*   

> [9725] dbg: plugin: loading Mail::SpamAssassin::Plugin::Pyzor from @INC
> 
> [9725] dbg: pyzor: local tests only, disabling Pyzor

 

So it is being disabled. How do I enable it?

----------

## cach0rr0

It's only disabled for that test

that test runs local checks only - by that i mean no DCC, no Razor, no Pyzor, nothing like that

```

[30094] dbg: plugin: loading Mail::SpamAssassin::Plugin::URIDNSBL from @INC              

[30094] dbg: plugin: loading Mail::SpamAssassin::Plugin::DCC from @INC                   

[30094] dbg: dcc: local tests only, disabling DCC                                        

[30094] dbg: plugin: loading Mail::SpamAssassin::Plugin::Pyzor from @INC                 

[30094] dbg: pyzor: local tests only, disabling Pyzor                                    

[30094] dbg: plugin: loading Mail::SpamAssassin::Plugin::Razor2 from @INC                

[30094] dbg: razor2: local tests only, skipping Razor                                    

[30094] dbg: plugin: loading Mail::SpamAssassin::Plugin::SpamCop from @INC               

[30094] dbg: reporter: local tests only, disabling SpamCop                               

[30094] dbg: plugin: loading Mail::SpamAssassin::Plugin::AntiVirus from @INC             

[30094] dbg: plugin: loading Mail::SpamAssassin::Plugin::AWL from @INC                   

[30094] dbg: plugin: loading Mail::SpamAssassin::Plugin::AutoLearnThreshold from @INC  

```

You should be good to go with pyzor provided you see the plugin actually getting loaded (it being disabled the line after is expected, and no biggie)

If you're supremely curious - dunno if you use razor2, but it should yield a considerably greater hit rate; if you emerge razor (see the section here for its initial setup), set it up, and uncomment its plugin line within v310.pre, you should see it on a fair chunk of your headers. 

Or DCC actually, it's been getting a notably better hit rate for me recently than razor2. ANYWAY, your setup looks kosher, and again, if you're worried the non-local checks aren't being applied, snag razor or dcc from portage, and keep an eye out for *those* headers. You should find them appended happily.

----------

## JC99

ok, good to know I have everything setup correctly. 

I'll look into DCC and Razor2.

Thanks for your help.

----------

