kisli / vmime

VMime Mail Library
http://www.vmime.org
GNU General Public License v3.0
273 stars 110 forks source link

Default initialization for vmime::mailbox (vmime::emailAddress) #295

Closed jengelh closed 4 months ago

jengelh commented 9 months ago

Testcase:

#include <vmime/mailbox.hpp>
int main()
{
        vmime::mailbox mb;
        printf(">%s<\n", mb.generate().c_str());
        mb.setEmail("");
        printf(">%s<\n", mb.generate().c_str());
        return 0;
}

Observed output:

>@<
>invalid@invalid<

Expected output:

>invalid@invalid<
>invalid@invalid<

What do you think? Should the default ctor produce something that is at least syntactically valid?

jengelh commented 4 months ago

I think we can leave it as-is. Only vmime::emailAddress::parse enforces the RFC2822 conformance, everything else does not care.