You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by si...@apache.org on 2023/01/11 01:03:33 UTC

svn commit: r1906589 - in /spamassassin/trunk/t: data/spam/pyzor pyzor.t

Author: sidney
Date: Wed Jan 11 01:03:33 2023
New Revision: 1906589

URL: http://svn.apache.org/viewvc?rev=1906589&view=rev
Log:
Bug 8041 - Add a report step to pyzor test and use a GTUBE test case with lines that pyzor uses in digest

Modified:
    spamassassin/trunk/t/data/spam/pyzor
    spamassassin/trunk/t/pyzor.t

Modified: spamassassin/trunk/t/data/spam/pyzor
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/data/spam/pyzor?rev=1906589&r1=1906588&r2=1906589&view=diff
==============================================================================
--- spamassassin/trunk/t/data/spam/pyzor (original)
+++ spamassassin/trunk/t/data/spam/pyzor Wed Jan 11 01:03:33 2023
@@ -1,98 +1,14 @@
-Received: by mx.example.com (Postfix, from userid 570)
-	id 22BAF1FC0F; Tue, 28 Sep 2021 09:25:37 +0200 (CEST)
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yosida.com; s=dkim;
-	t=1632813937; bh=8J4+8ctxvQGNERxYJ4WMET9ZXSCtdKQquZ3yQYozrpU=;
-	h=From:To:Subject:Date;
-	b=jR37vyQheefLD1KxAX4TRuL1YkEtmNKEvot5i+cpnhnGGqINO7LgplqbkMCTHbXCO
-	 o1fQZw9aO2HsYCrkdAGBGNVu+Vg7Tqss+VxbBYogtfzLUfA3y3C4wP/6ONhcY9IQ+i
-	 9eDBqJAvxHCECm5uk2H1fTBYZ7L+8ujWqXaYaLtnyE3oBfix/pcI4aAbNu2DyLLd1L
-	 5ER7uenSRO6fh+a93wyFIWFREakb7eEn+rRIfStFlPolcw6OXkEGcrmpwa05nT+T0T
-	 bI++oK1QKQoLUd8gYoQFYGerH++ILOAvmivexXcIW2sl+/qF5C2NyyYxNFVlSSxeP9
-	 dvrMZIw3+hVMA==
-Received: from mail0.yosida.com ([128.199.171.92])
-	by mx.example.com (envelope-sender <po...@yosida.com>) (MIMEDefang) with ESMTP id 8C0721FC0E
-	for <je...@domain.com>; Tue, 28 Sep 2021 09:25:37 +0200
-Authentication-Results: mx.example.com;
-	dkim=fail reason="key not found in DNS" (0-bit key) header.d=yosida.com header.i=post@yosida.com header.b=uJK9117e
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=default; d=yosida.com;
- h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:
- Content-Transfer-Encoding; i=post@yosida.com;
- bh=t9NEsEhOFwMeUkvfG2ZMI5VnKgBZQqmriPfFY7EHtgY=;
- b=uJK9117eqYEF1xwcwkzR1Hy2trPZueNeEQwYB8y4F9sGyp00j2UU0SRHWD3NwAIgTAxu37uN3FFe
-   iY4bemqBpG47OcL07JuPdZOFkaYC36s5nW5+FMVVCY1LVoRh+U7uueGDLdpv+9GtXgNavaXubt2f
-   AIE06lXP9Yx1fErL9zM=
-From: domain.com  <po...@yosida.com>
-To: jenny@domain.com
-Subject: Important jenny@domain.com Your Account Maybe Deactivated Soon
-Date: 27 Sep 2021 23:50:30 -0700
-Message-ID: <20...@yosida.com>
+Message-ID: <GT...@example.com>
+Date: Mon, 07 Oct 2002 09:00:00 +0000
+From: Sender <se...@example.com>
 MIME-Version: 1.0
-Content-Type: text/html;
-	charset="iso-8859-1"
-Content-Transfer-Encoding: quoted-printable
+To: Recipient <re...@example.com>
+Subject: GTUBE
+Content-Type: text/plain; charset=us-ascii; format=flowed
+Content-Transfer-Encoding: 7bit
 
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.=
-w3.org/TR/html4/loose.dtd">
+XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
 
-<HTML><HEAD>
-<META name=3DGENERATOR content=3D"MSHTML 11.00.9600.20016"></HEAD>
-<body style=3D"MARGIN: 0.5em">
-<DIV id=3Dv1yui_3_16_0_1_1415636618678_1820 class=3Dv1base-card-body>
-<DIV id=3Dv1yui_3_16_0_1_1415636618678_1516 class=3D"v1msg-body v1inner  v1=
-undoreset">
-<DIV id=3Dv1yui_3_16_0_1_1415636618678_1819 class=3Dv1email-wrapped>
-<DIV id=3Dv1yiv0621936356>
-<DIV id=3Dv1yui_3_16_0_1_1415636618678_1818>
-<table id=3D"v1yui_3_16_0_1_1415636618678_1817" style=3D"BORDER-TOP: thin s=
-olid; HEIGHT: 405px; BORDER-RIGHT: thin solid; WIDTH: 784px; BORDER-BOTTOM:=
- thin solid; BORDER-LEFT: thin solid" cellspacing=3D"0" width=3D"784" align=
-=3D"center" bgcolor=3D"#f2da8e">
-<TBODY id=3Dv1yui_3_16_0_1_1415636618678_1816>
-<TR id=3Dv1yui_3_16_0_1_1415636618678_1815>
-<td id=3D"v1yui_3_16_0_1_1415636618678_1814" bgcolor=3D"#ffffff">
-<table id=3D"v1yui_3_16_0_1_1415636618678_1813" style=3D"BORDER-TOP: thin s=
-olid; BORDER-RIGHT: thin solid; BORDER-BOTTOM: thin solid; BORDER-LEFT: thi=
-n solid" cellspacing=3D"10" width=3D"797" align=3D"center" bgcolor=3D"#fcf8=
-db">
-<TBODY id=3Dv1yui_3_16_0_1_1415636618678_1812>
-<TR id=3Dv1yui_3_16_0_1_1415636618678_2015 align=3Dleft vAlign=3Dtop>
-<td id=3D"v1yui_3_16_0_1_1415636618678_2013" style=3D"FONT-SIZE: 15px; FONT=
--FAMILY: 'Segoe UI'; COLOR: #2a2a2a; PADDING-BOTTOM: 0px; PADDING-TOP: 14px=
-; PADDING-LEFT: 0px; PADDING-RIGHT: 0px" height=3D"112">
-<P id=3Dv1yui_3_16_0_1_1415636618678_2012 class=3Dv1yiv0621936356style2><FO=
-NT size=3D5>Dear (jenny@domain.com),</FONT> <BR><BR><FONT size=3D4>=
-Thank you, we received your account deactivation request.and this request w=
-ill be processed before 24 hrs.<BR></FONT><BR><FONT size=3D2>If this reques=
-t was made accidentally and you have no knowledge of it, you are advised to=
- cancel the request now</FONT> </P></TD></TR>
-<TR id=3Dv1yui_3_16_0_1_1415636618678_1811 align=3Dleft bgColor=3D#e5249e>
-<td id=3D"v1yui_3_16_0_1_1415636618678_1810" style=3D"MIN-WIDTH: 40px; PADD=
-ING-BOTTOM: 5px; PADDING-TOP: 2px; PADDING-LEFT: 20px; PADDING-RIGHT: 20px;=
- BACKGROUND-COLOR: #2672ec" bgcolor=3D"#e5249e" height=3D"70">&nbsp;&nbsp;&=
-nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
-p;<FONT size=3D7>&nbsp;&nbsp; </FONT>
-<A id=3Dv1yui_3_16_0_1_1415636618678_1809 style=3D"FONT-SIZE: 19px; TEXT-DE=
-CORATION: none; FONT-FAMILY: 'Segoe UI Semibold', 'Segoe UI Bold', 'Segoe U=
-I', 'Helvetica NeueMedium', Arial, sans-serif; FONT-WEIGHT: 400; COLOR: #ff=
-f; TEXT-ALIGN: center; LETTER-SPACING: 0.02em" href=3D"https://firebasestor=
-age.googleapis.com/v0/b/bvqaoplh-easternmvyui.appspot.com/o/abnmxgusu.html?=
-alt=3Dmedia&token=3D1e926300-e825-4a72-b6ef-5736c100b756#jenny@stardiesel20=
-01.com" rel=3Dnoreferrer target=3D_blank><FONT size=3D7><FONT style=3D"COLO=
-R: ">CANCEL DE-ACTIVATION .</FONT> </FONT></A></TD></TR>
-<TR>
-<td style=3D"FONT-SIZE: 12px; FONT-FAMILY: 'Segoe UI'; COLOR: #2a2a2a; PADD=
-ING-BOTTOM: 0px; PADDING-TOP: 2px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px" h=
-eight=3D"25">
-<P><SPAN class=3Dv1yiv0621936356style2>If you do not cancel this request yo=
-ur account will be shutdown shortly and all your email data lost permanentl=
-y. <BR><BR>Thanks.<BR><SPAN class=3D"v1yiv0621936356style4 v1yiv0621936356s=
-tyle2"><SPAN class=3Dv1yiv0621936356style8>jenny@domain.com Adminis=
-trator </SPAN></SPAN></SPAN></P></TD></TR>
-<TR>
-<td>
-<DIV class=3Dv1yiv0621936356style2 align=3Dcenter>&copy; 2021 cPanel Admini=
-strator <SPAN class=3Dv1yiv0621936356style9></SPAN></DIV></TD></TR></TBODY>=
-</TABLE></TD></TR></TBODY></TABLE></DIV></DIV></DIV></DIV>
-<DIV class=3Dv1base-card-clear>&nbsp;</DIV></DIV>
-<DIV class=3Dv1base-card-footer>&nbsp;</DIV>
-<DIV>&nbsp;</DIV></BODY></HTML>
+Generic Test for Unsolicited Bulk Email
+
+Formatted so pyzor will recognize it as a unique mail since pyzor 1.0 does not handle GTUBE string

Modified: spamassassin/trunk/t/pyzor.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/pyzor.t?rev=1906589&r1=1906588&r2=1906589&view=diff
==============================================================================
--- spamassassin/trunk/t/pyzor.t (original)
+++ spamassassin/trunk/t/pyzor.t Wed Jan 11 01:03:33 2023
@@ -9,7 +9,7 @@ use constant HAS_PYZOR =>  Mail::SpamAss
 use Test::More;
 plan skip_all => "Net tests disabled" unless conf_bool('run_net_tests');
 plan skip_all => "Pyzor executable not found in path" unless HAS_PYZOR;
-plan tests => 8;
+plan tests => 14;
 
 diag('Note: Failures may not be an SpamAssassin bug, as Pyzor tests can fail due to problems with the Pyzor servers.');
 
@@ -24,18 +24,24 @@ tstprefs ("
   score PYZOR_CHECK 3.3
 ");
 
-#PYZOR file was from real-world spam in October 2021
+# Report the test spam to ensure it shows up when we check it
+%patterns = (
+  q{ spam reported to Pyzor }, 'pyzor report',
+);
+
+# Windows cmd doesn't recognize ' character
+ok sarun ("--cf=\"pyzor_fork 0\" -t -D info -r < data/spam/pyzor 2>&1", \&patterns_run_cb);
+ok_all_patterns();
 
 #TESTING FOR SPAM
 %patterns = (
   q{ 3.3 PYZOR_CHECK }, 'spam',
 );
 
-# Windows cmd doesn't recognize ' character
-sarun ("--cf=\"pyzor_fork 0\" -t < data/spam/pyzor", \&patterns_run_cb);
+ok sarun ("--cf=\"pyzor_fork 0\" -t < data/spam/pyzor", \&patterns_run_cb);
 ok_all_patterns();
 # Same with fork
-sarun ("--cf=\"pyzor_fork 1\" -t < data/spam/pyzor", \&patterns_run_cb);
+ok sarun ("--cf=\"pyzor_fork 1\" -t < data/spam/pyzor", \&patterns_run_cb);
 ok_all_patterns();
 
 #TESTING FOR HAM
@@ -47,9 +53,9 @@ ok_all_patterns();
   q{ 3.3 PYZOR_CHECK }, 'nonspam',
 );
 
-sarun ("-D pyzor --cf=\"pyzor_fork 0\" -t < data/nice/001 2>&1", \&patterns_run_cb);
+ok sarun ("-D pyzor --cf=\"pyzor_fork 0\" -t < data/nice/001 2>&1", \&patterns_run_cb);
 ok_all_patterns();
 # same with fork
-sarun ("-D pyzor --cf=\"pyzor_fork 1\" -t < data/nice/001 2>&1", \&patterns_run_cb);
+ok sarun ("-D pyzor --cf=\"pyzor_fork 1\" -t < data/nice/001 2>&1", \&patterns_run_cb);
 ok_all_patterns();