Marinus Klasen

Marinus Klasen

  • Development
  • Consultancy
  • Developer Resources
  • Blog
  • Contact

May 8, 2023

Setup Mailcrab in Docker & PHP

Marinus Klasen

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

About Marinus Klasen

Marinus has been working in software/web development for more than a decade. Since 2020 his attention shifted on sharing knowledge and developing products and tools for sharing knowledge.

Marinus Klasen on Twitter

Looking for a WordPress expert?
Hire top notch developers on Codeable!

Consult an expert

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get in touch

Contact me using the details below

Marinus Klasen

Wilhelmina van Pruisenweg 35, 2595 AN Den Haag

marinus@mklasen.com
twitter.com/marinusklasen
linkedin.com/in/marinusklasen

  • GitHub
  • LinkedIn
  • Twitter

Have you read?

  • Elementor Widget UsageMarch 27, 2025
  • Programmatically showing popups with ElementorMarch 25, 2025
  • The Elementor sanitize_settings errorSeptember 12, 2024
  • Announcing.. Wooping Shop Health!June 13, 2024
  • Swiper setup when using wp-scriptsMarch 14, 2024

Copyright © 2025 ยท Marinus Klasen | Webdesign by Team Rood