Skip to content

Swallowed error if EHLO fails #511

@john8329

Description

@john8329

Description

In smtp.smtp.go:87 the EHLO error is ignored and the library returns a generic EOF which is out of context. It should instead return the error given to EHLO, which can help figuring out configuration issues since it's the server response.

// hello runs a hello exchange if needed.
func (c *Client) hello() error {
	if !c.didHello {
		c.didHello = true
		err := c.ehlo()
		if err != nil {
			c.helloError = c.helo()
		}
	}
	return c.helloError
}

To Reproduce

Misconfigure LocalName for example with one that has spaces, gmail responds with an error

Expected behaviour

A clear error is shown the moment it happens

Screenshots

No response

Attempted Fixes

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions