diff --git a/src/Handler.php b/src/Handler.php
index 9040e4dfb8cbffb31b0116b621295c9e5e33719e..4a67f67507cdb3b0ee10756a483e39bbf7c0fde8 100644
--- a/src/Handler.php
+++ b/src/Handler.php
@@ -101,6 +101,7 @@ class Handler extends BaseHandler {
         'overwriteconfig' => FALSE,
       ],
       'mailhog' => [
+        'enable' => 1,
         'host' => $this->env->receiveGlobal('MAILHOG_HOST', 'MailHog Host', 'smtp.freesmtpservers.com'),
         'port' => $this->env->receiveGlobal('MAILHOG_PORT', 'MailHog Port', '25'),
         'username' => $this->env->receiveGlobal('MAILHOG_USERNAME', 'MailHog Username'),
diff --git a/templates/docker-compose.yml.twig b/templates/docker-compose.yml.twig
index 9047577cd9473eff80a6fe8327b663f80610f787..a657e19a1971198082edd6699ee084dce317cce8 100644
--- a/templates/docker-compose.yml.twig
+++ b/templates/docker-compose.yml.twig
@@ -47,7 +47,9 @@ services:
     restart: unless-stopped
 {% endif %}
     environment:
+{% if mailhog.enable %}
       PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
+{% endif %}
       DB_HOST: mariadb
       DB_USER: drupal
       DB_PASSWORD: drupal
@@ -105,7 +107,9 @@ services:
     image: 'wodby/drupal-php:{{ php.version }}'
     restart: unless-stopped
     environment:
+{% if mailhog.enable %}
       PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
+{% endif %}
       DB_HOST: mariadb
       DB_USER: drupal
       DB_PASSWORD: drupal
@@ -260,7 +264,7 @@ services:
       traefik.http.routers.solr-{{ projectname }}.rule: Host(`solr-{{ projectdomain }}`)
 {% endif %}
 
-{% if not drupal.live|default(0) or staging %}
+{% if mailhog.enable and (not drupal.live|default(0) or staging) %}
   mailhog:
     image: 'mailhog/mailhog'
 {% if staging %}