Skip to content

Commit

Permalink
lib-mail: parse_addr_spec: Email address without local-part is invalid
Browse files Browse the repository at this point in the history
Add explicit invalid_syntax flag also when end of input occure because
address is without domain invalid and in this case it was not correctly
propagated.
  • Loading branch information
pali authored and sirainen committed Jun 12, 2017
1 parent eafb1c5 commit bde3ab4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib-mail/message-address.c
Expand Up @@ -162,6 +162,10 @@ static int parse_addr_spec(struct message_address_parser_context *ctx)
str_truncate(ctx->parser.last_comment, 0);

ret = parse_local_part(ctx);
if (ret <= 0) {
/* end of input or parsing local-part failed */
ctx->addr.invalid_syntax = TRUE;
}
if (ret != 0 && *ctx->parser.data == '@') {
ret2 = parse_domain(ctx);
if (ret2 <= 0)
Expand Down

0 comments on commit bde3ab4

Please sign in to comment.