From 8de2d887916cbdd3c2d756e77116585babd026f2 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Wed, 28 Feb 2018 23:51:46 +0100 Subject: prefs_common.use_master_password added --- src/send_message.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/send_message.c') diff --git a/src/send_message.c b/src/send_message.c index 695246a..7b66423 100644 --- a/src/send_message.c +++ b/src/send_message.c @@ -649,18 +649,19 @@ static gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp) if (ac_prefs->smtp_userid) { smtp_session->user = g_strdup(ac_prefs->smtp_userid); if (ac_prefs->smtp_passwd) { - if(ac_prefs->master_password != NULL) { - if (decrypt_data(&(smtp_session->pass), - ac_prefs->smtp_passwd, - ac_prefs->master_password, - strlen(ac_prefs->smtp_passwd)) != RC_OK) { - session_destroy(session); - return -1; - } - } else { - smtp_session->pass = - g_strdup(ac_prefs->smtp_passwd); - } + if(prefs_common.use_master_password && + ac_prefs->master_password != NULL) { + if (decrypt_data(&(smtp_session->pass), + ac_prefs->smtp_passwd, + ac_prefs->master_password, + strlen(ac_prefs->smtp_passwd) + 1) != RC_OK) { + session_destroy(session); + return -1; + } + } else { + smtp_session->pass = + g_strdup(ac_prefs->smtp_passwd); + } } else if (ac_prefs->tmp_smtp_pass) { smtp_session->pass = g_strdup(ac_prefs->tmp_smtp_pass); -- cgit v1.3