Skip to content
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

Feature request: IMAP server #52

Open
kvdb opened this issue Nov 18, 2022 · 2 comments
Open

Feature request: IMAP server #52

kvdb opened this issue Nov 18, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@kvdb
Copy link

kvdb commented Nov 18, 2022

I've been a happy pytest-localserver for a while now. It works great for SMTP. Since we moved from GSuite to self-hosted email, it became clear to me that sent emails are no longer automatically appearing in the Sent folder. So I now had add code to connect to the IMAP server and append the message to the Sent folder. It'd be useful if pytest-localserver would also provide support for IMAP.

@diazona
Copy link
Contributor

diazona commented Nov 20, 2022

Hi @kvdb, thanks for your message!

In principle I'd be totally happy to add IMAP support (and I'm sure @redtoad would agree). We would need a Python implementation of an IMAP server; after a quick search I found https://github.com/scanner/asimap (but I can't tell if that's installable through pip) and https://pypi.org/project/localmail/ (but that may not be maintained anymore, and is also GPLv3 which would be incompatible with this project's own license). If you (or anyone) can suggest a better option for an IMAP server, that would be great.

Also, if you haven't seen it, I'd suggest reviewing the discussion about whether pytest-localserver should be retired. The unfortunate truth is that this package's support for SMTP is pretty shaky, since both Python's own smtpd module and the aiosmtpd package which was supposed to replace it are basically unmaintained and may not have much life left in them; and without SMTP, pytest-localserver is little more than a simpler version of pytest-httpserver. In general, things seem to be moving in the direction of having separate packages for testing different protocols, rather than pytest-localserver's approach which is one package that handles multiple server protocols; the separate protocol-specific packages are much more actively developed. So we'd have to take that into account when deciding whether to add IMAP support here. If we don't, it could always be a separate package.

@diazona diazona added the enhancement New feature or request label Feb 3, 2023
@diazona
Copy link
Contributor

diazona commented Mar 15, 2024

Just wanted to reaffirm that the blocker to this is finding a suitable IMAP server library which is stable, maintained, and installable from PyPI. If we find a library meeting those criteria, I'm happy to implement this, but honestly, unless somebody can suggest one it's unlikely that this improvement is going to happen. I'll leave the issue open just in case, but if it doesn't get any further activity, that's why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants