Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0-beta4, 3.0.0-beta5
-
None
-
All environments.
Description
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 10.123.123.123 25 Trying 10.123.123.123...
Connected to alpha.nospam.com (10.123.123.123).
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 [10.123.123.123]) 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250-PIPELINING 250-ENHANCEDSTATUSCODES
250 8BITMIME
MAIL FROM: <>
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)."