Bug 7391 - RCVD_NUMERIC_HELO false positive
Summary: RCVD_NUMERIC_HELO false positive
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (Eval Tests) (show other bugs)
Version: 3.4.0
Hardware: PC Linux
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-06 12:25 UTC by azurit
Modified: 2017-02-06 17:39 UTC (History)
3 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description azurit 2017-02-06 12:25:41 UTC
The RCVD_NUMERIC_HELO is fired for a headers like this:

Received: from 1.2.3.4 ([1.2.3.4]) by webmail.example.com
 (Horde Framework) with HTTPS; Mon, 06 Feb 2017 13:00:50 +0100


The problem is in HTTPS word, just change it to HTTP (without 'S') and everything is ok, RCVD_NUMERIC_HELO is NOT fired. You can check both here:
http://spamcheck.postmarkapp.com/
Comment 1 RW 2017-02-06 14:50:58 UTC
See also:

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7292#c2

FWIW Horde's "with HTTPS" received header emulates a handover from an SMTP client sending an invalid HELO.   There's probably nothing in the RFCs to stop them doing that, since there isn't actually a HELO, but it's not a very sensible thing to do. An IP address should be in "[]" to distinguish it from a hostname.
Comment 2 azurit 2017-02-06 14:54:59 UTC
The IP address IS in "[]":
1.2.3.4 ([1.2.3.4])

The first IP is really suppose to be without [], it's real clients IP, the HELO/EHLO is in brackets.

How is bug 7292 related to this?
Comment 3 RW 2017-02-06 15:44:05 UTC
(In reply to azurit from comment #2)
> The IP address IS in "[]":
> 1.2.3.4 ([1.2.3.4])
> 
> The first IP is really suppose to be without [], it's real clients IP, the
> HELO/EHLO is in brackets.

There is no HELO/EHLO for HTTP. The point of the [] is to distinguish the IP address [1.2.3.4] from the hostname  1.2.3.4 on a theoretically possible tld of 4. 
 
> How is bug 7292 related to this?

The strong overlap and similarities with other rules is something that anyone looking into this might want to take account of.
Comment 4 azurit 2017-02-06 15:49:16 UTC
Did you read my comment? There ARE []s, please chcek the format of Received headers. Evereything with that header is ok and fully RFC compatible. Problem is in SpamAssassin rules.
Comment 5 RW 2017-02-06 16:21:58 UTC
There are [] where SA would expect to find the IP address, but not where it would normally find the HELO. In SMTP this is the one that's mandated by the RFC and  set by the sender, and so the only one that matters.

Since the protocol is HTTPS the HELO is meaningless and SA should not use it. On the other hand creating a received header that superficially looks like an RFC violation that's common in spam, is not a sensible thing to do.
Comment 6 Kevin A. McGrail 2017-02-06 16:23:54 UTC
I am 99.9% sure we have custom parsing for other solutions.  Just write one for this case :-)
Comment 7 azurit 2017-02-06 16:34:31 UTC
RW: No, you are simply wrong, HELO/EHLO string si supposed to be in brackets "()", which it is:
1.2.3.4 ([1.2.3.4])

The format is:
clients_IP (HELO/EHLO hostname)
clients_IP ([HELO/EHLO IP address])

This is the same format as Postfix is using for all Received headers. That header is ok and no matter that is was generated by Horde and not by MTA.
Comment 8 RW 2017-02-06 17:15:20 UTC
(In reply to azurit from comment #7)
> RW: No, you are simply wrong, HELO/EHLO string si supposed to be in brackets
> "()", which it is:
> 1.2.3.4 ([1.2.3.4])
> 
> The format is:
> clients_IP (HELO/EHLO hostname)
> clients_IP ([HELO/EHLO IP address])
> 
> This is the same format as Postfix is using for all Received headers. That
> header is ok and no matter that is was generated by Horde and not by MTA.



This is an actual postfix header:

Received: from a7-11.smtp-out.eu-west-1.amazonses.com (a7-11.smtp-out.eu-west-1.amazonses.com [54.240.7.11])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mx4.messagingengine.com (Postfix) with ESMTPS
 for <XXXXXXXXXXXXXXX>; Thu, 26 Jan 2017 16:28:24 -0500 (EST)
Comment 9 RW 2017-02-06 17:37:35 UTC
(In reply to Kevin A. McGrail from comment #6)
> I am 99.9% sure we have custom parsing for other solutions.  Just write one
> for this case :-)

The trouble is that  "with HTTPS" could catch POP3/IMAP retrievers. Fetchmail has explicit support,  but for getmail, and some of the proprietary retrievers used by service providers, SA relies on the retriever header being unparsable to find the trusted/internal network automatically.

See also https://bz.apache.org/SpamAssassin/show_bug.cgi?id=6420
Comment 10 RW 2017-02-06 17:39:53 UTC
(In reply to RW from comment #9)
> (In reply to Kevin A. McGrail from comment #6)
> > I am 99.9% sure we have custom parsing for other solutions.  Just write one
> > for this case :-)
> 
> The trouble is that  "with HTTPS" could catch POP3/IMAP retrievers.

I don't know what I was think there, clearly it can't.