-
Notifications
You must be signed in to change notification settings - Fork 2
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
switch to mailpit which supports testing CC and is maintained #31
Comments
Support for the unmaintained status: mailhog/MailHog#442 (comment) where the maintainer of mailhog also mentions mailpit as an alternative. |
If it helps, this is how we used MailPit since last year in Lando for each site: In .lando.yml under services add:
Under proxy add (if you'd like localhost domains, then you can also replace .lndo.site with .localhost):
Then In your site set "mailpit" as SMTP server name, "1025" as SMTP server port. You can view sent mails on http://mail.YOURSITENAME.lndo.site URL. |
Thank you @kaszarobert for the snippet, I was banging my head with this for a couple of hours already. I would still love to see an official recipe for mailpit! |
You also need SMTP setup to start using Mailpit. Drupal Core has a Symfony Mailer component available since version Here's how you can use it with Mailpit:
services:
appserver:
overrides:
environment:
SMTP_ADDRESS: mailpit:1025 I use the
// Symfony Mailer configuration.
// @see: https://www.drupal.org/node/3369935
$config['system.mail']['interface'] = [ 'default' => 'symfony_mailer' ];
// Default SMTP settings.
$smtp_address_parts = explode(':', getenv('SMTP_ADDRESS'));
if (!empty($smtp_address_parts[0]) && !empty($smtp_address_parts[1])) {
$config['system.mail']['mailer_dsn'] = [
'scheme' => 'smtp',
'host' => $smtp_address_parts[0],
'port' => $smtp_address_parts[1],
];
} Here's the full setup as a PR: https://github.com/wunderio/drupal-project/pull/423/files |
Nice thanks @tormi. BTW a little birdie told me that @AaronFeledy might be cooking up a legit mailpit Lando plugin so we can finally mothball this repo. I'm sure he'll post here when there's substantive progress, but wanted to HYPE the possibility :) |
Try out the beta of the Mailpit plugin: https://github.com/lando/mailpit |
Thanks @AaronFeledy - I've installed this and given it a test. Works a treat and I like that it has dark mode. I never used 'Jim the chaos monkey' in Mailhog so that isn't something I'll miss, but might be something to flag up somewhere. Re: the OP - I haven't figured out how to test a CC message yet as my app of choice doesn't normally do this. |
I don't think the fact that Mailpit doesn't have the chaos monkey is something for Lando to flag, they're just services for you to add after all. Similar to how Lando doesn't tell you the differences between the different database services. |
Good point @hailwood - though I think this is slightly different in that the plan seems to be deprecating and then removing Mailhog; I think this is the right move. |
Background:
I was trying to debug an email that was supose to have a CC aswell. Turns out mailhog wont let you view the cc:ed email.
Long story short, use mailpit instead. :/
Docker images
You can view available Docker images on https://hub.docker.com/r/axllent/mailpit.
A basic example of running Mailpit within Docker:
You need to ensure you map the correct ports (default Web UI on 8025 and SMTP on 1025).
Setting Mailpit options
View all runtime options (flags & environment variables). Environment variables can be set using the
-e
flag when starting your docker container, for instance:Docker compose example
The text was updated successfully, but these errors were encountered: