summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2024-03-09 18:01:11 +0800
committerKevin McCarthy <kevin@8t8.us>2024-03-09 18:01:11 +0800
commit9b967f07ab58c981f9f43702921393633bd832ff (patch)
treea36263dd2454dfbac1a48009da0b985cc16051e3
parent039cc5211bce1206ab914d64b35ee42d4dc1e8d6 (diff)
Fix smtp client to respect $use_envelope_from option.
The code was only looking to see if $envelope_from_address had a value, not if $use_envelope_from was set. Add extra safety checks to make sure the mailbox value isn't NULL.
-rw-r--r--smtp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/smtp.c b/smtp.c
index 391a905f..8837c7da 100644
--- a/smtp.c
+++ b/smtp.c
@@ -343,9 +343,9 @@ mutt_smtp_send (const ADDRESS* from, const ADDRESS* to, const ADDRESS* cc,
/* it might be better to synthesize an envelope from from user and host
* but this condition is most likely arrived at accidentally */
- if (EnvFrom)
+ if (option (OPTENVFROM) && EnvFrom && EnvFrom->mailbox)
envfrom = EnvFrom->mailbox;
- else if (from)
+ else if (from && from->mailbox)
envfrom = from->mailbox;
else
{