From d88212fc354c361ccc7d6175ba6f29364c7b514c Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 20 Sep 2018 11:44:37 +0000 Subject: [PATCH] Conditionally use delivered to address --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index cecfbc51..deb5088f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -756,7 +756,7 @@ public class FragmentCompose extends FragmentEx { } } - if (ref.deliveredto != null) { + if (ref.deliveredto != null && (ref.to == null || ref.to.length == 0)) { try { Log.i(Helper.TAG, "Setting delivered to=" + ref.deliveredto); ref.to = InternetAddress.parse(ref.deliveredto); @@ -767,6 +767,7 @@ public class FragmentCompose extends FragmentEx { if (ref.from != null && ref.from.length > 0) { String from = Helper.canonicalAddress(((InternetAddress) ref.from[0]).getAddress()); + Log.i(Helper.TAG, "From=" + from + " to=" + MessageHelper.getFormattedAddresses(ref.to, false)); for (EntityIdentity identity : identities) { String email = Helper.canonicalAddress(identity.email); if (from.equals(email)) {