[ 
https://issues.apache.org/jira/browse/JAMES-344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795730#action_12795730
 ] 

Ralph B Holland edited comment on JAMES-344 at 1/1/10 5:30 AM:
---------------------------------------------------------------

This parsing issue is also causing problems for me from my POP3 server. I had 
to include UnknownHostException handling into MessageProcessor to stop it 
crashing on an invalid trace header.

If you look inside RFC 5321  section 4.4 Trace it states that the Received: 
field was added for debugging, the standard goes on to say that the field may 
not conform and that NO mail server should alter the format. I.e. expect it to 
differ from the standards.

That comment aside though, I notice in RFC5321 that an IP address is actually 
specified inside ( ) and not [ ] - so it seems to me that the ( ) should be 
permitted.

I believe that the parser. preference can be given to the [ ] , if not found 
found then the contents of the inner-most () should be used. 

I attach an example email header extracted by James fetchmail from my POP3 
server, which is running windoze software at my ISP (who hosts my domain). Note 
the second header put on by my provider's email server canberranet.com.au:

Return-Path: <[email protected]>
Delivered-To: ra...@localhost
Received: from canberranet.com.au (unverified [202.168.8.70]) 
        by canberranet.com.au (SurgeMail 3.7b8) with ESMTP id 76651460 
        for <[email protected]>; Fri, 01 Jan 2010 14:28:16 +1100
Received: from unknown (HELO canberranet.com.au) (202.168.8.8)
        by Mail-SeCure (envelope-from [email protected])
        with SMTP; 1 Jan 2010 12:32:36 +1100
Received: from ll62-72-188-251-62.ll62.iam.net.ma (unverified [62.251.188.72]) 
        by canberranet.com.au (SurgeMail 3.7b8) with ESMTP id 76642457 
        for multiple; Fri, 01 Jan 2010 12:36:46 +1100
X-Verify-SMTP: Host 62.251.188.72 sending to us was not listening
Date: Fri, 01 Jan 2010 01:34:55 +0100
Message-ID: <001101ca8a7a$3d46e520$00426...@ocutnqtp>
From: "Ruby Royale Online Games" <[email protected]>
To: <[email protected]>
Subject: Great pokies and offers  [spam]
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Server: High Performance Mail Server - http://surgemail.com r=1325883893
X-Rcpt-To: <[email protected]>
X-IP-stats: Incoming Outgoing Last 0, First 762, in=2251436, out=27829717, 
spam=0 Known=true
X-External-IP: 202.168.8.70
Status: U
X-UIDL: 1262316496.856_419757.mrmail2
X-fetched-from: mail.arising.com.au

I will be looking at making changes to the Received: field parser to handle the 
brackets ( ) around the IP address after the HELO response..

Just to help out further, here is the email received from the brutus.apache.org

Return-Path: <[email protected]>
Delivered-To: ra...@localhost
Received: from canberranet.com.au (unverified [202.168.8.70]) 
        by canberranet.com.au (SurgeMail 3.7b8) with ESMTP id 76659501 
        for <[email protected]>; Fri, 01 Jan 2010 16:01:24 +1100
Received: from unknown (HELO brutus.apache.org) (140.211.11.140)
        by Mail-SeCure (envelope-from [email protected])
        with SMTP; 1 Jan 2010 14:08:32 +1100
Received: from brutus.apache.org (localhost [127.0.0.1])
        by brutus.apache.org (Postfix) with ESMTP id 62A8D234C045
        for <[email protected]>; Thu, 31 Dec 2009 19:08:29 -0800 (PST)
Message-ID: <[email protected]>
Date: Fri, 1 Jan 2010 03:08:29 +0000 (UTC)
From: [email protected]
To: [email protected]
Subject: [jira] Account signup
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394
X-Server: High Performance Mail Server - http://surgemail.com r=1325883893
X-Rcpt-To: <[email protected]>
X-IP-stats: Incoming Outgoing Last 0, First 763, in=2252824, out=27830757, 
spam=0 Known=true
X-External-IP: 202.168.8.70
Status: U
X-UIDL: 1262322084.856_424086.mrmail2
X-fetched-from: mail.arising.com.au

You have signed up for a JIRA account at:

   https://issues.apache.org/jira

Here are the details of your account:

....snip ...

      was (Author: vh-ums):
    This parsing issue is also causing problems for me from my POP3 server. I 
had to include UnknownHostException handling into MessageProcessor to stop it 
crashing on an invalid trace header.

If you look inside RFC 5321  section 4.4 Trace it states that the Received: 
field was added for debugging, the standard goes on to say that the field may 
not conform and that NO mail server should alter the format. I.e. expect it to 
differ from the standards.

That comment aside though, I notice in RFC5321 that an IP address is actually 
specified inside ( ) and not [ ] - so it seems to me that the ( ) should be 
permitted.

I believe that the parser. preference can be given to the [ ] , if not found 
found then the contents of the inner-most () should be used. 

I attach an example email header extracted by James fetchmail from my POP3 
server, which is running windoze software at my ISP (who hosts my domain). Note 
the second header put on by my provider's email server canberranet.com.au:

Return-Path: <[email protected]>
Delivered-To: ra...@localhost
Received: from canberranet.com.au (unverified [202.168.8.70]) 
        by canberranet.com.au (SurgeMail 3.7b8) with ESMTP id 76651460 
        for <[email protected]>; Fri, 01 Jan 2010 14:28:16 +1100
Received: from unknown (HELO canberranet.com.au) (202.168.8.8)
        by Mail-SeCure (envelope-from [email protected])
        with SMTP; 1 Jan 2010 12:32:36 +1100
Received: from ll62-72-188-251-62.ll62.iam.net.ma (unverified [62.251.188.72]) 
        by canberranet.com.au (SurgeMail 3.7b8) with ESMTP id 76642457 
        for multiple; Fri, 01 Jan 2010 12:36:46 +1100
X-Verify-SMTP: Host 62.251.188.72 sending to us was not listening
Date: Fri, 01 Jan 2010 01:34:55 +0100
Message-ID: <001101ca8a7a$3d46e520$00426...@ocutnqtp>
From: "Ruby Royale Online Games" <[email protected]>
To: <[email protected]>
Subject: Great pokies and offers  [spam]
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Server: High Performance Mail Server - http://surgemail.com r=1325883893
X-Rcpt-To: <[email protected]>
X-IP-stats: Incoming Outgoing Last 0, First 762, in=2251436, out=27829717, 
spam=0 Known=true
X-External-IP: 202.168.8.70
Status: U
X-UIDL: 1262316496.856_419757.mrmail2
X-fetched-from: mail.arising.com.au

I will be looking at making changes to the Received: field parser to handle the 
brackets ( ).
  
> FetchMail cannot parse particular format of "Received" header
> -------------------------------------------------------------
>
>                 Key: JAMES-344
>                 URL: https://issues.apache.org/jira/browse/JAMES-344
>             Project: JAMES Server
>          Issue Type: Bug
>          Components: FetchMail
>    Affects Versions: 2.3.0
>            Reporter: Jeff Keyser
>            Priority: Minor
>
> The mail server I am pulling e-mail from inserts a "Received" header that 
> looks like the following:
> Received: from unknown (HELO host.domain.tld) (192.168.255.254) by ...
> BTW - The name "unknown" is always used.  I assume they are purposely saving 
> processing power by not reverse-looking up the host name.
> I have debugged this problem in the code, and it appears that because the IP 
> address is not surrounded by square brackets, computeRemoteAddress is unable 
> to find the IP address.  So the name "unknown" is always used to determine 
> the address instead, which fails.
> FYI - The e-mail I am pulling actually passes through two e-mail servers by 
> different organizations, and they both use this format.  So I assume this 
> format is common.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to