]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
deliver -m: Assume the given mailbox name is in UTF-8 format.
authorTimo Sirainen <tss@iki.fi>
Sat, 1 Nov 2008 20:49:14 +0000 (22:49 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 1 Nov 2008 20:49:14 +0000 (22:49 +0200)
--HG--
branch : HEAD

src/deliver/Makefile.am
src/deliver/deliver.c

index 988cd676d129057c0deb6016509ee70811619f04..c8ca0303ae9bc9c8d12e7d799575390fdb9c2f5e 100644 (file)
@@ -7,6 +7,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/lib-auth \
        -I$(top_srcdir)/src/lib-dict \
        -I$(top_srcdir)/src/lib-mail \
+       -I$(top_srcdir)/src/lib-imap \
        -I$(top_srcdir)/src/lib-index \
        -I$(top_srcdir)/src/lib-settings \
        -I$(top_srcdir)/src/lib-storage \
index 15a272c06c4922ecc60f132d53bb85f6feeef5ba..ef803d207f8fa8db2e3f0332c807edc9289c7da4 100644 (file)
@@ -24,6 +24,7 @@
 #include "message-address.h"
 #include "mail-namespace.h"
 #include "raw-storage.h"
+#include "imap-utf7.h"
 #include "dict.h"
 #include "auth-client.h"
 #include "mail-send.h"
@@ -815,6 +816,7 @@ int main(int argc, char *argv[])
        time_t mtime;
        int i, ret;
        pool_t userdb_pool = NULL;
+       string_t *str;
 
        i_set_failure_exit_callback(failure_exit_callback);
 
@@ -873,8 +875,14 @@ int main(int argc, char *argv[])
                                i_fatal_status(EX_USAGE, "Missing -m argument");
                        /* Ignore -m "". This allows doing -m ${extension}
                           in Postfix to handle user+mailbox */
-                       if (*argv[i] != '\0')
-                               mailbox = argv[i];
+                       if (*argv[i] != '\0') {
+                               str = t_str_new(256);
+                               if (imap_utf8_to_utf7(argv[i], str) < 0) {
+                                       i_fatal("Mailbox name not UTF-8: %s",
+                                               mailbox);
+                               }
+                               mailbox = str_c(str);
+                       }
                } else if (strcmp(argv[i], "-n") == 0) {
                        deliver_set->mailbox_autocreate = FALSE;
                } else if (strcmp(argv[i], "-s") == 0) {