You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Scott Carr (JIRA)" <se...@james.apache.org> on 2005/10/07 05:18:48 UTC

[jira] Created: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Invalid DATA for Message shows up in Headers in mailstore
---------------------------------------------------------

         Key: JAMES-424
         URL: http://issues.apache.org/jira/browse/JAMES-424
     Project: James
        Type: Bug
  Components: MailStore & MailRepository, SMTPServer  
    Versions: 2.2.0    
 Environment: WinXP
    Reporter: Scott Carr


If you open a connection to the server, and send in the following in the DATA for the message:

This is a test
.

Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:

Return-Path: <sc...@dccusa.com>
Received: from localhost ([127.0.0.1])
          by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
          for <sc...@localhost>;
          Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
this is a test
Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
From: scott.carr@dccusa.com
Delivered-To: scarr@localhost
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Message-ID: <27...@QRGMAIN>


Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12435219 ] 
            
Stefano Bagnara commented on JAMES-424:
---------------------------------------

2 comments:
1. Sendmail seems to apply a more intelligent algorithm: it read the mail and use every line as an header until it find an invalid line. This line will be considered the first body line.
2. We should decide wether to put this in the code that read data from SMTP or to put it in the "parse" method of our MimeMessageWrapper to override the default behaviour.

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Improvement
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>            Priority: Minor
>         Attachments: headerFix.diff
>
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Scott Carr (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12434761 ] 
            
Scott Carr commented on JAMES-424:
----------------------------------

I agree it is INVALID data, so setting to 'Won't Fix' will not hurt my feelings.

I did try this with PostFix and Exchange and the message had 'This is a Test' instead of setting it as a Header, thus the reason for this issue.  I haven't tried it with Sendmail, so not sure what would happen.

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Bug
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by Stefano Bagnara <ap...@bago.org>.
Noel J. Bergman (JIRA) wrote:
>     [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12434868 ] 
>             
> Noel J. Bergman commented on JAMES-424:
> ---------------------------------------
> 
>> as you keep saying this is a problem in Javamail (and I could agree)
> 
> Keep it in context.  It is a problem with JavaMail because the content is invalid, and JavaMail requires valid content, sometimes resulting in "even more" invalid content.  Without JavaMail having problems, we could still transport such messages.

IIRC the problem is in the SMTP transport part, because previously we 
never change the message and we prepend the Recipient manipulating the 
original stream and if we never change it then it will be written "as 
is" and not parsed.

Btw I still don't understand HOW you would parse it IF you have to parse 
it. I understand what we can do when we don't have to parse it, but we 
also bundle in James mailets that changes the body: HOW should they work?

Let's forget of javamail or mime4j now, I just want to understand the 
what is the intended/best behaviour!

>>  I would like to know where you would add the Received: header in the following message:
> 
> --------------------------------
> This is a test
> Received: <a received header>
> --------------------------------
> 
> I tested ecelerity, and received:
> 
>   550 5.6.0 Required headers not found (see RFC2822 section 3.6)

Not sure but I think this is not RFC compliant: rfc2821 (SMTP) does not 
say you can check that the data is valid rfc2822 content.
So I would avoid behaving this way. Do you agree?

> qmail, however, accepted it, and I received (so delivered by qmail and added to by JAMES):
> 
> ---------------------------------------------
> Return-Path: <no...@devtech.com>
> Message-ID: <23...@devtech.com>
> MIME-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> X-MessageIsInfected: false
> Received: from minotaur.apache.org ([209.237.227.194])
>           by mail.devtech.com (JAMES SMTP Server 2.3.0rc3) with SMTP ID 986
>           for <no...@devtech.com>;
>           Thu, 14 Sep 2006 16:38:25 -0400 (EDT)
> Date: Thu, 14 Sep 2006 16:38:25 -0400 (EDT)
> From: noel@devtech.com
> Received: (qmail 95997 invoked by uid 1589); 14 Sep 2006 20:11:44 -0000
> Delivered-To: noel@locus.apache.org
> Received: (qmail 95992 invoked from network); 14 Sep 2006 20:11:44 -0000
> Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199)
>   by minotaur.apache.org with SMTP; 14 Sep 2006 20:11:44 -0000
> Received: (qmail 1843 invoked by uid 500); 14 Sep 2006 20:11:44 -0000
> Delivered-To: apmail-noel@apache.org
> Delivered-To: noel@localhost
> Received: (qmail 1840 invoked by uid 99); 14 Sep 2006 20:11:44 -0000
> X-ASF-Spam-Status: No, hits=9.2 required=10.0
> 	tests=MISSING_FROM,MISSING_HB_SEP,MISSING_HEADERS,MISSING_SUBJECT,TO_CC_NONE
> X-Spam-Check-By: apache.org
> Received-SPF: pass (hermes.apache.org: local policy)
> Received: from [66.112.202.2] (HELO devtech.com) (66.112.202.2)
>     by apache.org (qpsmtpd/0.29) with SMTP; Thu, 14 Sep 2006 13:11:44 -0700
> X-Virus-Checked: Checked by ClamAV on apache.org
> this is a test
> Received: a test header
> ---------------------------------------------
> 
> So qmail prepended headers to the message, but did not take the existing content and try to make a body out of it.

Never tested qmail, but I understood from Norman that it was considering 
it a body: can you test a local delivery to qmail to see if the local 
mailbox is altered and how? You should look at the saved mailbox in 
order to understand wether the change is done by qmail, by the pop3 
server or by the client reading it.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Noel J. Bergman (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12434868 ] 
            
Noel J. Bergman commented on JAMES-424:
---------------------------------------

> as you keep saying this is a problem in Javamail (and I could agree)

Keep it in context.  It is a problem with JavaMail because the content is invalid, and JavaMail requires valid content, sometimes resulting in "even more" invalid content.  Without JavaMail having problems, we could still transport such messages.

>  I would like to know where you would add the Received: header in the following message:

--------------------------------
This is a test
Received: <a received header>
--------------------------------

I tested ecelerity, and received:

  550 5.6.0 Required headers not found (see RFC2822 section 3.6)

qmail, however, accepted it, and I received (so delivered by qmail and added to by JAMES):

---------------------------------------------
Return-Path: <no...@devtech.com>
Message-ID: <23...@devtech.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-MessageIsInfected: false
Received: from minotaur.apache.org ([209.237.227.194])
          by mail.devtech.com (JAMES SMTP Server 2.3.0rc3) with SMTP ID 986
          for <no...@devtech.com>;
          Thu, 14 Sep 2006 16:38:25 -0400 (EDT)
Date: Thu, 14 Sep 2006 16:38:25 -0400 (EDT)
From: noel@devtech.com
Received: (qmail 95997 invoked by uid 1589); 14 Sep 2006 20:11:44 -0000
Delivered-To: noel@locus.apache.org
Received: (qmail 95992 invoked from network); 14 Sep 2006 20:11:44 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199)
  by minotaur.apache.org with SMTP; 14 Sep 2006 20:11:44 -0000
Received: (qmail 1843 invoked by uid 500); 14 Sep 2006 20:11:44 -0000
Delivered-To: apmail-noel@apache.org
Delivered-To: noel@localhost
Received: (qmail 1840 invoked by uid 99); 14 Sep 2006 20:11:44 -0000
X-ASF-Spam-Status: No, hits=9.2 required=10.0
	tests=MISSING_FROM,MISSING_HB_SEP,MISSING_HEADERS,MISSING_SUBJECT,TO_CC_NONE
X-Spam-Check-By: apache.org
Received-SPF: pass (hermes.apache.org: local policy)
Received: from [66.112.202.2] (HELO devtech.com) (66.112.202.2)
    by apache.org (qpsmtpd/0.29) with SMTP; Thu, 14 Sep 2006 13:11:44 -0700
X-Virus-Checked: Checked by ClamAV on apache.org
this is a test
Received: a test header
---------------------------------------------

So qmail prepended headers to the message, but did not take the existing content and try to make a body out of it.

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Bug
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12434772 ] 
            
Norman Maurer commented on JAMES-424:
-------------------------------------

Well i never see this behavior except in james. So i think fixin it will be good. If we fix it we should do it in the DATACmdHandler.

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Bug
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Noel J. Bergman (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12434779 ] 
            
Noel J. Bergman commented on JAMES-424:
---------------------------------------

RFC 2821 says, in part:

   Server SMTP systems SHOULD NOT reject messages based on perceived
   defects in the RFC 822 or MIME [12] message header or message body.

Section 3.7 goes further to say:

   As discussed in section 2.4.1, a relay SMTP has no need to inspect or
   act upon the headers or body of the message data and MUST NOT do so
   except to add its own "Received:" header (section 4.4) and,
   optionally, to attempt to detect looping in the mail system (see
   section 6.2).

I'm not entirely dismissing Scott's point.  Frankly, I see a LOT of invalid messages in the real-world, and JavaMail tosses exceptions often.  The general solution is to avoid JavaMail whenever we can, and be more graceful in content handling if/when we even need to look at the content.

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Bug
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12434788 ] 
            
Stefano Bagnara commented on JAMES-424:
---------------------------------------

Further considerations.

rfc2822 definition of a message:
---------
   A message consists of header fields (collectively called "the header
   of the message") followed, optionally, by a body.  The header is a
   sequence of lines of characters with special syntax as defined in
   this standard. The body is simply a sequence of characters that
   follows the header and is separated from the header by an empty line
   (i.e., a line with nothing preceding the CRLF).
---------
An header field is defined
---------
   Header fields are lines composed of a field name, followed by a colon
   (":"), followed by a field body, and terminated by CRLF.  A field
   name MUST be composed of printable US-ASCII characters (i.e.,
   characters that have values between 33 and 126, inclusive), except
   colon.  A field body may be composed of any US-ASCII characters,
   except for CR and LF.  However, a field body may contain CRLF when
   used in header "folding" and  "unfolding" as described in section
   2.2.3.  All field bodies MUST conform to the syntax described in
   sections 3 and 4 of this standard.
---------

Using this rule the first line of my previous example could not be part of the headers because it does not contain the ":", and cannot be part of the body because there is no CRLF.

But let's analyze where we can add the Received and the results. 

1) We can do like "the others" and consider it a body starting from the first non-header like line:
------------------
Received: <new received>

This is a test
Received: <a received header>
-----------------

2) We can do like we do now:
--------------------
Received: <new received>
This is a test
Received: <a received header>


--------------------

Either ways we are changing the original message, but in the first case the output message is an rfc2822 valid message.

RFC2821 never talks about the header/body and it simply say the SMTP should add the "Received: <xx>" header at the TOP of the data received for tracing purpose.

RFC2822 has a lot of obsolete examples and how to handle them but they never define how to parse a message having no header.

That said I still don't know what is the best thing to do "per RFC".
So I start looking at what other "players" do and there seem to be agreement on the solution to handle the text as body starting from the first "non-header like" header and maybe this is what most people would expect and what we would probably want to do.


> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Bug
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12434748 ] 
            
Stefano Bagnara commented on JAMES-424:
---------------------------------------

I just talked with Norman about this and the problem seems to be that we pass the stream to javamail and javamail simply consider it an header until it finds a CRLFCRLF (I believe RFC simply state this, any clue?).

One possible solution would be to add a streamfilter in the incoming chain and manually add a CRLF before a line not resembling an header (no ":", header name does not follow the specs..) so that javamail will use the remaining data as body.


> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Bug
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12434784 ] 
            
Stefano Bagnara commented on JAMES-424:
---------------------------------------

Sendmail do exactly what PostFix and Exchange did.

I just tested sending this message
---------------------------
Subject: test
invalid header line

possible body
-----------------------------
to a sendmail server and I received via pop3 (sorry, there is a firewall on this and I don't know what is the pop3 server)
--------------------------
Return-Path: <my MAIL FROM address>
Received: <the received>
Date: <current date>
From: <my MAIL FROM address>
Subject: test

invalid header line

possible body
--------------------------
So it seems that sendmail alter the message content (and not only for the received header).
The same thing is done by every other mailserver we tested (I have yet to find another one acting like james).

Btw, as you keep saying this is a problem in Javamail (and I could agree) I would like to know where you would add the Received: header in the following message:

--------------------------------
This is a test
Received: <a received header>
--------------------------------


> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Bug
>          Components: SMTPServer, MailStore & MailRepository
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
     [ http://issues.apache.org/jira/browse/JAMES-424?page=all ]

Norman Maurer updated JAMES-424:
--------------------------------

    Issue Type: Improvement  (was: Bug)
      Priority: Minor  (was: Major)

Change from Bug to Improvement.

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Improvement
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>            Priority: Minor
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Noel J. Bergman (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12434755 ] 
            
Noel J. Bergman commented on JAMES-424:
---------------------------------------

Personally, I would mark this as INVALID / WON"T FIX.  The data is out of compliance with RFC 2822, and according to RFC 2821, the mail server should not be futzing around with the contents of the message.  

The real solution to this problem is, in fact, the latter.  As we migrate away from using JavaMail to working more purely with streams, we should be able to avoid JavaMail induced problems.  Then the problem surfaces only when we actually care, in processing a message as an mail application server, about its content, or when it is eventually delivered to an MUA, where it is that end's problem to comprehend.  But I would NOT arbitrarily modify the message content in violation of RFC 2821.

Just another reason to start moving way from JavaMail, and to use streams and MIME4J whenever possible

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Bug
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Scott Carr (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12331796 ] 

Scott Carr commented on JAMES-424:
----------------------------------

In SendMail, PostFix, Exchange, and XMail when their are no Headers in the message itself, the text appears as the body of the message.  This is the behavior that would be expected in this instance, I would imagine.

Example message from PostFix:

Return-Path: <sc...@progbits.com>
X-Original-To: scarr@progbits.com
Delivered-To: scarr@progbits.com
Received: from scarr (unknown [12.107.242.5])
	by progbits.com (Postfix) with ESMTP id 399FA54D3F1
	for <sc...@progbits.com>; Tue, 11 Oct 2005 08:33:14 -0500 (CDT)
Message-Id: <20...@progbits.com>
Date: Tue, 11 Oct 2005 08:33:14 -0500 (CDT)
From: scarr@progbits.com
To: undisclosed-recipients:;
X-Spam-Checker-Version: SpamAssassin 3.0.4-gr0 (2005-06-05) on progbits.com
X-Spam-Level: 
X-Spam-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,MISSING_SUBJECT,
	MSGID_FROM_MTA_ID,NO_REAL_NAME,UNDISC_RECIPS autolearn=no 
	version=3.0.4-gr0

This is a test

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>          Key: JAMES-424
>          URL: http://issues.apache.org/jira/browse/JAMES-424
>      Project: James
>         Type: Bug
>   Components: SMTPServer, MailStore & MailRepository
>     Versions: 2.2.0
>  Environment: WinXP
>     Reporter: Scott Carr

>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
     [ http://issues.apache.org/jira/browse/JAMES-424?page=all ]

Norman Maurer updated JAMES-424:
--------------------------------

    Attachment: headerFix.diff

With this diff it handles like qmail. Not sure what is the most RFC conform.

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Improvement
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>            Priority: Minor
>         Attachments: headerFix.diff
>
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Norman Maurer (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12435204 ] 
            
Norman Maurer commented on JAMES-424:
-------------------------------------

The Change put the text in the body if there are no valid headers. So this seems to be the same as Scott Carr reports for SendMail, PostFix, Exchange, and XMail. I also notice the same behavoir in Qmail. I think thats what most people aspect.

Any thoughts ? What about apply the patch ?

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>                 Key: JAMES-424
>                 URL: http://issues.apache.org/jira/browse/JAMES-424
>             Project: James
>          Issue Type: Improvement
>          Components: MailStore & MailRepository, SMTPServer
>    Affects Versions: 2.2.0
>         Environment: WinXP
>            Reporter: Scott Carr
>            Priority: Minor
>         Attachments: headerFix.diff
>
>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JAMES-424) Invalid DATA for Message shows up in Headers in mailstore

Posted by "Danny Angus (JIRA)" <se...@james.apache.org>.
    [ http://issues.apache.org/jira/browse/JAMES-424?page=comments#action_12331791 ] 

Danny Angus commented on JAMES-424:
-----------------------------------

is the test text supposed to be preceded by CRLFCRLF?
If so it is possibly a bug in Java mail or James might be trimming the leading whitespace.
if not then it is correct behaviour, we have no reason to generally validate headers, only those we take an interest in.

> Invalid DATA for Message shows up in Headers in mailstore
> ---------------------------------------------------------
>
>          Key: JAMES-424
>          URL: http://issues.apache.org/jira/browse/JAMES-424
>      Project: James
>         Type: Bug
>   Components: SMTPServer, MailStore & MailRepository
>     Versions: 2.2.0
>  Environment: WinXP
>     Reporter: Scott Carr

>
> If you open a connection to the server, and send in the following in the DATA for the message:
> This is a test
> .
> Then the data shows up in the headers instead of after the headers like it should.  Here is what I recieved in the message:
> Return-Path: <sc...@dccusa.com>
> Received: from localhost ([127.0.0.1])
>           by QRGMAIN (JAMES SMTP Server 2.2.0) with SMTP ID 792
>           for <sc...@localhost>;
>           Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> this is a test
> Date: Thu, 6 Oct 2005 21:40:21 -0500 (CDT)
> From: scott.carr@dccusa.com
> Delivered-To: scarr@localhost
> Content-Transfer-Encoding: 7bit
> Content-Type: text/plain; charset=us-ascii
> Mime-Version: 1.0
> Message-ID: <27...@QRGMAIN>
> Notice where 'this is a test' appears in the message.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org