From 7fa02a7aa4fd6b1cf1a71a953d0a655a3f26810a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ho=C3=A0=20Vi=C3=AAt=20Dinh?= Date: Sun, 10 Mar 2002 14:09:59 +0000 Subject: [PATCH 1/1] fixed local account --- ChangeLog.claws | 17 +++++++++++++- configure.in | 2 +- src/account.c | 6 +++-- src/inc.c | 54 ++++++++++++++++++++++++++++----------------- src/prefs_account.c | 2 +- src/procmime.c | 2 -- src/procmsg.c | 3 +++ src/send.c | 33 +++++++++++++++++++++------ src/send.h | 2 ++ 9 files changed, 87 insertions(+), 34 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 0b492509d..655c084ca 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -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 diff --git a/configure.in b/configure.in index 2a32398dd..c4ccb860b 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/account.c b/src/account.c index a1f0dad55..72eac024e 100644 --- a/src/account.c +++ b/src/account.c @@ -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) diff --git a/src/inc.c b/src/inc.c index f15928bab..11e9e4968 100644 --- 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); } } diff --git a/src/prefs_account.c b/src/prefs_account.c index 5163ab8eb..91f0021fb 100644 --- a/src/prefs_account.c +++ b/src/prefs_account.c @@ -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, diff --git a/src/procmime.c b/src/procmime.c index 075b710a1..1724692da 100644 --- a/src/procmime.c +++ b/src/procmime.c @@ -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); } diff --git a/src/procmsg.c b/src/procmsg.c index 52764df67..b9881cfdf 100644 --- a/src/procmsg.c +++ b/src/procmsg.c @@ -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 { diff --git a/src/send.c b/src/send.c index bb764a6d0..a22afc434 100644 --- a/src/send.c +++ b/src/send.c @@ -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; } diff --git a/src/send.h b/src/send.h index 31eba0aee..4445946a4 100644 --- a/src/send.h +++ b/src/send.h @@ -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, -- 2.25.1