Commit a52e9228 a52e9228196390c2eca97727c805ac368d54484c by Sergey Poznyakoff

Assorted fixes.

* libmailutils/mailer/mailer.c (mu_mailer_send_fragments): Fix
3rd argument to _set_to.
* libproto/mailer/smtp.c (smtp_send_message): SIZE capability
can appear alone, without specifying maximum size.
* mh/mh_whom.c (mh_alias_expand): Recreate domain part for addresses
missing it.
1 parent e310eac5
......@@ -666,7 +666,7 @@ mu_mailer_send_fragments (mu_mailer_t mailer,
if (sender_addr)
from = sender_addr;
status = _set_to (&rcpt_addr, msg, from, mailer);
status = _set_to (&rcpt_addr, msg, to, mailer);
if (status)
return status;
if (rcpt_addr)
......
......@@ -467,10 +467,13 @@ smtp_send_message (mu_mailer_t mailer, mu_message_t msg,
mu_message_lines (msg, &lines) == 0)
{
size_t msgsize = size + lines;
if (strncmp (size_str, "SIZE=", 5) == 0)
{
size_t maxsize = strtoul (size_str + 5, NULL, 10);
if (msgsize && msgsize > maxsize)
if (msgsize && maxsize && msgsize > maxsize)
return EFBIG;
}
status = mu_smtp_mail_basic (smtp, mail_from,
"SIZE=%lu",
(unsigned long) msgsize);
......
......@@ -81,11 +81,15 @@ mh_alias_expand (const char *str, mu_address_t *paddr, int *incl)
if (mu_address_sget_domain (addr, i, &key) == 0 && key == NULL)
{
if (mu_address_sget_local_part (addr, i, &key) == 0
&& mh_alias_get_address (key, paddr, incl) == 0)
if (mu_address_sget_local_part (addr, i, &key) ||
mh_alias_get_address (key, paddr, incl) == 0 ||
/* Recreating address from local part adds the default
domain to it: */
mu_address_create (&subaddr, key))
continue;
}
else
{
status = mu_address_get_nth (addr, i, &subaddr);
if (status)
{
......@@ -93,7 +97,7 @@ mh_alias_expand (const char *str, mu_address_t *paddr, int *incl)
str, (unsigned long) i, mu_strerror (status));
continue;
}
}
mu_address_union (paddr, subaddr);
mu_address_destroy (&subaddr);
}
......