]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: parse_addr_spec: Email address without local-part is invalid
authorPali Rohár <pali.rohar@gmail.com>
Sun, 5 Jun 2016 13:48:17 +0000 (15:48 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 6 Jun 2016 10:49:13 +0000 (13:49 +0300)
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.

src/lib-mail/message-address.c

index 4e861857e80c190d3a6192b97962e446e046e36f..93b7c83093bc9ae9b81865e45f8ee67c79288add 100644 (file)
@@ -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)