postalsys / mailauth

Command line utility and a Node.js library for email authentication
Other
126 stars 10 forks source link

Timeout #37

Closed schack closed 1 year ago

schack commented 1 year ago

Describe the bug Not really bug, just a question, and I couldn't find another way to contact you. Is there a way to configure DNS timeout values?

From time to time, I detect invalid SPF records, and if I try again, the issue is gone.

DNS timeouts are the only reason I can think of.

andris9 commented 1 year ago

If you need special handling for DNS, you can provide a custom DNS resolver to Mailauth. Mailauth uses dnsPromises.resolve method for all DNS queries and if you provide the resolver option to Mailauth methods, it would use that method instead.

schack commented 1 year ago

Thanks, sadly, I'm not sure how to implement that :-( Pretty new in the js world

andris9 commented 1 year ago

Does the SPF query end with a temperror state? This is what is supposed to happen on DNS timeouts etc. To handle it either retry the request or improve your DNS stack. Increasing allowed time is not the correct approach - with UDP if you already need to wait you are probably not going to get the answer anyway. If the result is something else than temperror then it might be an issue on the Mailauth side.