Commit dde0aab
committed
Regression suite: make the SpamAssassin and ClamAV tests actually run
Installing the two optional integrations - ClamAV 1.5.4 and SpamAssassin 4.0.2 -
took the 27 tests that had always reported inconclusive on this machine and ran
them for the first time. Two of them failed, both because of defects in the
tests rather than in the server.
ClamAV.TestWithVirus put the EICAR string in the plain body of a non-MIME
message. ClamAV's EICAR signatures match a whole file, not a substring, and the
boundary is easy to demonstrate over clamd's own INSTREAM:
exact EICAR, no trailing newline 68 bytes -> Eicar-Test-Signature FOUND
EICAR + CRLF 70 bytes -> Eicar-Signature FOUND
EICAR + trailing text 79 bytes -> OK
plain .eml, EICAR as the body 131 bytes -> OK
MIME .eml, EICAR base64 attached 451 bytes -> Eicar-Test-Signature FOUND
Older ClamAV extracted a plain body as a scannable part; current ClamAV does
not, so the message scanned clean and was delivered - and the test failed on its
own "no messages" assertion. hMailServer was never at fault: it connected,
streamed the file and parsed the FOUND reply correctly, which the attachment
case proves. The test now sends EICAR as a base64 attachment, which is how a
virus actually arrives, and matches the signature family rather than one exact
name - the name has already changed once across ClamAV releases, and the test
was still asserting the old one.
The EICAR string stays split across two fragments and is base64-encoded at run
time so that neither form is ever a literal in the source file. On-access
scanners quarantine files containing either; Windows Defender deleted two
scratch files during this work for exactly that reason.
SpamAssassin.TestSANotRunning had a race and a wrong expectation.
StopSpamAssassin() called ServiceController.Stop() and returned immediately.
Stop() only asks - it returns as soon as the request is accepted, while spamd is
still up and still answering on 783. The test then sent a message straight into
a live spamd and got the X-Spam-Status header it was asserting could not be
there. It now waits for the service to reach Stopped and for port 783 to refuse
connections, which is the condition the test actually depends on.
It also asserted "There was a communication error with SpamAssassin." alongside
the real error. That is error 5157, reported by SpamAssassinClient::OnReadError
when a connection was established and then lost mid-read. With spamd stopped
there is nothing to connect to, Connect() fails outright, and only error 5508 -
"The SpamAssassin tests did not complete..." - is reported. Asserting both
demanded a different failure mode from the one under test, so only 5508 remains.
Verified: AntiVirus.ClamAV 5/5 with a real detect-and-delete in the log
("Virus detected: Eicar-Test-Signature", "Message will be deleted"), and
AntiSpam.SpamAssassin 14/14 including the outage test.
README: the setup recipe pointed at a JAM Software download that no longer
exists. It now describes what actually works - Strawberry Perl plus CPAN, with
spamd rebuilt via BUILD_SPAMD=yes because the Windows build skips it by default,
and perl.exe copied to spamd.exe inside Perl's own bin so @inc still resolves.
Also states the elevation requirement the suite has always had but never
documented: it starts and stops Windows services, which a standard user cannot
do, and those tests report inconclusive unelevated.
No shipped code is touched by this commit; 6.2.10 as released is unaffected.1 parent ff4826d commit dde0aab
3 files changed
Lines changed: 131 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| 554 | + | |
554 | 555 | | |
555 | 556 | | |
556 | 557 | | |
| |||
561 | 562 | | |
562 | 563 | | |
563 | 564 | | |
564 | | - | |
565 | | - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
566 | 588 | | |
567 | 589 | | |
568 | 590 | | |
| |||
Lines changed: 51 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
205 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
206 | 214 | | |
207 | 215 | | |
208 | 216 | | |
| |||
307 | 315 | | |
308 | 316 | | |
309 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
310 | 329 | | |
311 | 330 | | |
312 | | - | |
313 | 331 | | |
314 | 332 | | |
315 | 333 | | |
316 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
317 | 339 | | |
318 | 340 | | |
319 | 341 | | |
320 | 342 | | |
321 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
322 | 370 | | |
323 | 371 | | |
324 | 372 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
89 | 139 | | |
90 | 140 | | |
91 | 141 | | |
0 commit comments