Okay – it took me a while to get this configured correctly so I thought I’d share the setup with all of you. In the end, my issue was not setting -t -i
in my sendmail path.
Mailcrab Docker Compose setup
mailcrab:
container_name: mailcrab
image: marlonb/mailcrab:latest
ports:
- '1080:1080'
- '1025:1025'
Now, I run this in combination with a few PHP/WordPress containers, make sure that you set the PHP sendmail path correctly in your php.ini file, like below:
sendmail_path = /usr/sbin/sendmail -t -i -S mailcrab:1025
And you should be all set!
Sample docker-compose file for PHP container
php:
container_name: ${SITENAME:-wordpress}-php
build:
context: .
dockerfile: docker/php/Dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
volumes:
- ./data:/var/www/html
- ./logs/php.log:/var/log/fpm-php.www.log
- ./docker/php/default.conf:/usr/local/etc/php/conf.d/local.ini
Leave a Reply