-
Notifications
You must be signed in to change notification settings - Fork 319
"From:" header field has been lost in received-emails. #26
Comments
I have run integration tests, as was specified in the documentation. All emails have the "From:" field. E.g.:
Could you please tell us how to reproduce the issue? |
Thank you for reply. import java.io.*;
import java.net.*;
public class SMTPTest {
public static void main(String[] args) {
try {
try (Socket so = new Socket("127.0.0.1", 25)) {
try (DataOutputStream send = new DataOutputStream(so.getOutputStream())) {
try (BufferedReader recv = new BufferedReader(new InputStreamReader(so.getInputStream()))) {
String msg;
msg = "HELO 127.0.0.1\r\n";
send.writeBytes(msg);
System.out.println(msg);
msg = recv.readLine();
System.out.println(msg);
msg = "MAIL FROM: info@example.com\r\n";
send.writeBytes(msg);
System.out.println(msg);
msg = recv.readLine();
System.out.println(msg);
msg = "RCPT TO: test1@example.com\r\n";
send.writeBytes(msg);
System.out.println(msg);
msg = recv.readLine();
System.out.println(msg);
msg = "RCPT TO: test2@example.com\r\n";
send.writeBytes(msg);
System.out.println(msg);
msg = recv.readLine();
System.out.println(msg);
msg = "RCPT TO: test3@example.com\r\n";
send.writeBytes(msg);
System.out.println(msg);
msg = recv.readLine();
System.out.println(msg);
msg = "DATA\r\n"
+ "From: =?ISO-2022-JP?B?GyRCJCIkJCQmJCgkKhsoQg==?= <info@example.com>\r\n"
+ "Subject: =?ISO-2022-JP?B?GyRCJCIkJCQmJCgkKhsoQg==?=\r\n"
+ "To: test1@example.com, test2@example.com, test3@example.com\r\n"
+ "Content-Type: text/plain; charset=ISO-2022-JP\r\n"
+ "Content-Transfer-Encoding: 7bit\r\n"
+ "MIME-Version: 1.0\r\n"
+ "Date: Fri, 12 Apr 2015 12:00:00 +0900\r\n"
+ "Message-ID: TEST\r\n"
+ "\r\n"
+ "TEST\r\n"
+ ".\r\n";
send.writeBytes(msg);
System.out.println(msg);
msg = recv.readLine();
System.out.println(msg);
msg = "QUIT.\r\n";
send.writeBytes(msg);
System.out.println(msg);
msg = recv.readLine();
System.out.println(msg);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
} |
I confirm that if there are multiple recipients (multiple RCPT TO commands), the first header of the message data is lost. It could be "From:" or another header, depending on the mail client. This doesn't happen if there is just one RCPT TO command. |
One recipient:
Results in this mail (all ok):
Two recipients:
Results in this mail, missing the "Foo: bar" header:
|
If I modify the pom.xml to use version 3.1.7 of the subethasmtp library (instead of 3.1.6), the issue goes away. |
Looks like it's fixed in this commit of subethasmtp: By this change in ReceivedHeaderStream.java:
|
@caarmen, can you prepare a small pull request with the new pom.xml file? |
Pull request created: #28 |
Many thanks to everyone for having found and contributed to this issue. |
The subethaSMTP upgrade that fixes multiple issues, such as #26 forbids us to restart the server.
FakeSMTP 2.0 is now released with subethasmtp 3.1.7. It should fix the issue. |
"From:" is not found in received email file.
The text was updated successfully, but these errors were encountered: