From: Stephan Bosch Date: Fri, 9 Mar 2018 15:01:50 +0000 (+0100) Subject: lib-smtp: params: Make ORCPT parameter available separately if hidden capability... X-Git-Tag: 2.3.1~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32b2ef232c4c22c39401b5d141296075d7cf648b;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: params: Make ORCPT parameter available separately if hidden capability is enabled. --- diff --git a/src/lib-smtp/smtp-common.h b/src/lib-smtp/smtp-common.h index 70636c2b40..cd8607cb9c 100644 --- a/src/lib-smtp/smtp-common.h +++ b/src/lib-smtp/smtp-common.h @@ -42,6 +42,8 @@ enum smtp_capability { SMTP_CAPABILITY_VRFY = BIT(10), SMTP_CAPABILITY_ETRN = BIT(11), SMTP_CAPABILITY_XCLIENT = BIT(12), + + SMTP_CAPABILITY__ORCPT = BIT(24), }; struct smtp_capability_name { const char *name; diff --git a/src/lib-smtp/smtp-params.c b/src/lib-smtp/smtp-params.c index 7f28be79fe..d677aa5e01 100644 --- a/src/lib-smtp/smtp-params.c +++ b/src/lib-smtp/smtp-params.c @@ -854,8 +854,9 @@ int smtp_params_rcpt_parse(pool_t pool, const char *args, ret = -1; break; } - } else if ((caps & SMTP_CAPABILITY_DSN) != 0 && - strcmp(param.keyword, "ORCPT") == 0) { + } else if (((caps & SMTP_CAPABILITY_DSN) != 0 || + (caps & SMTP_CAPABILITY__ORCPT) != 0) && + strcmp(param.keyword, "ORCPT") == 0) { if (smtp_params_rcpt_parse_orcpt (&prparser, param.value) < 0) { ret = -1; @@ -967,7 +968,8 @@ smtp_params_rcpt_write_orcpt(string_t *buffer, { if (params->orcpt.addr_type == NULL) return; - if ((caps & SMTP_CAPABILITY_DSN) == 0) + if ((caps & SMTP_CAPABILITY_DSN) == 0 && + (caps & SMTP_CAPABILITY__ORCPT) == 0) return; /* ORCPT=
: RFC 3461 */