Mailpit is a multi-platform email testing tool & API for developers.
It acts as both an SMTP server, and provides a web interface to view all captured emails.
mailpit.axllent.org
A basic example of running Mailpit within AppJail:
$ appjail oci run -Pd \
-o overwrite=force \
-o virtualnet=":<random> default" \
-o nat \
-o expose=8025:8025 \
-o expose=1025:1025 \
ghcr.io/appjail-makejails/mailpit mailpitYou need to ensure you map the correct ports (default Web UI on 8025 and SMTP on 1025).
View all runtime options (flags & environment variables). Environment variables can be set using the -e flag when starting your container, for instance:
$ mkdir -p /var/appjail-volumes/mailpit/data
$ appjail oci run -Pd \
-o overwrite=force \
-o virtualnet=":<random> default" \
-o nat \
-o fstab="/var/appjail-volumes/mailpit/data /data" \
-e MP_DATABASE="/data/mailpit.db" \
-e MP_UI_AUTH_FILE="/data/authfile" \
-e TZ=America/Caracas \
ghcr.io/appjail-makejails/mailpit mailpitThe following example exposes both the web UI port (8025) and SMTP port (1025) to external hosts. If your appjail-director.yml is running multi-container applications and does not require (for instance) 1025 to be open to the host, then you can omit - expose: '1025:1025' which will then only expose it to the other containers.
options:
- virtualnet: ':<random> default'
- nat:
services:
mailpit:
name: mailpit
makejail: gh+AppJail-makejails/mailpit
volumes:
- data: /data
options:
- expose: '8025:8025'
- expose: '1025:1025'
- container: 'args:--pull'
oci:
environment:
- MP_MAX_MESSAGES: 5000
- MP_DATABASE: /data/mailpit.db
- MP_SMTP_AUTH_ACCEPT_ANY: 1
- MP_SMTP_AUTH_ALLOW_INSECURE: 1
volumes:
data:
device: /var/appjail-volumes/mailpit/datamailpit_from(default:ghcr.io/appjail-makejails/mailpit): Location of OCI image. See also OCI Configuration.mailpit_tag(default:latest): OCI image tag. See also OCI Configuration.
PGID(default:1000): Equivalent toPUIDbut for the Process Group ID.PUID(default:1000): Process User ID for the container's main process, allowing you to match the owner of files written to mounted host volumes to your host system's user. Writable volumes are changed based on this environment variable.UMASK(default:0022): Override default umask setting.
| Name | Owner | Group | Perm | Type | Mountpoint |
|---|---|---|---|---|---|
| appjail-263aca83a3-data | ${PUID} |
${PGID} |
- | - | /data |
build:
variants:
- tag: 15.1
containerfile: Containerfile
aliases: ["latest"]
default: true
args:
FREEBSD_RELEASE: "15.1"
NO_PKGCLEAN: "1"
cache_dirs: ["pkgcache0:/var/cache/pkg"]