cole / aiosmtplib

asyncio smtplib implementation
MIT License
347 stars 48 forks source link

Custom DNS resolver #186

Open azmeuk opened 1 year ago

azmeuk commented 1 year ago

Is your feature request related to a problem? Please describe. I would love if I could set a custom DNS resolver to the aiosmtplib client, in the fashion of aiohttp. This would be particularly convenient in unit test environment where I setup custom DNS servers with fake domains resolving to custom test smtp servers.

Describe the solution you'd like A resolver parameter, like aiohttp or

Describe alternatives you've considered I could resolve all the domains with aiodns and manually retrieve the IP addresses behind the domain. I find this is far less convenient though.

azmeuk commented 1 year ago

Additionally a custom TCP Connector would be great, in order to force IPV4 or IPV6 connection.