3x-ui/internal
Yuri Khachaturyan 1cfd7b49b0
fix(email): build an RFC 5322 message with a proper From address and name (#5941)
The notification/test email carried only From/To/Subject/MIME headers, and
the From header was the raw SMTP username. Two problems:

- When the SMTP login is not a bare email address (common with relays and
  submission services), the From header has no valid address and strict
  receivers reject the message — e.g. Gmail returns "550-5.7.1 ... Messages
  missing a valid address in From: header".
- There was no Date (mandatory per RFC 5322 section 3.6) and no Message-ID,
  which also raises spam score.

Add smtpFrom (sender address) and smtpFromName (display name) settings and
assemble the message with net/mail: a name-addr From ("Name" <addr>), a
Date, a Message-ID, and an RFC 2047 encoded Subject, in a deterministic
header order. From falls back to the username when smtpFrom is empty, so
existing setups keep working. Wire the settings through the model, the SMTP
send and test paths, the Email settings UI, and all 13 locale files;
regenerate the Zod/OpenAPI artifacts.

Validate smtpFrom in AllSetting.CheckValid (reject anything net/mail cannot
parse), which surfaces a bad address at configuration time and prevents CRLF
header injection; strip CR/LF in buildMessage as defense in depth. Add
buildMessage and CheckValid tests.
2026-07-14 12:55:46 +02:00
..
config v3.5.0 2026-07-12 22:08:19 +02:00
database fix(database): make cross-db migration lossless, transactional, and pre-checked 2026-07-12 20:14:07 +02:00
eventbus style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
logger fix(inbounds): apply runtime changes after the DB commit (#5768) 2026-07-08 22:12:28 +02:00
mtproto refactor: modernize Go with strings.SplitSeq and maps.Copy 2026-07-08 22:10:54 +02:00
sub feat(xray): update xray-core to v26.7.11 and adapt panel 2026-07-12 00:30:47 +02:00
tunnelmonitor style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
util feat(xray): update xray-core to v26.7.11 and adapt panel 2026-07-12 00:30:47 +02:00
web fix(email): build an RFC 5322 message with a proper From address and name (#5941) 2026-07-14 12:55:46 +02:00
xray feat(xray): update xray-core to v26.7.11 and adapt panel 2026-07-12 00:30:47 +02:00