diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index dde5bf3728..6d45675e36 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -34,6 +34,7 @@ import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -475,7 +476,22 @@ public class MessageHelper { return null; header = new String(header.getBytes(StandardCharsets.ISO_8859_1)); - return InternetAddress.parseHeader(header, false); + Address[] addresses = InternetAddress.parseHeader(header, false); + + for (Address address : addresses) { + InternetAddress iaddress = (InternetAddress) address; + iaddress.setAddress(decodeMime(iaddress.getAddress())); + String personal = iaddress.getPersonal(); + if (personal != null) { + try { + iaddress.setPersonal(decodeMime(personal)); + } catch (UnsupportedEncodingException ex) { + Log.w(ex); + } + } + } + + return addresses; } Address[] getFrom() throws MessagingException {