Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The mail settings aren't being really used #577

Closed
superromeo opened this issue Jan 27, 2025 · 4 comments
Closed

The mail settings aren't being really used #577

superromeo opened this issue Jan 27, 2025 · 4 comments

Comments

@superromeo
Copy link

superromeo commented Jan 27, 2025

OS type
Linux

Drupal version
11

Codebase
Built-in vanilla Drupal or mounted codebase

Describe the bug
Hi!

I set:

services:
  php:
    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_php"
    environment:
    ...
      # Mailpit:
      MSMTP_HOST: mailpit
      MSMTP_PORT: 1025

but in config file I have wrong values:

[email protected]:/var/www/html $ cat /etc/ssmtp/ssmtp.conf
mailhub=opensmtpd:25
FromLineOverride=Yes

Output of docker info

Client:
 Version:    27.4.0
 Context:    default
 Debug Mode: false
 Plugins:
  ai: Ask Gordon - Docker Agent (Docker Inc.)
    Version:  v0.5.1
    Path:     /usr/local/lib/docker/cli-plugins/docker-ai
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.2-desktop.1
    Path:     /usr/local/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.31.0-desktop.2
    Path:     /usr/local/lib/docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.37
    Path:     /usr/local/lib/docker/cli-plugins/docker-debug
  desktop: Docker Desktop commands (Beta) (Docker Inc.)
    Version:  v0.1.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-desktop
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /usr/local/lib/docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.27
    Path:     /usr/local/lib/docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /usr/local/lib/docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.4.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.15.1
    Path:     /usr/local/lib/docker/cli-plugins/docker-scout
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-scan: no such file or directory

Server:
 Containers: 33
  Running: 17
  Paused: 0
  Stopped: 16
 Images: 142
 Server Version: 27.4.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2 nvidia
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 472731909fa34bd7bc9c087e4c27943f9835f111
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.153.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 12.67GiB
 Name: docker-desktop
 ID: 2baa730c-3f75-49fe-8540-78feb36f1917
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=unix:///var/run/docker-cli.sock
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

Contents of your compose.yml

services:
  mariadb:
    image: wodby/mariadb:$MARIADB_TAG
    container_name: "${PROJECT_NAME}_mariadb"
    stop_grace_period: 30s
    environment:
      MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
      MYSQL_DATABASE: $DB_NAME
      MYSQL_USER: $DB_USER
      MYSQL_PASSWORD: $DB_PASSWORD
      MYSQL_TRANSACTION_ISOLATION: READ-COMMITTED

  php:
    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_php"
    environment:
      PHP_EXTENSIONS_DISABLE: xhprof,spx
      PHP_MAIL_MIXED_LF_AND_CRLF: 'On'
      MSMTP_HOST: mailpit
      MSMTP_PORT: 1025
      PHP_XDEBUG_MODE: debug
      PHP_XDEBUG_USE_COMPRESSION: false
      PHP_IDE_CONFIG: serverName=${SERVER_NAME}
      PHP_XDEBUG_IDEKEY: PhpStorm
      PHP_XDEBUG_START_WITH_REQUEST: "trigger"
      PHP_XDEBUG_CLIENT_HOST: host.docker.internal
      PHP_XDEBUG_LOG: /tmp/php-xdebug.log
      PHP_MEMORY_LIMIT: 1G
      PHP_MAX_EXECUTION_TIME: 600
      PHP_MAX_INPUT_VARS: 50000
      PHP_OPCACHE_MEMORY_CONSUMPTION: 512
      PHP_OPCACHE_INTERNED_STRINGS_BUFFER: 32
      PHP_OPCACHE_MAX_ACCELERATED_FILES: 100000
      PHP_OPCACHE_REVALIDATE_FREQ: 2
      PHP_OPCACHE_ENABLE_CLI: 1
      PHP_FPM_USER: wodby
      PHP_FPM_GROUP: wodby
    extra_hosts:
    - "host.docker.internal:host-gateway"
    volumes:
      - ../:/var/www/html:cached
      - ${LIVE_SSH_KEY}:/home/wodby/.ssh/id_rsa.orig
      - ../../_profiler:/mnt/files

  crond:
    init: true
    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_crond"
    environment:
      CRONTAB: "0 * * * * drush -r /var/www/html/web cron"
    command: sudo -E crond -f -d 0
    volumes:
      - ../:/var/www/html:cached

  nginx:
    image: wodby/nginx:$NGINX_TAG
    container_name: "${PROJECT_NAME}_nginx"
    depends_on:
    - php
    environment:
      NGINX_STATIC_OPEN_FILE_CACHE: "off"
      NGINX_ERROR_LOG_LEVEL: debug
      NGINX_BACKEND_HOST: php
      NGINX_SERVER_ROOT: /var/www/html/web
      NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET
    volumes:
      - ../:/var/www/html:cached
    labels:
    - "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(`${PROJECT_BASE_URL}`)"

  mailpit:
    image: axllent/mailpit
    container_name: "${PROJECT_NAME}_mailpit"
    labels:
    - "traefik.http.services.${PROJECT_NAME}_mailpit.loadbalancer.server.port=8025"
    - "traefik.http.routers.${PROJECT_NAME}_mailpit.rule=Host(`mailpit.${PROJECT_BASE_URL}`)"

  valkey:
    container_name: "${PROJECT_NAME}_valkey"
    image: wodby/valkey:$VALKEY_TAG

volumes:
  files:

Contents of your .env

PROJECT_NAME=solar
PROJECT_BASE_URL=solar.localhost
PROJECT_PORT=80

DB_NAME=solar
DB_USER=solar_user
DB_PASSWORD=password
DB_ROOT_PASSWORD=password
DB_HOST=mariadb
DB_PORT=3306
DB_DRIVER=mysql

COMPOSE_PROJECT_NAME=solar
PROJECT_DIR=solar
SERVER_NAME=solar.localhost
LIVE_SSH_KEY="/mnt/c/Users/roman/Мой диск/Сайт/_ssh/linux/id_rsa"
RG_MYSQL_TAG=8.0.26

MARIADB_TAG=11.4-3.30.2

DRUPAL_TAG=11-4.80.5

PHP_TAG=8.3-dev-4.65.5

NGINX_TAG=1.27-5.39.13
NGINX_VHOST_PRESET=drupal11

SOLR_TAG=8-4.18.2
SOLR_CONFIG_SET="search_api_solr_4.1.6"

ELASTICSEARCH_TAG=7-5.19.13

KIBANA_TAG=7-5.19.13

VALKEY_TAG=8-0.4.2

NODE_TAG=22-dev-1.46.2

VARNISH_TAG=6.0-4.18.4

POSTGRES_TAG=17-1.35.2

ADMINER_TAG=4-3.29.5
APACHE_TAG=2.4-4.15.1
MEMCACHED_TAG=1-2.18.1
OPENSMTPD_TAG=7-1.22.5
RSYSLOG_TAG=latest
SELENIUM_CHROME_TAG=3.141
WEBGRIND_TAG=1-1.35.5
XHPROF_TAG=3.13.4
ZOOKEEPER_TAG=3.8
@csandanov
Copy link
Member

you're looking into ssmtp config, not msmtp

@superromeo
Copy link
Author

Right. Because sendmail is a link to ssmtp:

[email protected]:/var/www/html $ ls -l /usr/sbin/sendmail
lrwxrwxrwx    1 root     root             5 Jan 15 07:51 /usr/sbin/sendmail -> ssmtp

@csandanov
Copy link
Member

we probably should delete ssmtp in wodby/php but sendmail path in php config set correctly:

$ docker run wodby/drupal-php:8.3-dev-4.65.5 sh -c 'php -i | grep sendmail'
sendmail_from => no value => no value
sendmail_path => /usr/bin/msmtp -t -i => /usr/bin/msmtp -t -i
Path to sendmail => /usr/bin/msmtp -t -i

@superromeo
Copy link
Author

Setting /usr/bin/msmtp -t -i works for me.
Thank you, @csandanov!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants