+2002-03-14 [christoph] 0.7.4claws3
+
+ * src/procmsg.c
+ * src/send.c
+ fix local delivery
+ (patch submitted by "Simon 'corecode' Schubert")
+ * src/prefs_common.c
+ * src/procmsg.c
+ fix gcc 3.0 warning
+
2002-03-14 [paul] 0.7.4claws2
* sync with sylpheed 0.7.4cvs2
gint hnum;
PrefsAccount *mailac = NULL, *newsac = NULL;
gchar *tmp = NULL;
+ int local = 0;
g_return_val_if_fail(file != NULL, -1);
case Q_SAVE_COPY_FOLDER:
if (!savecopyfolder) savecopyfolder = g_strdup(p);
break;
- default:
}
}
filepos = ftell(fp);
} else if (mailac && mailac->use_mail_command &&
mailac->mail_command && (* mailac->mail_command)) {
mailval = send_message_local(mailac->mail_command, fp);
+ local = 1;
} else if (prefs_common.use_extsend && prefs_common.extsend_cmd) {
mailval = send_message_local(prefs_common.extsend_cmd, fp);
+ local = 1;
} else {
if (!mailac) {
mailac = account_find_from_smtp_server(from, smtpserver);
}
}
if (mailval < 0) {
- alertpanel_error(_("Error occurred while sending the message to %s ."),
- mailac ? mailac->smtp_server : smtpserver);
+ if (!local)
+ alertpanel_error(
+ _("Error occurred while sending the message to `%s'."),
+ mailac ? mailac->smtp_server : smtpserver);
+ else
+ alertpanel_error(
+ _("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);
}
}
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
+#include <signal.h>
#include <unistd.h>
#include "intl.h"
FILE *pipefp;
gchar buf[BUFFSIZE];
int r;
+ sigset_t osig, mask;
g_return_val_if_fail(command != NULL, -1);
g_return_val_if_fail(fp != NULL, -1);
fputc('\n', pipefp);
}
+ /* we need to block SIGCHLD, otherwise pspell's handler will wait()
+ * the pipecommand away and pclose will return -1 because of its
+ * failed wait4().
+ */
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGCHLD);
+ sigprocmask(SIG_BLOCK, &mask, &osig);
+
r = pclose(pipefp);
+
+ sigprocmask(SIG_SETMASK, &osig, NULL);
if (r != 0) {
- g_warning(_("external command failed: %s\n"), command);
+ g_warning(_("external command `%s' failed with code `%i'\n"), command, r);
return -1;
}