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 · May be fixed by #44
Open

Panic when MX record is empty #43

daffarg opened this issue Jan 24, 2024 · 0 comments · May be fixed by #44

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.

@milesfaciane milesfaciane linked a pull request May 31, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant