Browse Source

bugfix

drop_old_mail
Stephan Richter 3 years ago
parent
commit
ff7497f261
  1. 2
      pom.xml
  2. 4
      src/main/java/de/srsoftware/widerhall/mail/SmtpClient.java

2
pom.xml

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
<groupId>org.example</groupId>
<artifactId>Widerhall</artifactId>
<version>0.2.39</version>
<version>0.2.40</version>
<build>
<plugins>
<plugin>

4
src/main/java/de/srsoftware/widerhall/mail/SmtpClient.java

@ -36,7 +36,7 @@ public class SmtpClient { @@ -36,7 +36,7 @@ public class SmtpClient {
if (session == null) login();
MimeMessage forward = new MimeMessage(session);
var oldSender = message.getFrom()[0].toString();
if (newSender != null){
{ // drop old (from ... comment)
var pos = subject.indexOf(" (from ");
while (pos > 0){
var end = subject.indexOf(')',pos);
@ -44,6 +44,8 @@ public class SmtpClient { @@ -44,6 +44,8 @@ public class SmtpClient {
subject = (subject.substring(0,pos)+subject.substring(end+1)).trim();
pos = subject.indexOf(" (from ");
}
}
if (newSender != null){
forward.setFrom(newSender);
forward.setSubject(subject+" (from "+oldSender+")");
} else {

Loading…
Cancel
Save