1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 03:05:31 +00:00

Small improvement

This commit is contained in:
M66B 2023-02-14 11:56:08 +01:00
parent 4fbbd42292
commit 8740cb38a5

View file

@ -179,6 +179,7 @@ public class MessageHelper {
private static final int MAX_META_EXCERPT = 1024; // characters private static final int MAX_META_EXCERPT = 1024; // characters
private static final int FORMAT_FLOWED_LINE_LENGTH = 72; // characters private static final int FORMAT_FLOWED_LINE_LENGTH = 72; // characters
private static final int MAX_DIAGNOSTIC = 250; // characters private static final int MAX_DIAGNOSTIC = 250; // characters
private static final int DKIM_MIN_TEXT = 100; // characters
private static final String DOCTYPE = "<!DOCTYPE"; private static final String DOCTYPE = "<!DOCTYPE";
private static final String HTML_START = "<html>"; private static final String HTML_START = "<html>";
@ -2142,8 +2143,8 @@ public class MessageHelper {
String length = kv.get("l"); String length = kv.get("l");
if (!TextUtils.isEmpty(length) && TextUtils.isDigitsOnly(length)) { if (!TextUtils.isEmpty(length) && TextUtils.isDigitsOnly(length)) {
int l = Integer.parseInt(length); int l = Integer.parseInt(length);
if (l < 100) if (l < DKIM_MIN_TEXT)
throw new IllegalArgumentException("Body length " + l + " < 100"); throw new IllegalArgumentException("Body length " + l + " < " + DKIM_MIN_TEXT);
if (l < body.length()) if (l < body.length())
body = body.substring(0, l); body = body.substring(0, l);
} }