Email subjects may includes some symbol characters, however there is a limit in size and on what characters are allowed
- All folder and character names are set at a Max of 200
Function<String, String> LENGTH =
text -> StringUtils.strip(StringUtils.substring(text, 0, 200).trim());
- All character finished in "." or "~" are not allowed
- All "non-printables" and all "control" characters are removed
- The following characters are also removed:
/ , \ , * , ? , | , < , > , # , % , '
Function<String, String> ENDING = new Function<>() {
private final Pattern pattern = Pattern.compile("(\\.|~)+$");
@Override
public String apply(final String text) {
return this.pattern.matcher(text.trim()).replaceAll("").trim();
}
};
Comments