Skip to content

Set up Mailpit for email testing and development using Docker Compose.

License

Notifications You must be signed in to change notification settings

A-H-Pooladvand/mailpit-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mailpit using docker-compose

This project sets up a Mailpit container (mailpit) for handling email testing and development.

Prerequisites

Environment Variables

This docker-compose.yml file utilizes environment variables to customize configurations. You can set these variables before running commands:

  • MP_MAX_MESSAGES: Maximum number of messages to retain (defaults to 5000)
  • MP_DATABASE: Path to the Mailpit database (defaults to /data/mailpit.db)
  • MP_SMTP_AUTH_ACCEPT_ANY: Accept any SMTP authentication (defaults to 1)
  • MP_SMTP_AUTH_ALLOW_INSECURE: Allow insecure SMTP authentication (defaults to 1)
  • WEB_PORT: Port to expose the Mailpit web interface (defaults to 8025)
  • SMTP_PORT: Port to expose the Mailpit SMTP interface (defaults to 1025)

Recommendation: Customize these environment variables in the docker-compose.yml file or use a .env file to set them as per your requirements.

Usage

  1. Create a .env file (optional):

    • Create a file named .env in the same directory as your docker-compose.yml file.

    • Add environment variable definitions in the format KEY=VALUE, one per line. For example:

      MP_MAX_MESSAGES=5000
      MP_DATABASE=/data/mailpit.db
      MP_SMTP_AUTH_ACCEPT_ANY=1
      MP_SMTP_AUTH_ALLOW_INSECURE=1
      
  2. Start the services:

    docker-compose up -d
    • This will create and start the Mailpit container in detached mode (background).
  3. Access Mailpit:

    • Open your web browser and navigate to http://localhost:<WEB_PORT>, replacing <WEB_PORT> with the port you configured (default: 8025).

About

Set up Mailpit for email testing and development using Docker Compose.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published