From f004867d19426114c93244a03b22fe28f79bbf83 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 13 Dec 2021 08:36:14 +0100 Subject: [PATCH] Added sent message debugging --- app/src/main/java/eu/faircode/email/ServiceSend.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ServiceSend.java b/app/src/main/java/eu/faircode/email/ServiceSend.java index b983042e4a..55e0d677e8 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSend.java +++ b/app/src/main/java/eu/faircode/email/ServiceSend.java @@ -44,6 +44,7 @@ import androidx.preference.PreferenceManager; import com.sun.mail.smtp.SMTPSendFailedException; import com.sun.mail.util.TraceOutputStream; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -527,6 +528,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); boolean reply_move = prefs.getBoolean("reply_move", false); + boolean protocol = prefs.getBoolean("protocol", false); boolean debug = (prefs.getBoolean("debug", false) || BuildConfig.DEBUG); if (message.identity == null) @@ -705,6 +707,13 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar recipients.add(a); } + if (protocol && BuildConfig.DEBUG) { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + imessage.writeTo(bos); + for (String line : bos.toString().split("\n")) + EntityLog.log(this, line); + } + String via = "via " + ident.host + "/" + ident.user + " recipients=" + TextUtils.join(", ", recipients);