Skip to content

MSMTP_FROM variable not passed #105

@agelospanagiotakis

Description

@agelospanagiotakis

MSMTP_FROM is not set by default

  php:
    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_php"
    environment:
      # By default xdebug extension also disabled.
      PHP_FPM_CLEAR_ENV: "no"
      PHP_EXTENSIONS_DISABLE: xhprof,spx
      PHP_MAIL_MIXED_LF_AND_CRLF: 'On'
      MSMTP_HOST: mailhog
      MSMTP_PORT: 1025
      # PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      # MSMTP_HOST: opensmtpd
      # MSMTP_PORT: 25
      MSMTP_FROM: noreply@${PROJECT_BASE_URL}
      DB_HOST: $DB_HOST
      DB_PORT: $DB_PORT
      DB_USER: $DB_USER
      DB_PASSWORD: $DB_PASSWORD
      DB_NAME: $DB_NAME
      DB_DRIVER: $DB_DRIVER
      # DRUSH_OPTIONS_URI: ${PROJECT_BASE_URL}
      DRUSH_OPTIONS_URI: "http://${PROJECT_BASE_URL}"
      # DRUSH_OPTIONS_URI: "http://${PROJECT_BASE_URL}:${PROJECT_PORT}
      COLUMNS: 80 # Set 80 columns for docker exec -it.
      DOCROOT_SUBDIR: docroot/web
      WODBY_APP_SUBSITE: default
      HTTP_ROOT: /var/www/html/docroot/web
      APP_ROOT: /var/www/html
      CONF_DIR: /var/www/conf
      DRUPAL_VERSION: "11"
      DRUPAL_SITE: "default"
      DRUPAL_SITE_DIR: "/var/www/html/docroot/web/sites/default"
      DRUPAL_HASH_SALT: "aaaa-bad-hash-salt-must-be-32-characters_long"
      DRUPAL_FILES_SYNC_SALT: "aaaa-files-sync-bad-salt"
      PHP_FPM_USER: "wodby"
      PHP_FPM_GROUP: "wodby"
      WODBY_HOSTS: '["${PROJECT_BASE_URL}"]'
      WODBY_PRIMARY_HOST: "$PROJECT_BASE_URL"
      REDIS_HOST: "redis"
      REDIS_PORT: "6379"
      REDIS_PASSWORD: "redis"
    networks:
      - default
      - traefik

MSMTP_FROM is set but from withing the container
wodby@php.container:/var/www/html $ echo -e "Subject: Hello\n\nTest email" | msmtp test@example.com

msmtp: account default from /etc/msmtprc: envelope-from address is missing

cat /etc/msmtprc

defaults
port 1025
tls off

account default
auth off
host mailhog
add_missing_date_header on

if you do

 echo "from noreply@example.test" >> /etc/msmtprc

$ php test_email.php
Email sent!
$ echo -e "Subject: Hello\n\nTest email" | msmtp test@example.com
Email sent!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions