Open tabascoterrier opened 3 years ago
Hi @tabascoterrier !
It's very interesting topic. It's really useful if you could trigger some errors in this way :) Your idea is great, because RCPT TO
command is sent very early and you can trigger any reponse on every later stage... will try to find a while to use your idea and maybe extend it a bit :) Thank you!
It's great to see this project revived!
I'm in a position where I could really do with being able to trigger error responses to certain emails (e.g. '550 Mailbox unavailable' and '421 Service not available') to aid in testing.
I tried to do this myself by adding a handle_RCPT handler into smtp.py's
AsyncMessage
class:This does return the expected SMTP response codes, but now thehandle_message
handler no longer fires so the message doesn't make it into the DB, and at this point my lack of knowledge of aiosmtpd and async Python becomes very obvious :)It turns out this does work fine after all.