Update PstParser.java

Add sender SMTP or Email address to sender string.
This commit is contained in:
Mark McKinnon 2022-11-01 10:22:25 -04:00
parent 8f2177a474
commit 47959d14e8

View File

@ -300,7 +300,7 @@ class PstParser implements AutoCloseable{
email.setRecipients(toAddress); email.setRecipients(toAddress);
email.setCc(ccAddress); email.setCc(ccAddress);
email.setBcc(bccAddress); email.setBcc(bccAddress);
email.setSender(getSender(msg.getSenderName(), msg.getSentRepresentingSMTPAddress())); email.setSender(getSender(msg.getSenderName(), (msg.getSentRepresentingSMTPAddress().isEmpty()) ? msg.getSenderEmailAddress() : msg.getSentRepresentingSMTPAddress()));
email.setSentDate(msg.getMessageDeliveryTime()); email.setSentDate(msg.getMessageDeliveryTime());
email.setTextBody(msg.getBody()); email.setTextBody(msg.getBody());
if (false == msg.getTransportMessageHeaders().isEmpty()) { if (false == msg.getTransportMessageHeaders().isEmpty()) {
@ -318,7 +318,7 @@ class PstParser implements AutoCloseable{
email.setSubject(msg.getSubject()); email.setSubject(msg.getSubject());
email.setId(msg.getDescriptorNodeId()); email.setId(msg.getDescriptorNodeId());
email.setMessageID(msg.getInternetMessageId()); email.setMessageID(msg.getInternetMessageId());
String inReplyToID = msg.getInReplyToId(); String inReplyToID = msg.getInReplyToId();
email.setInReplyToID(inReplyToID); email.setInReplyToID(inReplyToID);
@ -479,7 +479,7 @@ class PstParser implements AutoCloseable{
} else if (addr.isEmpty()) { } else if (addr.isEmpty()) {
return name; return name;
} else { } else {
return name + ": " + addr; return name + " <" + addr + ">";
} }
} }