Skip to content

Commit

Permalink
♻️ Refactor email extraction logic in SMTPServer.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
cfpwastaken committed Mar 24, 2024
1 parent e152e03 commit 18b08b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/smtp/SMTPServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export default class SMTPServer {
to: [],
content: ""
}
const email = msg.split(":")[1].split(">")[0].replace("<", "")

const email = msg.substring(msg.indexOf("<") + 1, msg.lastIndexOf(">"))

if (email.endsWith(`@${getConfig("host")}`) && auth.user != email) {
// RFC 4954 Section 6:
Expand Down

0 comments on commit 18b08b4

Please sign in to comment.