]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: params: Make ORCPT parameter available separately if hidden capability...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 9 Mar 2018 15:01:50 +0000 (16:01 +0100)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 14 Mar 2018 08:11:01 +0000 (10:11 +0200)
src/lib-smtp/smtp-common.h
src/lib-smtp/smtp-params.c

index 70636c2b40e984673198507edc7372b73357b193..cd8607cb9c7fa34fd5ab5c2ebecce1eb00f29352 100644 (file)
@@ -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;
index 7f28be79fe773eb31c932bc9384b56d706dfc162..d677aa5e01b96d1fb7227ae97bb6aa4e9715b9e2 100644 (file)
@@ -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=<address>: RFC 3461 */