How can I set the SMTP message-id while sending mails with javax.mail. My mail server is reporting something like this:
1 <= me@domain.com H=mail (host) [192.168.1.4] P=esmtp S=142014
id=2043289758.9.1322829290422.JavaMail.thor@developer.local
2 => sombodey@else R=dnslookup T=remote_smtp H=mx00.t-online.de [194.25.134.8]
3 Completed
I want to set the id=2043289758.9.1322829290422.JavaMail.thor@developer.local before sending it. Is this possible? The email it created like this:
Properties props = System.getProperties();
props.put("mail.smtp.host", "192.168.1.4");
Session session = Session.getDefaultInstance(props, null);
session.setDebug(false);
Message msg = createMsg();
Transport.send(msg);
I believe this section of the JavaMail FAQ answers your question: