fixed local account
authorHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sun, 10 Mar 2002 14:09:59 +0000 (14:09 +0000)
committerHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sun, 10 Mar 2002 14:09:59 +0000 (14:09 +0000)
ChangeLog.claws
configure.in
src/account.c
src/inc.c
src/prefs_account.c
src/procmime.c
src/procmsg.c
src/send.c
src/send.h

index 0b492509d6bb18b2947ca292eef63426847ce895..655c084ca883a2b0a31cbb602c4311f7c63d8ea2 100644 (file)
@@ -1,4 +1,19 @@
-2002-03-10 [paul]
+2002-03-10 [hoa]       0.7.3claws5
+
+       * src/account.c
+       * src/inc.c
+       * src/prefs_account.c
+       * src/procmsg.c
+       * src/send.[ch]
+               fixed the local account.
+               you have to change the default "/usr/sbin/sendmail"
+               to "/usr/sbin/sendmail -t" in the preferences of
+               the local account.
+
+       * src/procmime.c
+               removed some debug display for renderer
+
+2002-03-10 [paul]      0.7.3claws4
 
        * faq/en/sylpheed-faq-1.html
          faq/en/sylpheed-faq-2.html
index 2a32398dd35f75ff51f8abf5064f44c124d009fc..c4ccb860ba6a0cdc3472c4dca95f6e40210c0865 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws3
+EXTRA_VERSION=claws5
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index a1f0dad55f7f4ef5120491e0d044c83dba84e5d2..72eac024e74b90b0bd26bf53a942098fa713042a 100644 (file)
@@ -708,7 +708,8 @@ static void account_selected(GtkCList *clist, gint row, gint column,
 
                ac = gtk_clist_get_row_data(clist, row);
                if (ac->protocol == A_POP3 || ac->protocol == A_APOP ||
-                   ac->protocol == A_IMAP4 || ac->protocol == A_NNTP) {
+                   ac->protocol == A_IMAP4 || ac->protocol == A_NNTP ||
+                   ac->protocol == A_LOCAL) {
                        ac->recv_at_getall ^= TRUE;
                        account_clist_set_row(ac, row);
                }
@@ -775,7 +776,8 @@ static gint account_clist_set_row(PrefsAccount *ac_prefs, gint row)
        has_getallbox = (ac_prefs->protocol == A_POP3  ||
                         ac_prefs->protocol == A_APOP  ||
                         ac_prefs->protocol == A_IMAP4 ||
-                        ac_prefs->protocol == A_NNTP);
+                        ac_prefs->protocol == A_NNTP ||
+                        ac_prefs->protocol == A_LOCAL);
        getall = has_getallbox && ac_prefs->recv_at_getall;
 
        if (ac_prefs->is_default)
index f15928bab9ac2f6f9eb2db7d6a2861087a08ed6a..11e9e49685e8e3c1a976b150d4f66da123f55417 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -113,6 +113,7 @@ static gint inc_spool                       (void);
 static gint get_spool                  (FolderItem     *dest,
                                         const gchar    *mbox);
 
+static void inc_spool_account(PrefsAccount *account);
 static void inc_all_spool(void);
 static void inc_autocheck_timer_set_interval   (guint           interval);
 static gint inc_autocheck_func                 (gpointer        data);
@@ -210,28 +211,37 @@ static gint inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
        IncSession *session;
        gchar *text[3];
 
-       if (account->protocol == A_IMAP4 || account->protocol == A_NNTP) {
+       switch (account->protocol) {
+       case A_IMAP4:
+       case A_NNTP:
                folderview_check_new(FOLDER(account->folder));
                return 1;
-       }
-
-       session = inc_session_new(account);
-       if (!session) return 0;
-
-       inc_dialog = inc_progress_dialog_create();
-       inc_dialog->queue_list = g_list_append(inc_dialog->queue_list, session);
-       inc_dialog->mainwin = mainwin;
-       session->data = inc_dialog;
-
-       text[0] = NULL;
-       text[1] = account->account_name;
-       text[2] = _("Standby");
-       gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
-
-       main_window_set_toolbar_sensitive(mainwin);
-       main_window_set_menu_sensitive(mainwin);
 
-       return inc_start(inc_dialog);
+       case A_POP3:
+       case A_APOP:
+               session = inc_session_new(account);
+               if (!session) return 0;
+               
+               inc_dialog = inc_progress_dialog_create();
+               inc_dialog->queue_list = g_list_append(inc_dialog->queue_list,
+                                                      session);
+               inc_dialog->mainwin = mainwin;
+               session->data = inc_dialog;
+       
+               text[0] = NULL;
+               text[1] = account->account_name;
+               text[2] = _("Standby");
+               gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
+               
+               main_window_set_toolbar_sensitive(mainwin);
+               main_window_set_menu_sensitive(mainwin);
+               
+               return inc_start(inc_dialog);
+
+       case A_LOCAL:
+               inc_spool_account(account);
+               return 1;
+       }
 }
 
 void inc_all_account_mail(MainWindow *mainwin, gboolean notify)
@@ -258,6 +268,9 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean notify)
                return;
        }
 
+       /* check local folders */
+       inc_all_spool();
+
        /* check IMAP4 folders */
        for (; list != NULL; list = list->next) {
                PrefsAccount *account = list->data;
@@ -1081,7 +1094,8 @@ static void inc_all_spool(void)
                IncSession *session;
                PrefsAccount *account = list->data;
 
-               if (account->protocol == A_LOCAL)
+               if ((account->protocol == A_LOCAL) &&
+                   (account->recv_at_getall))
                        inc_spool_account(account);
        }
 }
index 5163ab8eb5988567edd852826f5541a55a5aa58d..91f0021fb7e77a76e6791fc7915c9f04b31e8357 100644 (file)
@@ -222,7 +222,7 @@ static PrefParam param[] = {
        {"use_mail_command", "FALSE", &tmp_ac_prefs.use_mail_command, P_BOOL,
         &basic.mailcmd_chkbtn, prefs_set_data_from_toggle, prefs_set_toggle},
 
-       {"mail_command", "/usr/sbin/sendmail", &tmp_ac_prefs.mail_command, P_STRING,
+       {"mail_command", "/usr/sbin/sendmail -t", &tmp_ac_prefs.mail_command, P_STRING,
         &basic.mailcmd_entry, prefs_set_data_from_entry, prefs_set_entry},
 
        {"use_nntp_auth", "FALSE", &tmp_ac_prefs.use_nntp_auth, P_BOOL,
index 075b710a15fbca320b199f5e137e3c19d45e15d1..1724692da7a314b459e6e62c84e122404e865bf9 100644 (file)
@@ -756,8 +756,6 @@ void renderer_read_config(void)
                if (cr == NULL)
                        continue;
 
-               printf("%s %s\n", cr->content_type, cr->renderer);
-
                renderer_list = g_list_append(renderer_list, cr);
        }
 
index 52764df6749525aa2483ec66b1aa5ed16ced7088..b9881cfdf053d2d6f7596b4bbdc5c58d2428874e 100644 (file)
@@ -1114,6 +1114,9 @@ gint procmsg_send_message_queue(const gchar *file)
                if(!from) {
                        g_warning(_("Queued message header is broken.\n"));
                        mailval = -1;
+               } else if (mailac && mailac->use_mail_command &&
+                          mailac->mail_command && (* mailac->mail_command)) {
+                       mailval = send_message_local(mailac->mail_command, fp);
                } else if (prefs_common.use_extsend && prefs_common.extsend_cmd) {
                        mailval = send_message_local(prefs_common.extsend_cmd, fp);
                } else {
index bb764a6d022ddaf233140da8d1132dc0f85ffc24..a22afc434a0157b90696921298fee19f94905ad7 100644 (file)
@@ -91,16 +91,25 @@ gint send_message(const gchar *file, PrefsAccount *ac_prefs, GSList *to_list)
                return -1;
        }
 
-       if (prefs_common.use_extsend && prefs_common.extsend_cmd) {
+       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);
+               fclose(fp);
+               return val;
+       }
+       else if (prefs_common.use_extsend && prefs_common.extsend_cmd) {
                val = send_message_local(prefs_common.extsend_cmd, fp);
                fclose(fp);
                return val;
        }
-
-       val = send_message_smtp(ac_prefs, to_list, fp);
-
-       fclose(fp);
-       return val;
+       else {
+               val = send_message_smtp(ac_prefs, to_list, fp);
+               
+               fclose(fp);
+               return val;
+       }
 }
 
 enum
@@ -111,6 +120,7 @@ enum
        Q_ACCOUNT_ID = 3
 };
 
+#if 0
 gint send_message_queue(const gchar *file)
 {
        static HeaderEntry qentry[] = {{"S:",   NULL, FALSE},
@@ -159,6 +169,9 @@ gint send_message_queue(const gchar *file)
        if (!to_list || !from) {
                g_warning(_("Queued message header is broken.\n"));
                val = -1;
+       } else if (ac && ac->use_mail_command && ac->mail_command &&
+                  (*ac->mail_command)) {
+               val = send_message_local(ac->mail_command, fp);
        } else if (prefs_common.use_extsend && prefs_common.extsend_cmd) {
                val = send_message_local(prefs_common.extsend_cmd, fp);
        } else {
@@ -194,11 +207,13 @@ gint send_message_queue(const gchar *file)
 
        return val;
 }
+#endif
 
 gint send_message_local(const gchar *command, FILE *fp)
 {
        FILE *pipefp;
        gchar buf[BUFFSIZE];
+       int r;
 
        g_return_val_if_fail(command != NULL, -1);
        g_return_val_if_fail(fp != NULL, -1);
@@ -218,7 +233,11 @@ gint send_message_local(const gchar *command, FILE *fp)
                fputc('\n', pipefp);
        }
 
-       pclose(pipefp);
+       r = pclose(pipefp);
+       if (r != 0) {
+               g_warning(_("external command failed: %s\n"), command);
+               return -1;
+       }
 
        return 0;
 }
index 31eba0aee2ea1f5d34e09f3276ef317862a7df87..4445946a45c1998afec2e71fe2a74b977766ef57 100644 (file)
@@ -32,7 +32,9 @@
 gint send_message              (const gchar    *file,
                                 PrefsAccount   *ac_prefs,
                                 GSList         *to_list);
+#if 0
 gint send_message_queue                (const gchar    *file);
+#endif
 gint send_message_local                (const gchar *command,
                                 FILE *fp);
 gint send_message_smtp         (PrefsAccount *ac_prefs,