]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: server: Add smtp_server_reply_ehlo_add_params().
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 3 Nov 2018 10:18:10 +0000 (11:18 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 25 Jun 2019 11:19:16 +0000 (11:19 +0000)
src/lib-smtp/smtp-server-reply.c
src/lib-smtp/smtp-server.h

index c5efde3144fb2135029c87a0a38024b325cdc783..daa667efe341bdfb548691c59fbc1d2a7c15db29 100644 (file)
@@ -533,6 +533,29 @@ void smtp_server_reply_ehlo_add_param(struct smtp_server_reply *reply,
        str_append(textbuf, "\r\n");
 }
 
+void smtp_server_reply_ehlo_add_params(struct smtp_server_reply *reply,
+                                      const char *keyword,
+                                      const char *const *params)
+{
+       string_t *textbuf;
+
+       i_assert(!reply->submitted);
+       i_assert(reply->content != NULL);
+       textbuf = reply->content->text;
+
+       reply->content->last_line = str_len(textbuf);
+       str_append(textbuf, reply->content->status_prefix);
+       str_append(textbuf, keyword);
+       if (params != NULL) {
+               while (*params != NULL) {
+                       str_append_c(textbuf, ' ');
+                       str_append(textbuf, *params);
+                       params++;
+               }
+       }
+       str_append(textbuf, "\r\n");
+}
+
 void smtp_server_reply_ehlo_add_8bitmime(struct smtp_server_reply *reply)
 {
        struct smtp_server_cmd_ctx *cmd = &reply->command->context;
index 97b6e03cb0892420a4f3c4a2a5aa2f116b9a62b4..ff9ee92f5e90d0fe1f67082a11c5fc10f3cf0248 100644 (file)
@@ -633,6 +633,9 @@ void smtp_server_reply_ehlo_add(struct smtp_server_reply *reply,
                                const char *keyword);
 void smtp_server_reply_ehlo_add_param(struct smtp_server_reply *reply,
        const char *keyword, const char *param_fmt, ...) ATTR_FORMAT(3, 4);
+void smtp_server_reply_ehlo_add_params(struct smtp_server_reply *reply,
+                                      const char *keyword,
+                                      const char *const *params) ATTR_NULL(3);
 
 void smtp_server_reply_ehlo_add_8bitmime(struct smtp_server_reply *reply);
 void smtp_server_reply_ehlo_add_binarymime(struct smtp_server_reply *reply);