Add pop before smtp
[claws.git] / src / send.c
index 28308dc2aba316c244bae07295b0307c4a8ada37..167bdd096c743340ec6f2084aff4060033c29dbe 100644 (file)
@@ -83,8 +83,6 @@ gint send_message(const gchar *file, PrefsAccount *ac_prefs, GSList *to_list)
                return -1;
        }
 
-       printf("account: %p\n", ac_prefs);
-
        if (ac_prefs->use_mail_command && ac_prefs->mail_command &&
            (*ac_prefs->mail_command)) {
                val = send_message_local(ac_prefs->mail_command, fp);
@@ -361,6 +359,16 @@ gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list,
        clist = GTK_CLIST(dialog->dialog->clist);
        gtk_clist_append(clist, (gchar **)text);
 
+       if (ac_prefs->pop_before_smtp
+           && (ac_prefs->protocol == A_APOP || ac_prefs->protocol == A_POP3)) {
+               g_snprintf(buf, sizeof(buf), _("Doing POP before SMTP..."));
+               log_message("%s\n", buf);
+               progress_dialog_set_label(dialog->dialog, buf);
+               gtk_clist_set_text(clist, 0, 2, _("POP before SMTP"));
+               GTK_EVENTS_FLUSH();
+               inc_pop_before_smtp(ac_prefs);
+       }
+       
        g_snprintf(buf, sizeof(buf), _("Connecting to SMTP server: %s ..."),
                   ac_prefs->smtp_server);
        log_message("%s\n", buf);
@@ -371,20 +379,12 @@ gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list,
 #if USE_SSL
        SEND_EXIT_IF_ERROR((session = smtp_session_new
                                (ac_prefs->smtp_server, port, domain,
-                                user, pass, ac_prefs->ssl_smtp,
-                                0 
-                                | (ac_prefs->smtp_auth_enable_login ? SMTPAUTH_LOGIN : 0) 
-                                | (ac_prefs->smtp_auth_enable_cram_md5 ? SMTPAUTH_CRAM_MD5 : 0) 
-                                | (ac_prefs->smtp_auth_enable_digest_md5 ? SMTPAUTH_DIGEST_MD5 : 0))),
+                                user, pass, ac_prefs->ssl_smtp)),
                           "connecting to server");
 #else
        SEND_EXIT_IF_ERROR((session = smtp_session_new
                                (ac_prefs->smtp_server, port, domain,
-                                user, pass,
-                                0
-                                | (ac_prefs->smtp_auth_enable_login ? SMTPAUTH_LOGIN : 0) 
-                                | (ac_prefs->smtp_auth_enable_cram_md5 ? SMTPAUTH_CRAM_MD5 : 0) 
-                                | (ac_prefs->smtp_auth_enable_digest_md5 ? SMTPAUTH_DIGEST_MD5 : 0))),
+                                user, pass)),
                           "connecting to server");
 #endif
 
@@ -393,7 +393,8 @@ gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list,
        GTK_EVENTS_FLUSH();
 
        SEND_EXIT_IF_NOTOK
-               (smtp_from(SMTP_SESSION(session), ac_prefs->address),
+               (smtp_from(SMTP_SESSION(session), ac_prefs->address,
+                          ac_prefs->smtp_auth_type),
                 "sending MAIL FROM");
 
        progress_dialog_set_label(dialog->dialog, _("Sending RCPT TO..."));