|
|
|
@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory;
@@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
|
import javax.mail.*; |
|
|
|
|
import javax.mail.internet.*; |
|
|
|
|
import javax.ws.rs.HEAD; |
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
@ -36,7 +37,7 @@ public class SmtpClient {
@@ -36,7 +37,7 @@ public class SmtpClient {
|
|
|
|
|
if (session == null) login(); |
|
|
|
|
MimeMessage forward = new MimeMessage(session); |
|
|
|
|
var oldSender = message.getFrom()[0].toString(); |
|
|
|
|
if (newSender != null){ |
|
|
|
|
{ // drop old (von ... comment)
|
|
|
|
|
var pos = subject.indexOf(" (von "); |
|
|
|
|
while (pos > 0){ |
|
|
|
|
var end = subject.indexOf(')',pos); |
|
|
|
@ -44,6 +45,8 @@ public class SmtpClient {
@@ -44,6 +45,8 @@ public class SmtpClient {
|
|
|
|
|
subject = (subject.substring(0,pos)+subject.substring(end+1)).trim(); |
|
|
|
|
pos = subject.indexOf(" (von "); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (newSender != null){ |
|
|
|
|
forward.setFrom(newSender); |
|
|
|
|
forward.setSubject(subject+" (von "+oldSender+")"); |
|
|
|
|
} else { |
|
|
|
|