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

switch to mailpit which supports testing CC and is maintained #31

Open
chrillep opened this issue Feb 6, 2024 · 3 comments
Open

switch to mailpit which supports testing CC and is maintained #31

chrillep opened this issue Feb 6, 2024 · 3 comments

Comments

@chrillep
Copy link

chrillep commented Feb 6, 2024

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:

docker run -d \
--restart unless-stopped \
--name=mailpit \
-p 8025:8025 \
-p 1025:1025 \
axllent/mailpit

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 run -d \
--name=mailpit \
--restart unless-stopped \
-v /path/to/mailpit-data:/data \
-e MP_DATA_FILE=/data/mailpit.db \
-e MP_UI_AUTH_FILE=/data/authfile \
-e TZ=Europe/London \
-p 8025:8025 \
-p 1025:1025 \
axllent/mailpit

Docker compose example

version: '2.4'

services:
  mailpit:
    image: axllent/mailpit
    container_name: mailpit
    restart: always
    volumes:
      - ./data:/data
    ports:
      - 8025:8025
      - 1025:1025
    environment:
      MP_MAX_MESSAGES: 5000
      MP_DATA_FILE: /data/mailpit.db
      MP_SMTP_AUTH_ACCEPT_ANY: 1
      MP_SMTP_AUTH_ALLOW_INSECURE: 1
@chrillep chrillep changed the title witch to mailpit whoch supports cc and is maintained switch to mailpit whoch supports cc and is maintained Feb 6, 2024
@chrillep chrillep changed the title switch to mailpit whoch supports cc and is maintained switch to mailpit which supports cc and is maintained Feb 6, 2024
@chrillep chrillep changed the title switch to mailpit which supports cc and is maintained switch to mailpit which supports testing CC and is maintained Feb 6, 2024
@AaronFeledy
Copy link

AaronFeledy commented Feb 7, 2024

Support for the unmaintained status: mailhog/MailHog#442 (comment) where the maintainer of mailhog also mentions mailpit as an alternative.

@kaszarobert
Copy link

If it helps, this is how we used MailPit since last year in Lando for each site:

In .lando.yml under services add:

  mailpit:
    scanner: false
    api: 3
    type: lando
    services:
      image: axllent/mailpit
      volumes:
        - mailpit:/data
      ports:
        - 8025 # Web UI.
        - 1025 # SMTP.
      environment:
        MP_MAX_MESSAGES: 5000
        MP_DATA_FILE: /data/mailpit.db
        MP_SMTP_AUTH_ACCEPT_ANY: 1
        MP_SMTP_AUTH_ALLOW_INSECURE: 1
      command: '/mailpit'
    volumes:
      mailpit:

Under proxy add (if you'd like localhost domains, then you can also replace .lndo.site with .localhost):

  mailpit:
    - mail.YOURSITENAME.lndo.site:8025

Then lando rebuild -y

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.

@Epitaffio
Copy link

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!

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

No branches or pull requests

4 participants