Added DKIM logging

This commit is contained in:
M66B 2024-05-11 08:07:56 +02:00
parent 18c85872f3
commit 8cb5a52ae7
1 changed files with 13 additions and 2 deletions

View File

@ -2561,15 +2561,26 @@ public class MessageHelper {
sig.update(data);
boolean verified = sig.verify(signature);
Log.i("DKIM valid=" + verified +
String msg = "DKIM valid=" + verified +
" algo=" + salgo +
" dns=" + dns +
" from=" + formatAddresses(getFrom()));
" from=" + formatAddresses(getFrom());
Log.i(msg);
EntityLog.log(context, verified ? EntityLog.Type.Debug2 : EntityLog.Type.Debug3, msg);
if (verified)
return signer;
} catch (Throwable ex) {
Log.e("DKIM", ex);
Address[] from;
try {
from = getFrom();
} catch (Throwable ignored) {
from = null;
}
EntityLog.log(context, EntityLog.Type.Debug3, "DKIM failed" +
" from=" + formatAddresses(from) +
" ex=" + Log.formatThrowable(ex));
}
return null;