Added sent message debugging

This commit is contained in:
M66B 2021-12-13 08:36:14 +01:00
parent 0c4e8451b3
commit f004867d19
1 changed files with 9 additions and 0 deletions

View File

@ -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);