Commit e7537ee6 e7537ee62061e0f5d5c6ce4658a13fdc70588069 by Sergey Poznyakoff

Fall back to "Sender:" and "From:" headers (in that order), if the envelope sender is not available.

1 parent 3d2e7c41
......@@ -113,14 +113,23 @@ sieve_get_message_sender (message_t msg, char **ptext)
return rc;
rc = envelope_sender (envelope, NULL, 0, &size);
if (rc)
return rc;
if (rc == 0)
{
if (!(text = malloc (size + 1)))
return ENOMEM;
envelope_sender (envelope, text, size + 1, NULL);
}
else
{
header_t hdr = NULL;
message_get_header (msg, &hdr);
if (rc = header_aget_value (hdr, MU_HEADER_SENDER, &text))
rc = header_aget_value (hdr, MU_HEADER_FROM, &text);
}
if (rc == 0)
*ptext = text;
return 0;
return rc;
}
static int
......