diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-12-14 18:18:19 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-12-14 18:18:19 +0200 |
commit | 7d68b3cd17901190e6030327230df8e124161643 (patch) | |
tree | 9fe8e8923c230f4c131e890b0b6597e095493c4b /mu | |
parent | f675ddc76948a39c4b6dd4a47460a63e731e927a (diff) | |
download | mailutils-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.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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]"), |