From 1bb2a9d33e8cd193c21f9995fb7852c7562cafcf Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 27 Feb 2018 21:52:12 +0100 Subject: First prototype --- libsylph/imap.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libsylph/imap.c') diff --git a/libsylph/imap.c b/libsylph/imap.c index aa0d737..a61dc2b 100644 --- a/libsylph/imap.c +++ b/libsylph/imap.c @@ -707,7 +707,17 @@ static gint imap_session_connect(IMAPSession *session) log_message(_("creating IMAP4 connection to %s:%d ...\n"), SESSION(session)->server, SESSION(session)->port); - pass = account->passwd; + if (account->master_password != NULL) { + if (decrypt_data(&pass, + account->passwd, + account->master_password, + strlen(account->passwd)) != RC_OK) { + session_destroy(session); + return -1; + } + } else { + pass = account->passwd; + } if (!pass) pass = account->tmp_pass; if (!pass) { -- cgit v1.3