more sync with 0.8.11cvs35
authorPaul Mangan <paul@claws-mail.org>
Sun, 27 Apr 2003 09:17:35 +0000 (09:17 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sun, 27 Apr 2003 09:17:35 +0000 (09:17 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/common/smtp.c
src/common/smtp.h
src/procmsg.c
src/send_message.c
src/toolbar.c

index 23b7c82..b9a9d43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-04-25
+
+       * src/smtp.[ch]: set the response string to SMTPSession::error_msg
+         if error occurred.
+       * src/send_message.c: show error dialog if error occurred.
+       * src/main.c: send_queue()
+         src/mainwindow.c: send_queue_cb(): don't show error dialog here.
+
 2003-04-25
 
        * src/session.c: session_close(): kill child process only if
index 5c725e2..193ea6f 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-27 [paul]      0.8.11claws118
+
+       * more sync with 0.8.11cvs35
+               see ChangeLog 2003-04-25
+
 2003-04-26 [christoph] 0.8.11claws117
 
        * src/folder.c
index df13b96..10a0f34 100644 (file)
@@ -1,3 +1,12 @@
+2003-04-25
+
+       * src/smtp.[ch]: ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤é±þÅúʸ»úÎó¤ò SMTPSession::error_msg
+         ¤Ë¥»¥Ã¥È¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/send_message.c: ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤é¥¨¥é¡¼¥À¥¤¥¢¥í¥°¤òɽ¼¨¡£
+       * src/main.c: send_queue()
+         src/mainwindow.c: send_queue_cb(): ¤³¤³¤Ç¤Ï¥¨¥é¡¼¥À¥¤¥¢¥í¥°¤òɽ¼¨
+         ¤·¤Ê¤¤¡£
+
 2003-04-25
 
        * src/session.c: session_close(): state ¤¬ SESSION_DISCONNECTED ¤Ç
index 89b20a6..db7924b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws117
+EXTRA_VERSION=claws118
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 8598403..f1d627d 100644 (file)
@@ -97,6 +97,7 @@ Session *smtp_session_new(void)
        session->auth_type                 = 0;
 
        session->error_val                 = SM_OK;
+       session->error_msg                 = NULL;
 
        return SESSION(session);
 }
@@ -111,6 +112,8 @@ static void smtp_session_destroy(Session *session)
        g_free(smtp_session->from);
 
        g_free(smtp_session->send_data);
+
+       g_free(smtp_session->error_msg);
 }
 
 static gint smtp_from(SMTPSession *session)
@@ -434,11 +437,17 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
                log_warning(_("error occurred on SMTP session\n"));
                smtp_session->state = SMTP_ERROR;
                smtp_session->error_val = SM_ERROR;
+               g_free(smtp_session->error_msg);
+               smtp_session->error_msg = g_strdup(msg);
                return -1;
        }
 
-       if (msg[0] == '5' && msg[1] == '3' && msg[2] == '5') {
-               smtp_session->state = SMTP_AUTH_FAILED;
+       if (!strncmp(msg, "535", 3)) {
+               log_warning(_("error occurred on authentication\n"));
+               smtp_session->state = SMTP_ERROR;
+               smtp_session->error_val = SM_AUTHFAIL;
+               g_free(smtp_session->error_msg);
+               smtp_session->error_msg = g_strdup(msg);
                return -1;
        }
 
@@ -446,6 +455,8 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
                log_warning(_("error occurred on SMTP session\n"));
                smtp_session->state = SMTP_ERROR;
                smtp_session->error_val = SM_ERROR;
+               g_free(smtp_session->error_msg);
+               smtp_session->error_msg = g_strdup(msg);
                return -1;
        }
 
@@ -536,7 +547,6 @@ static gint smtp_session_recv_msg(Session *session, const gchar *msg)
                session_disconnect(session);
                break;
        case SMTP_ERROR:
-       case SMTP_AUTH_FAILED:
        default:
                log_warning(_("error occurred on SMTP session\n"));
                smtp_session->error_val = SM_ERROR;
index 017917d..a8234f5 100644 (file)
@@ -76,7 +76,6 @@ typedef enum
        SMTP_RSET,
        SMTP_QUIT,
        SMTP_ERROR,
-       SMTP_AUTH_FAILED,
        SMTP_DISCONNECTED,
 
        N_SMTP_PHASE
@@ -109,6 +108,7 @@ struct _SMTPSession
        SMTPAuthType auth_type;
 
        SMTPErrorValue error_val;
+       gchar *error_msg;
 };
 
 Session *smtp_session_new      (void);
index 3f4cb20..11fd5b7 100644 (file)
@@ -1057,18 +1057,6 @@ gint procmsg_send_message_queue(const gchar *file)
                                mailval = send_message_smtp(&tmp_ac, to_list, fp);
                        }
                }
-               if (mailval < 0) {
-                       if (!local)
-                               alertpanel_error_log(
-                                       _("Error occurred while sending the message to `%s'."),
-                                       mailac ? mailac->smtp_server : smtpserver);
-                       else
-                               alertpanel_error_log(
-                                       _("Error occurred while sending the message with command `%s'."),
-                                       (mailac && mailac->use_mail_command && 
-                                        mailac->mail_command && (*mailac->mail_command)) ? 
-                                               mailac->mail_command : prefs_common.extsend_cmd);
-               }
        }
 
        fseek(fp, filepos, SEEK_SET);
index e31beff..2a682fc 100644 (file)
@@ -43,6 +43,7 @@
 #include "account.h"
 #include "progressdialog.h"
 #include "inputdialog.h"
+#include "alertpanel.h"
 #include "manage_window.h"
 #include "utils.h"
 #include "gtkutils.h"
@@ -77,12 +78,15 @@ static gint send_send_data_finished (Session                *session,
                                         guint                   len,
                                         gpointer                data);
 
-static SendProgressDialog *send_progress_dialog_create (void);
-static void send_progress_dialog_destroy       (SendProgressDialog *dialog);
+static SendProgressDialog *send_progress_dialog_create(void);
+static void send_progress_dialog_destroy(SendProgressDialog *dialog);
 
 static void send_cancel_button_cb      (GtkWidget      *widget,
                                         gpointer        data);
 
+static void send_put_error             (Session        *session);
+
+
 gint send_message(const gchar *file, PrefsAccount *ac_prefs, GSList *to_list)
 {
        FILE *fp;
@@ -227,6 +231,9 @@ gint send_message_queue(const gchar *file)
                if (val == 0 && newsac) {
                        fseek(fp, fpos, SEEK_SET);
                        val = news_post_stream(FOLDER(newsac->folder), fp);
+                       if (val < 0)
+                               alertpanel_error_log(_("Error occurred while posting the message to %s ."),
+                                                newsac->nntp_server);
                }
        }
 
@@ -418,6 +425,12 @@ gint send_message_smtp(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp)
        else if (dialog->cancelled == TRUE)
                ret = -1;
 
+       if (ret == -1) {
+               manage_window_focus_in(dialog->dialog->window, NULL, NULL);
+               send_put_error(session);
+               manage_window_focus_in(dialog->dialog->window, NULL, NULL);
+       }
+
        session_destroy(session);
        send_progress_dialog_destroy(dialog);
 
@@ -468,7 +481,6 @@ static gint send_recv_message(Session *session, const gchar *msg, gpointer data)
                state_str = _("Quitting");
                break;
        case SMTP_ERROR:
-       case SMTP_AUTH_FAILED:
                g_warning("send: error: %s\n", msg);
                return 0;
        default:
@@ -551,3 +563,36 @@ static void send_cancel_button_cb(GtkWidget *widget, gpointer data)
 
        dialog->cancelled = TRUE;
 }
+
+static void send_put_error(Session *session)
+{
+       gchar *msg;
+
+       msg = SMTP_SESSION(session)->error_msg;
+
+       switch (SMTP_SESSION(session)->error_val) {
+       case SM_ERROR:
+       case SM_UNRECOVERABLE:
+               if (msg)
+                       alertpanel_error_log
+                               (_("Error occurred while sending the message:\n%s"),
+                                msg);
+               else
+                       alertpanel_error_log
+                               (_("Error occurred while sending the message."));
+               break;
+       case SM_AUTHFAIL:
+               if (msg)
+                       alertpanel_error_log
+                               (_("Authentication failed:\n%s"), msg);
+               else
+                       alertpanel_error_log
+                               (_("Authentication failed."));
+       default:
+               if (session->state == SESSION_ERROR)
+                       alertpanel_error_log
+                               (_("Error occurred while sending the message."));
+               break;
+       }
+}
+
index 67a7a76..005ec4a 100644 (file)
@@ -1985,12 +1985,8 @@ void send_queue_cb(gpointer data, guint action, GtkWidget *widget)
                Folder *folder = list->data;
 
                if (folder->queue) {
-                       gint res = procmsg_send_queue
-                               (folder->queue, prefs_common.savemsg);
-                       if (res < 0) 
-                               alertpanel_error(_("Some errors occurred while sending queued messages."));
-                       if (res)
-                               folder_item_scan(folder->queue);
+                       procmsg_send_queue(folder->queue, prefs_common.savemsg);
+                       folder_item_scan(folder->queue);
                }
        }
 }