From fb756bb9a952d608d60adbc11a043ff641301b03 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Fri, 9 Mar 2018 16:01:50 +0100 Subject: [PATCH] lib-smtp: params: Make ORCPT parameter available separately if hidden capability is enabled. --- src/lib-smtp/smtp-common.h | 2 ++ src/lib-smtp/smtp-params.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) 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 */ -- 2.47.3