Commit f9a486e8 f9a486e8ff07e3f35e250d366e748c7f5e712c13 by Sergey Poznyakoff

Bugfixes.

* libproto/mailer/smtp.c (_smtp_set_rcpt): Assign rcpt_to a copy of the
recipient address.
* mail/util.c (util_header_expand): Make sure exp is always initialized.
* mh/send.c (main): Process mtstailor before checking input files, so
its settings affect creation of additional headers and adresses. In
particular, this allows for setting the sender address in mtstailor.
1 parent 4066c947
......@@ -338,7 +338,9 @@ _smtp_set_rcpt (struct _smtp_mailer *smp, mu_message_t msg, mu_address_t to)
("mu_mailer_send_message(): explicit to not valid"));
return status;
}
smp->rcpt_to = to;
smp->rcpt_to = mu_address_dup (to);
if (!smp->rcpt_to)
return ENOMEM;
if (status)
return status;
......
......@@ -949,7 +949,9 @@ util_header_expand (mu_header_t *phdr)
if (mailvar_get (NULL, "inplacealiases",
mailvar_type_boolean, 0))
exp = alias_expand (p);
rc = mu_address_create (&new_addr, exp ? exp : p);
else
exp = p;
rc = mu_address_create (&new_addr, p);
if (rc)
{
errcnt++;
......
......@@ -772,7 +772,9 @@ main (int argc, char **argv)
opt_handler, NULL, &index);
mh_read_aliases ();
/* Process the mtstailor file */
read_mts_profile ();
argc -= index;
argv += index;
......@@ -823,10 +825,7 @@ main (int argc, char **argv)
return 1;
}
/* Process the mtstailor file and detach from the console if
required */
read_mts_profile ();
/* Detach from the console if required */
if (background && daemon (0, 0) < 0)
{
mu_error (_("cannot switch to background: %s"), mu_strerror (errno));
......