forked from drew/smtprelay
smtp: use bytes.Cut, strings.Cut
Merge from net/smtp/smtp.go Obtained from: 4d8db00641cc9ff4f44de7df9b8c4f4a4f9416ee
This commit is contained in:
8
smtp.go
8
smtp.go
@@ -137,12 +137,8 @@ func (c *Client) ehlo() error {
|
|||||||
if len(extList) > 1 {
|
if len(extList) > 1 {
|
||||||
extList = extList[1:]
|
extList = extList[1:]
|
||||||
for _, line := range extList {
|
for _, line := range extList {
|
||||||
args := strings.SplitN(line, " ", 2)
|
k, v, _ := strings.Cut(line, " ")
|
||||||
if len(args) > 1 {
|
ext[k] = v
|
||||||
ext[args[0]] = args[1]
|
|
||||||
} else {
|
|
||||||
ext[args[0]] = ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if mechs, ok := ext["AUTH"]; ok {
|
if mechs, ok := ext["AUTH"]; ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user