Skip to content

Commit

Permalink
fix: added note regarding SRS rewrite issue if MAIL FROM converted to…
Browse files Browse the repository at this point in the history
… lowercase (incorrectly by a system admin/postmaster)
  • Loading branch information
titanism committed Dec 28, 2024
1 parent 9a66eb7 commit 14b6856
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions helpers/on-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ async function onData(stream, _session, fn) {
const shouldThrow =
parseRootDomain(parseHostFromDomainOrAddress(to.address)) ===
env.WEB_HOST;
//
// TODO: we may want to take into account that MAIL FROM is rewritten to lowercase
// and therefore the reverse of an address like this wouldn't work (it'd return `null`)
// (e.g. `srs0=34cf=tv=example.com=foo@fe-bounces.example.com`)
// as it should get rewritten to foo@fe-bounces.example.com
// however because srs0 was rewritten from SRS0
// and because tv was rewritten from TV it is not being delivered correctly
//
to.address = checkSRS(to.address, shouldThrow);
return to;
}),
Expand Down

0 comments on commit 14b6856

Please sign in to comment.