go-smtp-mock icon indicating copy to clipboard operation
go-smtp-mock copied to clipboard

[BUG] Invalid email can be passed as argument for MAIL FROM, RCPT TO commands

Open bestwebua opened this issue 2 years ago • 0 comments

New bug checklist

Bug description

Regex for validation of email works in wrong way. We can pass to MAIL FROM, RCPT TO invalid email, like [email protected]@b.com. Seems when wrong email ends on valid domain it passes ([email protected]@b.com). We need to fix it and cover via tests.

Complete output when running smtpmock, including the stack trace and command used
INFO: 2022/11/18 19:20:12.419178 SMTP session started
INFO: 2022/11/18 19:20:12.419265 SMTP response: 220 Welcome
INFO: 2022/11/18 19:20:12.419533 SMTP request: EHLO gibson.biz
INFO: 2022/11/18 19:20:12.421156 SMTP response: 250 Received
INFO: 2022/11/18 19:20:12.421370 SMTP request: MAIL FROM:<[email protected]>
INFO: 2022/11/18 19:20:12.421935 SMTP response: 250 Received
INFO: 2022/11/18 19:20:12.422099 SMTP request: RCPT TO:<[email protected]@b.com>
INFO: 2022/11/18 19:20:12.422823 SMTP response: 250 Received
INFO: 2022/11/18 19:20:12.422972 SMTP request: DATA

bestwebua avatar Nov 18 '22 18:11 bestwebua