]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap: Remove obsolete ID parameter log functions
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Wed, 1 Mar 2023 13:41:46 +0000 (14:41 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 31 Mar 2023 05:54:46 +0000 (05:54 +0000)
src/lib-imap/imap-id.c
src/lib-imap/imap-id.h

index 39f00c84bbea17d08f53bb26ca09e9987ed2066e..b399d205433e3e1458b16cdc77d279431abffcc8 100644 (file)
@@ -121,56 +121,6 @@ const char *imap_id_reply_generate(const char *settings)
        return ret;
 }
 
-void imap_id_log_reply_append(string_t *reply, const char *key,
-                             const char *value)
-{
-       if (str_len(reply) > 0)
-               str_append(reply, ", ");
-       str_append(reply, str_sanitize(key, IMAP_ID_KEY_MAX_LEN));
-       str_append_c(reply, '=');
-       str_append(reply, value == NULL ? "NIL" : str_sanitize(value, 80));
-}
-
-const char *imap_id_args_get_log_reply(const struct imap_arg *args,
-                                      const char *settings)
-{
-       const char *const *keys, *key, *value;
-       string_t *reply;
-       bool log_all;
-
-       if (settings == NULL || *settings == '\0')
-               return NULL;
-       if (!imap_arg_get_list(args, &args))
-               return NULL;
-
-       log_all = strcmp(settings, "*") == 0;
-       reply = t_str_new(256);
-       keys = t_strsplit_spaces(settings, " ");
-       while (!IMAP_ARG_IS_EOL(&args[0]) &&
-              !IMAP_ARG_IS_EOL(&args[1])) {
-               if (!imap_arg_get_string(args, &key)) {
-                       /* broken input */
-                       args += 2;
-                       continue;
-               }
-               args++;
-               if (strlen(key) > 30) {
-                       /* broken: ID spec requires fields to be max. 30
-                          octets */
-                       args++;
-                       continue;
-               }
-
-               if (log_all || str_array_icase_find(keys, key)) {
-                       if (!imap_arg_get_nstring(args, &value))
-                               value = "";
-                       imap_id_log_reply_append(reply, key, value);
-               }
-               args++;
-       }
-       return str_len(reply) == 0 ? NULL : str_c(reply);
-}
-
 void
 imap_id_add_log_entry(struct imap_id_log_entry *log_entry, const char *key,
                      const char *value)
index 8dc3916d9045b4eef3128f307756313901dcbf8e..88d15aefe8715307438c0688d12988efa4ec91b0 100644 (file)
@@ -18,13 +18,6 @@ struct imap_id_log_entry {
 
 /* Return ID reply based on given settings. */
 const char *imap_id_reply_generate(const char *settings);
-/* Return a line that should be logged based on given args and settings.
-   Returns NULL if nothing should be logged. */
-const char *imap_id_args_get_log_reply(const struct imap_arg *args,
-                                      const char *settings);
-/* Append [, ]key=value to the reply sanitized. */
-void imap_id_log_reply_append(string_t *reply, const char *key,
-                             const char *value);
 /* Format the IMAP ID parameters into string-fields of the given event, and
    into a printable log message. */
 void imap_id_add_log_entry(struct imap_id_log_entry *log_entry,