author | Alberto Bertogli
<albertito@blitiri.com.ar> 2015-11-06 03:46:13 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2015-11-06 10:27:11 UTC |
parent | fbf1060b71000b9c54647ad8b0a63fbf5b81cddf |
chasquid.go | +4 | -4 |
diff --git a/chasquid.go b/chasquid.go index e7a7273..4cefc73 100644 --- a/chasquid.go +++ b/chasquid.go @@ -380,8 +380,8 @@ func (c *Conn) NOOP(params string) (code int, msg string) { func (c *Conn) MAIL(params string) (code int, msg string) { // params should be: "FROM:<name@host>" // First, get rid of the "FROM:" part (but check it, it's mandatory). - sp := strings.SplitN(params, ":", 2) - if len(sp) != 2 || sp[0] != "FROM" { + sp := strings.SplitN(strings.ToLower(params), ":", 2) + if len(sp) != 2 || sp[0] != "from" { return 500, "unknown command" } @@ -415,8 +415,8 @@ func (c *Conn) MAIL(params string) (code int, msg string) { func (c *Conn) RCPT(params string) (code int, msg string) { // params should be: "TO:<name@host>" // First, get rid of the "TO:" part (but check it, it's mandatory). - sp := strings.SplitN(params, ":", 2) - if len(sp) != 2 || sp[0] != "TO" { + sp := strings.SplitN(strings.ToLower(params), ":", 2) + if len(sp) != 2 || sp[0] != "to" { return 500, "unknown command" }