Skip to content

Panic when MX record is empty #43

@daffarg

Description

@daffarg

client, err := DialTimeout(fmt.Sprintf("%s:%d", mx[0].Host, 25), forceDisconnectAfter)

I just tested with random host name, for example like invalidmail.com. The LookupMX function does not return an error, but the MX record is empty. So, it will panic on line 64 when accessing the first index of empty MX record. I think it's better to check the length of MX record first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions