-
Notifications
You must be signed in to change notification settings - Fork 48
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
Support LMTP #210
Comments
Not right now, but it does look very similar to SMTP. Possible we could add it in future. If you want to try to get together a PR, that might speed things up 🙂 |
I'll work on it when I get some free time. |
I tried implementing it similarly to how python's smtplib implements it, by extending the SMTP class and changing the EHLO command to LHLO, but it doesn't deliver the email and throws. DEBUG:asyncio:Using selector: EpollSelector
DEBUG:asyncio:Get address info localhost:24, type=<SocketKind.SOCK_STREAM: 1>
DEBUG:asyncio:Getting address info localhost:24, type=<SocketKind.SOCK_STREAM: 1> took 1.631ms: [(<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('::1', 24, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('127.0.0.1', 24))]
DEBUG:asyncio:<asyncio.TransportSocket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 46574), raddr=('127.0.0.1', 24)> connected to localhost:24: (<_SelectorSocketTransport fd=6 read=polling write=<idle, bufsize=0>>, <aiosmtplib.protocol.SMTPProtocol object at 0x7fc8ab964550>)
DEBUG:asyncio:Close <_UnixSelectorEventLoop running=False closed=False debug=True>
ERROR:asyncio:Future exception was never retrieved
future: <Future finished exception=SMTPServerDisconnected('Connection lost') created at /usr/lib/python3.10/asyncio/base_events.py:429>
source_traceback: Object created at (most recent call last):
File "/home/shi/Documents/aiosmtplib/main.py", line 25, in <module>
asyncio.run(main())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
self.run_forever()
File "/usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
self._run_once()
File "/usr/lib/python3.10/asyncio/base_events.py", line 1901, in _run_once
handle._run()
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/home/shi/Documents/aiosmtplib/main.py", line 18, in main
await a.send_message(message)
File "/home/shi/Documents/aiosmtplib/aiosmtplib/smtp.py", line 1424, in send_message
return await self.sendmail(
File "/home/shi/Documents/aiosmtplib/aiosmtplib/smtp.py", line 1301, in sendmail
response = await self.data(message, timeout=timeout)
File "/home/shi/Documents/aiosmtplib/aiosmtplib/smtp.py", line 894, in data
return await self.protocol.execute_data_command(message, timeout=timeout)
File "/home/shi/Documents/aiosmtplib/aiosmtplib/protocol.py", line 328, in execute_data_command
response = await self.read_response(timeout=timeout)
File "/home/shi/Documents/aiosmtplib/aiosmtplib/protocol.py", line 271, in read_response
self._response_waiter = self._loop.create_future()
File "/usr/lib/python3.10/asyncio/base_events.py", line 429, in create_future
return futures.Future(loop=self)
aiosmtplib.errors.SMTPServerDisconnected: Connection lost I have no idea why this happens, from what I can tell all the commands are sent correctly, but when the server replies to the data command the client abruptly disconnects. Here is the conversation that produced the error above
|
Python's smtplib has a LMTP client for sending mails through the LMTP protocol. This is missing from aiosmtplib, are there plans for supporting sending emails through LMTP?
The text was updated successfully, but these errors were encountered: