cisagov / trustymail

Scan domains and return data based on trustworthy email best practices
Creative Commons Zero v1.0 Universal
189 stars 31 forks source link

Timeout for microsecond? #121

Closed xqdd closed 3 years ago

jsf9k commented 3 years ago

Thanks for the issue @XQDD! Could you fill out the description? I don't understand what the issue is based only on the title.

xqdd commented 3 years ago

-t --timeout=TIMEOUT The DNS lookup timeout in seconds. (Default is 5.) --smtp-timeout=TIMEOUT The SMTP connection timeout in seconds. (Default is 5.)

Thanks for your quickly reply, my mean is that here only offer timeout for second but can't use 0.5(500ms) because they are int type. @jsf9k

jsf9k commented 3 years ago

@XQDD, are you asking that we allow floats for those two timeout parameters? Or are you asking that we specify in the documentation that only integer values are accepted?

xqdd commented 3 years ago

Well, it would be great if allow float.

mcdonnnj commented 3 years ago

@XQDD I apologize for the delay in further response from us.

--smtp-timeout is limited by the underlying Python smtplib library to values in seconds only.

Although the two packages using --timeout, dnspython and py3dns, appear to support timeouts more granular than seconds, the underlying code appears to round up to the nearest second in practice.

Due to these third party limitations we would not be able to implement this feature at this time. However, if something were to change in the future it would be worth revisiting.