Comments (3)
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 🙂
from aiosmtplib.
I'll work on it when I get some free time.
from aiosmtplib.
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
Connection from 127.0.0.1:52560
S: 220 localhost LMTP server ready
C: LHLO daniel-computer S: S: 250-daniel-computer
S: 250-PIPELINING
S: 250 SIZE
C: MAIL FROM:<local@localhost> size=185
S: 250 OK
C: RCPT TO:<local@localhost>
S: 250 OK
C: DATA
S: 354 Start mail input; end with <CRLF>.<CRLF>
C: From: local@localhost
C: To: local@localhost
C: Subject: Hello World!
C: Content-Type: text/plain; charset="utf-8"
C: Content-Transfer-Encoding: 7bit
C: MIME-Version: 1.0
C:
C: Sent via aiosmtplib
C: .
S: 250 OK <--- disconnects here
from aiosmtplib.
Related Issues (20)
- TypeError: connect() takes 1 positional argument but 2 were given HOT 3
- Source Address is not used in socket connection HOT 5
- Support URL for connection HOT 1
- CancelledError thrown when trying to send without authentication HOT 2
- Enabling UTF-8 for Authetication HOT 5
- 4 failing tests HOT 7
- add github issues url to bug reporting docs section HOT 1
- [Debian] Please include CHANGELOG.rst in your pypi releases. HOT 2
- Please support choice of outbound IP address HOT 1
- Suggestion: Support 'TLS optional' usage HOT 3
- Add testing section to docs HOT 2
- Timed out waiting for server ready message HOT 3
- Error trying to use the mail_options or rcpt_options arguments HOT 1
- Do not receive emails using Bcc, Cc headers HOT 2
- Custom DNS resolver HOT 1
- aiosmtplib is not working. [SSL: WRONG_VERSION_NUMBER] wrong version number HOT 1
- packaging issue: deployment of tests HOT 1
- Operation-level timeout HOT 4
- Gives AttributeError when calling with when HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiosmtplib.