Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when MX record is empty #43

Open
daffarg opened this issue Jan 24, 2024 · 0 comments
Open

Panic when MX record is empty #43

daffarg opened this issue Jan 24, 2024 · 0 comments

Comments

@daffarg
Copy link

daffarg commented Jan 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant