Fix SMTP password use with password store.
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 1 Mar 2016 20:11:09 +0000 (21:11 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Tue, 1 Mar 2016 20:11:09 +0000 (21:11 +0100)
src/send_message.c

index fc5a420..43eef33 100644 (file)
@@ -304,11 +304,9 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
                                                        ac_prefs->smtp_server, "smtp", port,
                                                        &(smtp_session->pass))) {
                                        /* NOP */;
-                               } else if (ac_prefs->smtp_passwd)
-                                       smtp_session->pass =
+                               } else if ((smtp_session->pass =
                                                passwd_store_get(PWS_ACCOUNT, ac_prefs->account_name,
-                                                               PWS_ACCOUNT_SEND);
-                               else {
+                                                               PWS_ACCOUNT_SEND)) == NULL) {
                                        smtp_session->pass =
                                                input_dialog_query_password_keep
                                                        (ac_prefs->smtp_server,
@@ -325,10 +323,8 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
                                                        ac_prefs->smtp_server, "smtp", port,
                                                        &(smtp_session->pass))) {
                                        /* NOP */;
-                               } else if (ac_prefs->passwd)
-                                       smtp_session->pass = passwd_store_get(PWS_ACCOUNT,
-                                                       ac_prefs->account_name, PWS_ACCOUNT_RECV);
-                               else {
+                               } else if ((smtp_session->pass = passwd_store_get(PWS_ACCOUNT,
+                                                       ac_prefs->account_name, PWS_ACCOUNT_RECV)) == NULL) {
                                        smtp_session->pass =
                                                input_dialog_query_password_keep
                                                        (ac_prefs->smtp_server,