You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2008/10/06 17:33:34 UTC
[Bug 5994] New: whitelist_bounce_relays misses mail from cron jobs
(for example)
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5994
Summary: whitelist_bounce_relays misses mail from cron jobs (for
example)
Product: Spamassassin
Version: 3.2.5
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P5
Component: Plugins
AssignedTo: dev@spamassassin.apache.org
ReportedBy: jhein@timing.com
Mail from cron jobs can have a Received header that looks like:
Received: (from root@localhost)
by Daffy.timing.com (8.13.1/8.13.1/Submit) id m96653kR064934;
Mon, 6 Oct 2008 00:05:03 -0600 (MDT)
(envelope-from root)
check_whitelist_bounce_relays in VBounce.pm doesn't catch this no matter what
you put in whitelist_bounce_relays.
The reason is that the regex in check_whitelist_bounce_relays is (\S+\.\S+).
Actually, if 5912 is fixed (multiline received headers), the matching would hit
on the first "word" to contain a period. That's still not quite right in the
above case since we want to know where the mail came from, not which host
received it.
I'm not sure of the best way to fix this. Maybe we should be searching for
'from *' (hand-wavy definition of * here) rather than just matching the first
period?
--
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
[Bug 5994] whitelist_bounce_relays misses mail from cron jobs (for
example) [patch]
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5994
John Hein <jh...@timing.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|whitelist_bounce_relays |whitelist_bounce_relays
|misses mail from cron jobs |misses mail from cron jobs
|(for example) |(for example) [patch]
--- Comment #1 from John Hein <jh...@timing.com> 2008-10-07 08:27:06 PST ---
I'm still pondering whether this will always work (mostly whether it makes
sense for the various flavors of Received: header). But here's a patch that
has been working better for me.
This is against 3.5.2, and I saw that the trunk has changed a little in this
area (handles multi-line Received: headers better?), so consider the patch in
that context.
--- VBounce.pm.orig 2008-06-10 03:20:21.000000000 -0600
+++ VBounce.pm 2008-10-07 09:21:23.000000000 -0600
@@ -106,8 +106,8 @@
# check the plain-text body, first
foreach my $line (@{$body}) {
next unless ($line =~ /Received: /);
- while ($line =~ / (\S+\.\S+) /g) {
- return 1 if $self->_relay_is_in_whitelist_bounce_relays($pms, $1);
+ while ($line =~ /(\S+@)*([^\s)]+)\)*/g) {
+ return 1 if $self->_relay_is_in_whitelist_bounce_relays($pms, $2);
}
}
@@ -118,8 +118,8 @@
my $pristine = $pms->{msg}->get_pristine_body();
foreach my $line ($pristine =~ /^(.*)$/gm) {
next unless $line && ($line =~ /Received: /);
- while ($line =~ / (\S+\.\S+) /g) {
- return 1 if $self->_relay_is_in_whitelist_bounce_relays($pms, $1);
+ while ($line =~ /(\S+@)*([^\s)]+)\)*/g) {
+ return 1 if $self->_relay_is_in_whitelist_bounce_relays($pms, $2);
}
}
--
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
[Bug 5994] FP: whitelist_bounce_relays misses mail from cron jobs
(for example) [patch]
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5994
Justin Mason <jm...@jmason.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #3 from Justin Mason <jm...@jmason.org> 2009-07-04 08:32:01 PST ---
appears to be already fixed in 3.3.0. adding the test case anyway:
: 11...; svn commit -m "bug 5994: FP report for cron jobs"
t.rules/BOUNCE_MESSAGE/fp-bug5994-1*
Adding t.rules/BOUNCE_MESSAGE/fp-bug5994-1
Adding t.rules/BOUNCE_MESSAGE/fp-bug5994-1.cf
Transmitting file data ..
Committed revision 791137 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=791137 ).
--
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
[Bug 5994] FP: whitelist_bounce_relays misses mail from cron jobs
(for example) [patch]
Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5994
Justin Mason <jm...@jmason.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|Undefined |3.3.0
Summary|whitelist_bounce_relays |FP: whitelist_bounce_relays
|misses mail from cron jobs |misses mail from cron jobs
|(for example) [patch] |(for example) [patch]
--- Comment #2 from Justin Mason <jm...@jmason.org> 2009-07-01 14:44:54 PST ---
moving to 3.3.0 optimistically
--
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.