]> 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, 12 Jun 2017 13:56:56 +0000 (16:56 +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 eb73eefece6c84b6ca146ec4b4e69d52f3164c20..2a234c8f4b7545e0067924ae613d915a5ec1405b 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)