services:
mailpit:
image: axllent/mailpit
container_name: mailpit
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web
environment:
- MP_SMTP_TLS_CERT=/etc/mailpit/ServerCA.crt
- MP_SMTP_TLS_KEY=/etc/mailpit/ServerCA.key
- MP_SMTP_AUTH_ACCEPT_ANY=true
- MP_SMTP_REQUIRE_STARTTLS=true # STARTTLS
- MP_SMTP_REQUIRE_TLS=false # SSL/TLS
- MP_UI_LANG=zh_TW
- MP_UI_AUTO_REFRESH=10
volumes:
- ./certs:/etc/mailpit
restart: unless-stopped
https://raw.githubusercontent.com/tryweb/docker-compose/refs/heads/main/mailpit/docker-compose.yml
openssl s_client -connect localhost:1025 -starttls smtpopenssl s_client -connect localhost:1025$ openssl s_client -connect localhost:1025 -starttls smtp CONNECTED(00000003) Can't use SSL_get_servername depth=0 C = TW, ST = Taiwan, L = Taipei, O = III, OU = DevOps, CN = MailHog, emailAddress = [email protected] verify error:num=20:unable to get local issuer certificate verify return:1 depth=0 C = TW, ST = Taiwan, L = Taipei, O = III, OU = DevOps, CN = MailHog, emailAddress = [email protected] verify error:num=21:unable to verify the first certificate verify return:1 depth=0 C = TW, ST = Taiwan, L = Taipei, O = III, OU = DevOps, CN = MailHog, emailAddress = [email protected] verify return:1 --- Certificate chain 0 s:C = TW, ST = Taiwan, L = Taipei, O = III, OU = DevOps, CN = MailHog, emailAddress = [email protected] i:C = TW, ST = Taiwan, L = Taipei, O = III, OU = DevOps, CN = Jonathan Tsai, emailAddress = [email protected] a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA1 v:NotBefore: Apr 12 02:31:31 2025 GMT; NotAfter: Apr 12 02:31:31 2027 GMT --- Server certificate -----BEGIN CERTIFICATE----- MIIDmjCCAoICFBr9dfIlHO4wEY7hxz/BJNhTuageMA0GCSqGSIb3DQEBBQUAMIGK MQswCQYDVQQGEwJUVzEPMA0GA1UECAwGVGFpd2FuMQ8wDQYDVQQHDAZUYWlwZWkx :