james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Idea Harness (JIRA)" <server-...@james.apache.org>
Subject [jira] [Commented] (JAMES-1422) Empty MAIL FROM: <> throws javax.mail.internet.AddressException: Out of data at position 1 in '' in string ``'' at position 1
Date Mon, 23 Jul 2012 21:31:34 GMT

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

Idea Harness commented on JAMES-1422:

Thanks a lot for committing the fix (ie. rev 1362601, server/trunk/protocols-smtp/src/main/java/org/apache/james/smtpserver/model/MailetMailAddressAdapter.java
and server/trunk/protocols-smtp/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java).
Originally, I fixed org.apache.mailet.MailAddress (extracted src from .zip, fixed and built
locally on my box)
to not throw Exception for my own use (which works well as far as I can tell), but after looking
at your fix, I need to use it instead of mine as your fix is done at the DataLineJamesMessageHookHandler

which is the correct place to fix (also I can see that org.apache.james.protocols.smtp.MailAddress
is used instead of org.apache.mailet.MailAddress and MailetMailAddressAdapter is used as an

Adapter between the two, and in general org.apache.mailet.MailAddress hasn't changed since

I need to stay on a stable version (preferably Apache James Beta5, which unfortunately won't
be out for some time per your comment). To work around that, I am thinking rolling your fix
from trunk above, 
into an existing stable Apache James Beta4 build, and building my own james-server-protocols-smtp-3.0-beta4.jar
from src with your fix in it (till Apache James Beta5 is released). Do you see any issues
with this approach ? 
> Empty MAIL FROM: <> throws javax.mail.internet.AddressException: Out of data at
position 1 in '' in string ``'' at position 1
> -----------------------------------------------------------------------------------------------------------------------------
>                 Key: JAMES-1422
>                 URL: https://issues.apache.org/jira/browse/JAMES-1422
>             Project: JAMES Server
>          Issue Type: Bug
>          Components: James Core, SMTPServer
>    Affects Versions: 3.0-beta4, 3.0-beta5
>         Environment: All environments.
>            Reporter: Aaron Freeman
>              Labels: smtp
> James 3.0 is not allowing empty MAIL FROM: <>
> It does allow you to enter it, then a RCPT TO and DATA, but after you finish the DATA
command it throws an exception:
> ERROR 10:31:12,847 | james.smtpserver | Id='234288323' User='' Invalid email address
while processing DATA.
> javax.mail.internet.AddressException: Out of data at position 1 in '' in string ``''
at position 1
>         at org.apache.mailet.MailAddress.<init>(MailAddress.java:159)
> To reproduce the error (and to test whether you have fixed it), you can copy paste the
responses below:
> [root@alpha log]# telnet 25 Trying
> Connected to alpha.nospam.com (
> Escape character is '^]'.
> 220 alpha.nospam.com JAMES SMTP Server Server (JAMES SMTP Server ) ready EHLO testcomputer.com
250-alpha.nospam.com Hello testcomputer.com []) 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN
> 250 8BITMIME
> 250 2.1.0 Sender <> OK
> RCPT TO: <aaron@nospam.com>
> 250 2.1.5 Recipient <aaron@nospam.com> OK DATA
> 354 Ok Send data ending with <CRLF>.<CRLF>
> Subject: Test
> Test
> .
> 451 4.0.0 Error processing message: Out of data at position 1 in ''
> quit
> 451 Unable to process request
> Connection closed by foreign host.
> This is a pretty important issue as its required by RFC1123 5.2.9 to allow empty MAIL
FROM due to bounce emails often using empty MAIL FROM to prevent bounce loops.
> As Stefano Bagnara pointed out:
> "This is all best summed up by section 5.2.9 of RFC1123, which says:
> ----
> The syntax shown in RFC-821 for the MAIL FROM: command omits the case of an empty path:
"MAIL FROM:<>" (see RFC-821 Page 15). An empty reverse path MUST be supported.
> ----
> So, an empty email address is NOT a valid email address, but an empty email address is
valid in an 
> SMTP conversation as a way to say "no mail address".
> IIRC James 2.3 dealt with this using null sender in case a <> was received (so
to not build an "invalid" empty address object)."

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.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

View raw message