mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 22:56:33 +02:00
Native DKIM: process body text length
This commit is contained in:
@@ -2132,6 +2132,15 @@ public class MessageHelper {
|
||||
} else
|
||||
throw new IllegalArgumentException(c[1]);
|
||||
|
||||
String length = kv.get("l");
|
||||
if (!TextUtils.isEmpty(length) && TextUtils.isDigitsOnly(length)) {
|
||||
int l = Integer.parseInt(length);
|
||||
if (l < 100)
|
||||
throw new IllegalArgumentException("Body length " + l + " < 100");
|
||||
if (l < body.length())
|
||||
body = body.substring(0, l);
|
||||
}
|
||||
|
||||
Log.i("DKIM body=" + body.replace("\r\n", "|"));
|
||||
|
||||
byte[] bh = MessageDigest.getInstance(halgo).digest(body.getBytes()); // TODO: charset?
|
||||
|
||||
Reference in New Issue
Block a user