svn commit: r1936945 - spamassassin/trunk/lib/Mail/SpamAssassin/Plugin
| Newsgroups | gmane.mail.spam.spamassassin.cvs |
|---|---|
| Message-ID | <178605881430.3250397.18002460870987858200@svn03-he-fi> |
Author: fkento
Date: Thu Aug 6 23:26:54 2026
New Revision: 1936945
Log:
Redirectors: report the real LWP error instead of assuming a timeout
A client-warning of 'Internal response' only means LWP synthesized the
500 itself, it covers connection timeouts, DNS failures, oversized
response headers, and protocol errors alike. Logging 'Connection
timeout' for all of them misreports the cause, e.g. a 500 Header line
too long (limit is 8192) was being shown as a timeout.
Log the response status line, which already carries the actual reason.
Also use the header() accessor rather than reaching into the
HTTP::Headers hash, and guard against an undefined value, the old eq
comparison warned on any synthesized 500 lacking the header.
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Redirectors.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Redirectors.pm
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Redirectors.pm Thu Aug 6 20:10:03 2026 (r1936944)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/Redirectors.pm Thu Aug 6 23:26:54 2026 (r1936945)
@@ -1216,8 +1216,12 @@ sub _do_http {
my $rcode = $response->code;
if ($rcode =~ /^\d{3}$/) {
if($rcode eq 500) {
- if($response->headers->{'client-warning'} eq 'Internal response') {
- dbg("Connection timeout checking $redir_url");
+ my $cw = $response->header('Client-Warning');
+ if(defined $cw and $cw eq 'Internal response') {
+ # LWP synthesized this 500 rather than receiving it from the
+ # server, the reason may be a connection timeout, a DNS failure,
+ # an oversized header, etc. Report what it actually said.
+ dbg("Client error checking $redir_url: ".$response->status_line);
}
} elsif($rcode eq 200) {
if((defined $response->content) and ($response->content =~ /http-equiv=["']?refresh["']?.{1,64}?content=["']?(\d+);\s+url=["']?((?:https?:\/\/)?[^"'\\]+(?:\/[^"'\\]{8,256})?)["']?/is)) {