summaryrefslogtreecommitdiff
path: root/mu
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-12-14 18:18:19 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2011-12-14 18:18:19 +0200
commit7d68b3cd17901190e6030327230df8e124161643 (patch)
tree9fe8e8923c230f4c131e890b0b6597e095493c4b /mu
parentf675ddc76948a39c4b6dd4a47460a63e731e927a (diff)
downloadmailutils-7d68b3cd17901190e6030327230df8e124161643.tar.gz
mailutils-7d68b3cd17901190e6030327230df8e124161643.tar.bz2
Imap client: implement starttls.
* include/mailutils/imap.h (mu_imap_starttls): New proto. * include/mailutils/imapio.h: Use mu_imapio_t instead of struct _mu_imapio *. * include/mailutils/sys/imap.h (MU_IMAP_CLIENT_STARTTLS_RX): New state. * libmailutils/imapio/transport.c: New file. * libmailutils/imapio/Makefile.am (libimapio_la_SOURCES): Add transport.c * libproto/imap/starttls.c: New file. * libproto/imap/Makefile.am (libmu_imap_la_SOURCES): Add starttls.c. * libproto/imap/capability.c (mu_imap_capability): Bugfix: set up comparator and reclaim function after successful return from mu_list_map. * libproto/imap/capatst.c (mu_imap_capability_test): Clear MU_IMAP_RESP bit. * libproto/imap/err.c (mu_imap_strerror): Return errstr only if MU_IMAP_RESP is set. * mu/imap.c: Implement starttls.
Diffstat (limited to 'mu')
-rw-r--r--mu/imap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mu/imap.c b/mu/imap.c
index ffa7d6810..4c114f306 100644
--- a/mu/imap.c
+++ b/mu/imap.c
@@ -455,6 +455,15 @@ com_connect (int argc, char **argv)
}
static int
+com_starttls (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
+{
+ int status = mu_imap_starttls (imap);
+ if (status)
+ report_failure ("starttls", status);
+ return 0;
+}
+
+static int
com_logout (int argc MU_ARG_UNUSED, char **argv MU_ARG_UNUSED)
{
int status = 0;
@@ -988,6 +997,10 @@ struct mutool_command imap_comtab[] = {
com_disconnect,
NULL,
N_("close connection") },
+ { "starttls", 1, 1, 0,
+ com_starttls,
+ NULL,
+ N_("Establish TLS encrypted channel") },
{ "login", 2, 3, 0,
com_login,
N_("USER [PASS]"),

Return to:

Send suggestions and report system problems to the System administrator.