It does not make sense to set mailbox without domain on incorrect input.
Rather set display name which is more likely useable value.
Test case:
test
is parsed as:
{ name = "test", mailbox = NULL, domain = NULL }
/* nope, should be addr-spec */
ctx->parser.data = start;
ret = parse_addr_spec(ctx);
+ if (ctx->addr.invalid_syntax && ctx->addr.name == NULL &&
+ ctx->addr.mailbox == NULL && ctx->addr.domain == NULL) {
+ ctx->addr.name = ctx->addr.mailbox;
+ ctx->addr.mailbox = NULL;
+ }
}
if (ret < 0)