Comments (7)
Huh, that's odd. The tests use the aiosmtpd
package to run an SMTPD server. From the errors it seems like it's not responding, but only when used with login. CI runs on the python 3.9 buster image, so I'm surprised this is different.
from aiosmtplib.
How is the aiosmtpd server started? I'm eager to try having a closer look. :)
In particular, how does the test login/password gets feeded to aiosmtpd to populate the "user database" for the actual test?
from aiosmtplib.
The server is initialized here: https://github.com/cole/aiosmtplib/blob/main/tests/conftest.py#L26. it is used in many test though, not just the failing ones.
Login is hardcoded to test/test here: https://github.com/cole/aiosmtplib/blob/main/tests/smtpd.py#L127
from aiosmtplib.
@cole I found out the issue.
In https://github.com/cole/aiosmtplib/blob/main/tests/smtpd.py#L110, the smtp_AUTH is what receives and is supposed to pass auth with login attempts to smtp_AUTH_LOGIN.
But, in https://github.com/cole/aiosmtplib/blob/main/aiosmtplib/auth.py#L70 you iterate on the diverse auth methods available, and the first picked is "plain" which is not supported by your test smtpd server in a way that makes it not return anything.
This patch fixes the issue:
--- tests/smtpd.py 2021-05-07 20:39:01.075953762 +0000
+++ tests/smtpd.py 2021-05-07 20:35:39.225206826 +0000
@@ -115,6 +115,8 @@
if arg[:5] == "LOGIN":
await self.smtp_AUTH_LOGIN(arg[6:])
+ else:
+ await self.push("504 Unsupported auth method.")
async def smtp_AUTH_LOGIN(self, arg):
with open("/tmp/test", "a") as testfile:
I don't know why the issue doesn't occur in your CI runner.
from aiosmtplib.
Yes, thank you. The suggested patch resolved the issue for me (and the openSUSE package).
from aiosmtplib.
Happy to help.
from aiosmtplib.
Released 1.1.6 with the change.
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
- 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
- Support LMTP HOT 3
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.