diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2018-07-18 22:59:14 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2018-07-18 22:59:14 +0100 |
commit | 8c34c611e07d3678920b9f13ba2ae627eb0255e9 (patch) | |
tree | 1c6c372f177fbf4e69f3f910d3797756482b1a41 /src | |
parent | 946515bfe62796f6c0d6554e9e1e227f33253e7c (diff) |
I18N: reject SMTPUTF8 MAIL command when facility not advertised
Diffstat (limited to 'src')
-rw-r--r-- | src/src/smtp_in.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 6e2c45a8c..ff0f6acaa 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -4580,7 +4580,7 @@ while (done <= 0) if (dsn_advertised) { /* Check if the dsn envid has been already set */ - if (dsn_envid != NULL) + if (dsn_envid) { synprot_error(L_smtp_syntax_error, 501, NULL, US"ENVID can be specified once only"); @@ -4669,17 +4669,21 @@ while (done <= 0) #ifdef SUPPORT_I18N case ENV_MAIL_OPT_UTF8: - if (smtputf8_advertised) + if (!smtputf8_advertised) { - DEBUG(D_receive) debug_printf("smtputf8 requested\n"); - message_smtputf8 = allow_utf8_domains = TRUE; - if (Ustrncmp(received_protocol, US"utf8", 4) != 0) - { - int old_pool = store_pool; - store_pool = POOL_PERM; - received_protocol = string_sprintf("utf8%s", received_protocol); - store_pool = old_pool; - } + synprot_error(L_smtp_syntax_error, 501, NULL, + US"SMTPUTF8 used when not advertised"); + goto COMMAND_LOOP; + } + + DEBUG(D_receive) debug_printf("smtputf8 requested\n"); + message_smtputf8 = allow_utf8_domains = TRUE; + if (Ustrncmp(received_protocol, US"utf8", 4) != 0) + { + int old_pool = store_pool; + store_pool = POOL_PERM; + received_protocol = string_sprintf("utf8%s", received_protocol); + store_pool = old_pool; } break; #endif |