diff --git a/outputs/customsmtp/smtp.go b/outputs/customsmtp/smtp.go index 7b1542ad..2fec7fcc 100644 --- a/outputs/customsmtp/smtp.go +++ b/outputs/customsmtp/smtp.go @@ -194,8 +194,8 @@ func (c *Client) Auth(a Auth) error { resp64 := make([]byte, encoding.EncodedLen(len(resp))) encoding.Encode(resp64, resp) respEncoded := string(resp64) - authString := fmt.Sprintf("AUTH %s %s", mech, respEncoded) - code, msg64, err := c.cmd(0, strings.TrimSpace(authString)) + authString := strings.TrimSpace(fmt.Sprintf("AUTH %s %s", mech, respEncoded)) + code, msg64, err := c.cmd(0, authString) for err == nil { var msg []byte switch code {