Open Schroeffu opened 6 years ago
Would really love a fix :-)
Currently, i can only give 0.01 points to PYZOR because empty mails - only subject/attachement, no text - creates a lot of false positives. :- (
I'd like to clarify that this bug affects all whitelisted messages not just "empty" ones with digest da39a3ee5e6b4b0d3255bfef95601890afd80709
.
I am currently testing the following changes:
--- /usr/lib/python3/dist-packages/pyzor/client.py 2017-09-05 16:41:23.000000000 +0200
+++ client.73.py 2021-07-13 18:41:21.448102172 +0200
@@ -119,6 +119,6 @@
def _mock_check(self, digests, address=None):
- msg = (b"Code: %s\nDiag: OK\nPV: %s\nThread: 1024\nCount: 0\n"
- b"WL-Count: 0" % (pyzor.message.Response.ok_code,
+ msg = ("Code: %s\nDiag: OK\nPV: %s\nThread: 1024\nCount: 0\n"
+ "WL-Count: 0" % (pyzor.message.Response.ok_code,
pyzor.proto_version))
- return email.message_from_bytes(msg, _class=pyzor.message.Response)
+ return email.message_from_bytes(msg.encode(), _class=pyzor.message.Response)
I.e., remove the 2 b
encoders in msg =
and change msg
to msg.encode()
in the return statement.
Disclaimer: I do not know Python. The above works for me for now.
Thanks, it works great!
% echo | pyzor check
public.pyzor.org:24441 (200, 'OK') 24308494 243371
% echo | pyzor local_whitelist
% echo | pyzor check
public.pyzor.org:24441 (200, 'OK') 0 0
can not somebody make a release of this fix?
Version information
1.0.0
Steps to replicate
Add file /etc/MailScanner/pyzor/config with default content from https://github.com/SpamExperts/pyzor/blob/master/config/config.sample
Edit line 22 where to load the local whitelist file like this:
Enter the Hash
da39a3ee5e6b4b0d3255bfef95601890afd80709
in this file as the only content and only line.Restart Spamassassin (or MailScanner, that restarts SpamAssassin anyway)
Test Pyzor now with
echo "test" | spamassassin -D pyzor 2>&1 | less
will throw an error like this:Actual result
Expected result
Whitelist Hash da39a3ee5e6b4b0d3255bfef95601890afd80709 which represents emails without body content but Attachements/Subjects (billings, pdfs from suppliers, etc, huge amount of false positives)
Other notes
What am I doing wrong? Shouldn't be the format of the whitelist-file only a hash line-by-line?
When I add another number at the end like this:
da39a3ee5e6b4b0d3255bfef95601890afd80709 0
Pyzor is working again but still not whitelisting this hash.