[GH-ISSUE #72] IMAP/POP3 support? #48

Closed
opened 2026-03-15 12:17:02 +03:00 by kerem · 3 comments
Owner

Originally created by @flbraun on GitHub (Mar 23, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/72

Hi there,
I'm currently looking for an alternative for greenmail, mostly because they don't have a web interface for reading captured mails. Judging by their issue tracker there were requests and attempts to add one in the past, but without any result.
Now, mailpit has a nice web interface, but apparently doesn't offer IMAP/POP3. 😄

Rationale for why this could be useful: I have a couple of projects with fairly sophisticated end-to-end tests, all running in an encapsulated dockerized environment. Some of those tests have workflows like "Register a new user through the web ui, poll the user's inbox via IMAP until the account confirmation mail has arrived, then open the confirmation link."

Any chance you would be interested in implementing this?

Originally created by @flbraun on GitHub (Mar 23, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/72 Hi there, I'm currently looking for an alternative for greenmail, mostly because they don't have a web interface for reading captured mails. Judging by their issue tracker there were requests and attempts to add one in the past, but without any result. Now, mailpit has a nice web interface, but apparently doesn't offer IMAP/POP3. :smile: Rationale for why this could be useful: I have a couple of projects with fairly sophisticated end-to-end tests, all running in an encapsulated dockerized environment. Some of those tests have workflows like "Register a new user through the web ui, poll the user's inbox via IMAP until the account confirmation mail has arrived, then open the confirmation link." Any chance you would be interested in implementing this?
kerem closed this issue 2026-03-15 12:17:08 +03:00
Author
Owner

@axllent commented on GitHub (Mar 24, 2023):

Hi @flbraun. I cannot tell exactly how your environment is set up, however this is exactly what the API is for, and I believe that this is the direction you should be taking when dealing with any integration testing (unless that integration is specifically testing either POP3 or IMAP).

With regards to support for those, IMAP really isn't an option as that would require a complicated abstraction layer to handle virtual folders (Mailpit has no folder structure) and all the other IMAP functionality relating to authentication/security/TLS etc. POP3, although somewhat simpler, would also add a layer of additional complexity (again, authentication/security/TLS etc) - which I'm not really keen on either as that's something else that must adhere to RFC standards etc.

Regarding the API integration in your workflows (I'm using the hostname mailpit but use whatever is appropriate):

  1. Register a new user through the web ui
  2. GET http://mailpit:8025/api/v1/messages
  3. Extract the message ID of the first (latest) JSON result
  4. Now, depending whether you intend on parsing the raw message or getting a "summary" (which includes the text & html parts), either GET http://mailpit:8025/api/v1/message/<ID>/raw or http://mailpit:8025/api/v1/message/<ID>
  5. Do stuff based on content...

Does this help?

<!-- gh-comment-id:1482172999 --> @axllent commented on GitHub (Mar 24, 2023): Hi @flbraun. I cannot tell exactly how your environment is set up, however this is exactly what the [API](https://github.com/axllent/mailpit/blob/develop/docs/apiv1/README.md) is for, and I believe that this is the direction you should be taking when dealing with any integration testing (unless that integration is specifically testing either POP3 or IMAP). With regards to support for those, IMAP really isn't an option as that would require a complicated abstraction layer to handle virtual folders (Mailpit has no folder structure) and all the other IMAP functionality relating to authentication/security/TLS etc. POP3, although somewhat simpler, would also add a layer of additional complexity (again, authentication/security/TLS etc) - which I'm not really keen on either as that's something else that must adhere to RFC standards etc. Regarding the API integration in your workflows (I'm using the hostname `mailpit` but use whatever is appropriate): 1. Register a new user through the web ui 2. GET `http://mailpit:8025/api/v1/messages` 3. Extract the message `ID` of the first (latest) JSON result 4. Now, depending whether you intend on parsing the raw message or getting a "summary" (which includes the text & html parts), either GET `http://mailpit:8025/api/v1/message/<ID>/raw` or `http://mailpit:8025/api/v1/message/<ID>` 5. Do stuff based on content... Does this help?
Author
Owner

@flbraun commented on GitHub (Mar 24, 2023):

Thanks for your quick response!

I'm aware of the API and agree that it would solve my described problem. However - without going in too much detail - there are other things in the project's ecosystem besides the end-to-end tests that rely on an IMAP/POP3 interface, so it's kind of a must for me.

Anyway, thanks for taking time.

<!-- gh-comment-id:1482486506 --> @flbraun commented on GitHub (Mar 24, 2023): Thanks for your quick response! I'm aware of the API and agree that it would solve my described problem. However - without going in too much detail - there are other things in the project's ecosystem besides the end-to-end tests that rely on an IMAP/POP3 interface, so it's kind of a must for me. Anyway, thanks for taking time.
Author
Owner

@axllent commented on GitHub (Feb 24, 2024):

I know you requested this 11 months ago and at the time it was not a planned feature, but I have just added the the option for a POP3 server in v1.14.0 and the documentation can be found on the website.

<!-- gh-comment-id:1962324620 --> @axllent commented on GitHub (Feb 24, 2024): I know you requested this 11 months ago and at the time it was not a planned feature, but I have just added the the option for a POP3 server in [v1.14.0](https://github.com/axllent/mailpit/releases/tag/v1.14.0) and the documentation can be found on [the website](https://mailpit.axllent.org/docs/configuration/pop3/).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#48
No description provided.