Run sendmail.
304{
305 char *ps = NULL, *path = NULL, *s = NULL, *childout = NULL;
308 int i;
309
311 {
313
318 {
320 unlink(msg);
322 return i;
323 }
324
327 }
328 else
329 {
332 }
333
334 if (!s)
335 {
336 mutt_error(
_(
"$sendmail must be set in order to send mail"));
337 return -1;
338 }
339
340 ps = s;
341 i = 0;
342 while ((ps = strtok(ps, " ")))
343 {
344 if (i)
345 {
347 break;
349 }
350 else
351 {
353 ps = strrchr(ps, '/');
354 if (ps)
355 ps++;
356 else
357 ps = path;
359 }
360 ps = NULL;
361 i++;
362 }
363
365 {
366
367
368 if (ps)
369 {
370 ps = NULL;
371 while ((ps = strtok(ps, " ")))
372 {
374 ps = NULL;
375 }
376 }
377
378 const bool c_use_8bit_mime =
cs_subset_bool(sub,
"use_8bit_mime");
379 if (eightbit && c_use_8bit_mime)
381
382 const bool c_use_envelope_from =
cs_subset_bool(sub,
"use_envelope_from");
383 if (c_use_envelope_from)
384 {
386 if (c_envelope_from_address)
387 {
390 }
392 {
395 }
396 }
397
399 if (c_dsn_notify)
400 {
403 }
404
406 if (c_dsn_return)
407 {
410 }
412 const char **e = NULL;
414 {
416 }
420 }
421
423
426
427
428
429
430
432 {
434 }
435
436 if (i != (
EX_OK & 0xff))
437 {
439 {
442 if (childout)
443 {
444 struct stat st = { 0 };
445
446 if ((stat(childout, &st) == 0) && (st.st_size > 0))
447 {
450
452
453 pview.
banner =
_(
"Output of the delivery process");
456
458 }
459 }
460 }
461 }
462 else if (childout)
463 {
464 unlink(childout);
465 }
466
472
473 if (i == (
EX_OK & 0xff))
474 i = 0;
476 i = 1;
477 else
478 i = -1;
479 return i;
480}
const struct Address * cs_subset_address(const struct ConfigSubset *sub, const char *name)
Get an Address config item by name.
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
const struct Expando * cs_subset_expando(const struct ConfigSubset *sub, const char *name)
Get an Expando config item by name.
void mutt_need_hard_redraw(void)
Force a hard refresh.
int expando_filter(const struct Expando *exp, const struct ExpandoRenderCallback *erc, void *data, MuttFormatFlags flags, int max_cols, char **env_list, struct Buffer *buf)
Render an Expando and run the result through a filter.
const struct ExpandoRenderCallback NntpRenderCallbacks[]
Callbacks for Newsrc Expandos.
bool OptNoCurses
(pseudo) when sending in batch mode
bool OptNewsSend
(pseudo) used to change behavior when posting
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
const char * mutt_str_sysexit(int err_num)
Return a string matching an error code.
int nntp_post(struct Mailbox *m, const char *msg)
Post article.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
#define TAILQ_FIRST(head)
#define TAILQ_NEXT(elm, field)
#define TAILQ_EMPTY(head)
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
static void add_args_one(struct SendmailArgArray *args, const struct Address *addr)
Add an Address to a dynamic array.
static void add_args(struct SendmailArgArray *args, struct AddressList *al)
Add a list of Addresses to a dynamic array.
static int send_msg(const char *path, struct SendmailArgArray *args, const char *msg, char **tempfile, int wait_time)
Invoke sendmail in a subshell.
String manipulation buffer.
size_t dsize
Length of data.
Container for Accounts, Notifications.
char ** env
Private copy of the environment variables.