The way I read the RFC is that whitespace is not allowed before the
boundary marker, only afterwards, so the checks for leading WS are
removed, and the missing check for trailing WS is added.
See RFC 2046 §5.1.1: """The boundary delimiter line is then defined
as a line consisting entirely of two hyphen characters ("-", decimal
value 45) followed by the boundary parameter value from the
Content-Type header field, optional linear whitespace, and a
terminating CRLF."""
Looks like it's not necessary, and, moreover, I'm getting this with recent ICU (64.2):
```
/usr/include/unicode/localpointer.h:67:1: error: template with C linkage
67 | template<typename T>
| ^~~~~~~~
/var/tmp/portage/dev-libs/vmime-9999/work/vmime-9999/src/vmime/charsetConverter_icu.cpp:37:1: note: ‘extern "C"’ linkage started here
37 | extern "C" {
| ^~~~~~~~~~
```
(there's also an issue about that, #218)
Spammers use "Name <addr> <addr>" to trick some parsers.
My expectations as to what the outcome should be is presented
in the updated mailboxTest.cpp.
The DFA in mailbox::parseImpl is hereby redone so as to pick the
rightmost address-looking portion as the address, rather than
something in between. While doing so, it will also no longer mangle
the name part anymore (it does this by keeping a "as_if_name"
variable around until the end).
The behavior of current VMIME implementation will result in address a@b.c
with an empty name. That is because the parsing is stopped whenever a
wihtespace and a at-character is seen. We should continue the parsing to
deduce the real address (e@f.g in the example).
GNU SASL is a nice library but comes with its own prerequisites and dependencies.
As IMAP and POP3 are able to work without SASL it seems to me logical to add some authentication support to SMTP too. As these days most of the communication is encrypted it is common to use simple mechanism like AUTH PLAIN, so I have added it.