mirror of https://github.com/M66B/FairEmail.git
Native DKIM: process body text length
This commit is contained in:
parent
1ab550206e
commit
e8a8e483da
|
@ -2132,6 +2132,15 @@ public class MessageHelper {
|
||||||
} else
|
} else
|
||||||
throw new IllegalArgumentException(c[1]);
|
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", "|"));
|
Log.i("DKIM body=" + body.replace("\r\n", "|"));
|
||||||
|
|
||||||
byte[] bh = MessageDigest.getInstance(halgo).digest(body.getBytes()); // TODO: charset?
|
byte[] bh = MessageDigest.getInstance(halgo).digest(body.getBytes()); // TODO: charset?
|
||||||
|
|
Loading…
Reference in New Issue