mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
Handle space after "MAIL FROM:" for Outlook SMTP
This commit is contained in:
@@ -212,7 +212,7 @@ func (ss *Session) greetHandler(cmd string, arg string) {
|
|||||||
func (ss *Session) readyHandler(cmd string, arg string) {
|
func (ss *Session) readyHandler(cmd string, arg string) {
|
||||||
if cmd == "MAIL" {
|
if cmd == "MAIL" {
|
||||||
// (?i) makes the regex case insensitive
|
// (?i) makes the regex case insensitive
|
||||||
re := regexp.MustCompile("(?i)^FROM:<([^>]+)>( [\\w= ]+)?$")
|
re := regexp.MustCompile("(?i)^FROM:\\s*<([^>]+)>( [\\w= ]+)?$")
|
||||||
m := re.FindStringSubmatch(arg)
|
m := re.FindStringSubmatch(arg)
|
||||||
if m == nil {
|
if m == nil {
|
||||||
ss.send("501 Was expecting MAIL arg syntax of FROM:<address>")
|
ss.send("501 Was expecting MAIL arg syntax of FROM:<address>")
|
||||||
|
|||||||
Reference in New Issue
Block a user