diff options
Diffstat (limited to 'juick-api/src/main/java/com/juick')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/EmailManager.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/juick-api/src/main/java/com/juick/api/EmailManager.java b/juick-api/src/main/java/com/juick/api/EmailManager.java index 2c48a745..52315ff6 100644 --- a/juick-api/src/main/java/com/juick/api/EmailManager.java +++ b/juick-api/src/main/java/com/juick/api/EmailManager.java @@ -58,8 +58,16 @@ public class EmailManager implements ApplicationListener<MessageEvent> { Transport transport = session.getTransport("smtp"); MimeMessage message = new MimeMessage(session) { protected void updateMessageID() throws MessagingException { - if (getHeader("Message-ID") == null) - super.updateMessageID(); + setHeader("Message-ID", formatUrl(msg)); + if (msg.getRid() > 0) { + if (msg.getReplyto() > 0) { + Message replyto = messagesService.getReply(msg.getMid(), msg.getReplyto()); + setHeader("In-Reply-To", formatUrl(replyto)); + } else { + Message original = messagesService.getMessage(msg.getMid()); + setHeader("In-Reply-To", formatUrl(original)); + } + } } }; message.setFrom(new InternetAddress("juick@juick.com")); |