Skip to content

Commit

Permalink
Include SMTPUTF8 in MAIL command when necessary
Browse files Browse the repository at this point in the history
Per RFC 6531 section 3.4
  • Loading branch information
mlt committed Oct 28, 2024
1 parent 3ea5182 commit 5cb27b9
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/smtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1705,18 +1705,11 @@ int smtp_send_envelope(smtp_server_t *srv,
/* send */
if (!mailfrom_cmd_was_sent)
{
if (dsn_return)
{
e = smtp_send_cmd(srv, errstr, "MAIL FROM:<%s> RET=%s",
strcasecmp(envelope_from, "MAILER-DAEMON") == 0
? "" : envelope_from, dsn_return);
}
else
{
e = smtp_send_cmd(srv, errstr, "MAIL FROM:<%s>",
strcasecmp(envelope_from, "MAILER-DAEMON") == 0
? "" : envelope_from);
}
e = smtp_send_cmd(srv, errstr, "MAIL FROM:<%s>%s%s%s",
strcasecmp(envelope_from, "MAILER-DAEMON") == 0
? "" : envelope_from,
dsn_return ? " RET=" : "", dsn_return ? dsn_return : "",
want_eai && srv->cap.flags & SMTP_CAP_SMTPUTF8 ? " SMTPUTF8" : "");
if (e != SMTP_EOK)
{
return e;
Expand Down

0 comments on commit 5cb27b9

Please sign in to comment.