rawlog \
gdbhelper \
idxview \
+ imap_utf7 \
listview \
logview \
maildirlock \
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/lib-mail \
+ -I$(top_srcdir)/src/lib-imap \
-I$(top_srcdir)/src/lib-index \
-I$(top_srcdir)/src/lib-storage/index/maildir \
-I$(top_srcdir)/src/auth
idxview_SOURCES = \
idxview.c
+imap_utf7_LDADD = \
+ ../lib-imap/imap-utf7.o \
+ ../lib/liblib.a
+imap_utf7_SOURCES = \
+ imap-utf7.c
+
listview_LDADD = \
../lib/liblib.a
listview_SOURCES = \
--- /dev/null
+/* Copyright (c) 2008 Dovecot authors, see the included COPYING file */
+
+#include "lib.h"
+#include "str.h"
+#include "imap-utf7.h"
+
+#include <stdio.h>
+
+int main(int argc ATTR_UNUSED, const char *argv[])
+{
+ string_t *dest;
+ bool reverse = FALSE;
+ int ret;
+
+ lib_init();
+
+ if (argv[1] != NULL && strcmp(argv[1], "-r") == 0) {
+ reverse = TRUE;
+ argv++;
+ }
+
+ if (argv[1] == NULL) {
+ fprintf(stderr, "Usage: %s [-r] <string>", argv[0]);
+ return 1;
+ }
+
+ dest = t_str_new(256);
+ ret = reverse ?
+ imap_utf8_to_utf7(argv[1], dest) :
+ imap_utf7_to_utf8(argv[1], dest);
+ if (ret < 0) {
+ fprintf(stderr, "Invalid input\n");
+ return 1;
+ }
+ printf("%s\n", str_c(dest));
+ return 0;
+}