-
-
Notifications
You must be signed in to change notification settings - Fork 580
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
Move from MailHog to Mailpit or a better-maintained mail capture tool #4827
Comments
One thing that has been suggested over the years is to run mailhog in a different container. One thing you could do here is create an add-on that uses mailpit (overriding the /etc/supervisor config), and we could get some miles on this. |
The mailpit add-on sounds good, I'll give it a try. |
I created one last week: https://github.com/tyler36/ddev-mailpit |
Mailpit does not have feature-parity with Mailhog at the moment. |
@tyler36, thank you! At first, I didn't find the add-on because I missed this issue I tested the add-on with |
I don't think this issue should be closed as you are correct, MailHog should be phased out in place of MailPit, is there any internal intention on migrating this into core ddev like MailHog? |
The conversation has only just started :) But as @tyler36 says, "Mailpit does not have feature-parity with Mailhog at the moment." |
I think a move to Mailpit would be preferable because it's being actively developed. "release mail" is a feature that Mailhog has, but Mailpit does not. it is something that I have ever used, but came up on Slack the other day. There's an feature request issue on Mailpit #29. It would be nice if we had a config option to select Mailhog or Mailpit, similar to database type. Having both as addons is OK, but I think we need this service baked into DDEV out of the box. |
Probably the best thing to do is incubate as an add-on, then when we have experience with it, it can be brought into the main DDEV tool. |
What are other popular mail capture tools?
|
There is a list of mail transfer agents, but looking at it, we don't really have a good alternative solution for development. So the most useful at the moment are MailHog and Mailpit. |
Other alternatives to MailHog are:
I only tested MailPit, Maildev an Inbucket via docker-composer.*.yaml in one of my local projects. I was not able to launch Inbucket quickly, so I skipped that. MailPit and Maildev were fast up and running. They both seem to be a good MailHog equivalent, whereas MailPit is written in Go (as MailHog is/ was) and Maildev is a NPM/ NodeJS application. So, if MailHog should be replaced, then I recommened MailPit as well, which FYI Ian Kent (maintainer of MailHog) does as well: |
SMTP Relay has been implemented already - see: https://github.com/axllent/mailpit/wiki/SMTP-relay |
Something else that is preventing Mailpit from being the new default? |
@Morgy93 |
We recently noticed that its REST API is different. Not sure if this is a deal-breaker though. |
Well, nobody has proposed a migration technique or done a PR to implement it. I'm glad that people like it, and are using https://github.com/tyler36/ddev-mailpit I think maybe the first step toward mailpit would be to promote it to the ddev org. What do you think @tyler36 ? |
It is easy to replace MailHog with Mailpit. The only change needed here: ddev/containers/ddev-webserver/Dockerfile Line 100 in e0b1772
Can be tested locally: echo 'ARG TARGETPLATFORM="linux/amd64"
ENV MAILPIT_VERSION="1.8.2"
RUN set -x \
&& curl --fail -sSL "https://github.com/axllent/mailpit/releases/download/v${MAILPIT_VERSION}/mailpit-linux-${TARGETPLATFORM##linux/}.tar.gz" -o /tmp/mailpit.tar.gz \
&& mkdir -p /tmp/mailpit-unpacked \
&& tar -xzvf /tmp/mailpit.tar.gz -C /tmp/mailpit-unpacked \
&& mv /tmp/mailpit-unpacked/mailpit /usr/local/bin/mailhog \
&& chmod +x /usr/local/bin/mailhog \
&& rm -rf /tmp/mailpit*' > .ddev/web-build/Dockerfile |
Well, there's docs changes as well, and changes to the |
Yes, I just provided what I talked about in the first post of this issue. Also, I really like the idea of an add-on because it has so many customization options. |
Do you think it should remain in core DDEV or are you saying it should become just and add-on? Of course mailhog already has the same customization options. |
I mean, it's easier to see what can be changed by looking at the add-on config. On the other hand, I won't even change the default config since I use it as a simple email viewer. My opinion: it should remain in the core DDEV. |
Thanks. What's your opinion about whether it should remain in ddev-webserver? That's certainly the simplest path forward as far as code. |
I'm fine with ddev-webserver. In fact, when I started using DDEV, I was surprised to see MailHog included because I had previously used it as another Docker service. I didn't even think it could be done like this. |
Personally, I lean towards running in it's own container. It's much easier to debug and disable services when they are isolated. With addons, if it's in the web container and theres a problem, it can prevent the web-container from starting. I'm happy to go with the crowd though. |
I don't think this has happened with mailhog in the entire history of DDEV though... |
Three people, three different opinions. 😅 I like the idea of removing Mailhog from the core and using add-ons instead. It's much more flexible and one could provide an add-on for every other "option" out there. Just as reminder:
Currently, no real "drop-in replacement" is possible, because of the bundled Mailhog. (Global command, ports etc.) And if Mailpit is abandoned we don't have to care about the bundled package anymore. 😁 |
@Morgy93 Yes, that what I was thinking. |
I think having working e-mail handling out of the box with DDEV is a very valuable feature and making it an optional addon would require everyone to always get that addon in a project before that works? It being on a separate container also requires to configure your application to send mails via smtp to that host, whereas it just works right now for example with Drupal. |
You're right! I've been using DDEV for so long I've gotten use to the idea that tests email are capture and I don't end up spaming "admin@example.com" with alerts and logs. |
Yes, the reason DDEV had mailhog from the beginning was to try to prevent escaping emails! |
I think that is an important feature. I know of two situations where this is life saving.
|
Working on this! |
Sending mails to localhost:1025 in the web container works as expected and shows them in Mailpit. |
@EvilBMP, everything is good on my end.
Maybe your browser removes the port before opening the link? |
@EvilBMP you do have to |
This is now in HEAD |
Is there an existing issue for this?
Is your feature request related to a problem?
MailHog is not actively maintained, and there is an alternative solution.
Describe your solution
Mailpit https://github.com/axllent/mailpit is a new default for laravel/sail and laravel/laravel skeleton from v10.x.
It looks like a drop-in replacement, the ports are the same. DDEV can easily migrate to it as well.
Why replace MailHog? - See README.md, there are several good reasons.
Describe alternatives
Continue to use MailHog.
Additional context
There are many places in DDEV where the word "mailhog" is used - it can be tedious to replace them all.
I suggest just updating this line in the ddev-webserver's Dockerfile.
For start, just keep using
mailhog
name for binary, but usemailpit
repo (create a new fork under DDEV org) under the hood.The text was updated successfully, but these errors were encountered: