wodby / docker4drupal

Docker-based Drupal stack
https://wodby.com/docker4drupal
MIT License
1.24k stars 535 forks source link

Busybox sendmail is not working with mailhog and Drupal 10 #566

Closed webprogrammierer closed 5 months ago

webprogrammierer commented 8 months ago

OS type Linux, Docker Desktop for Windows

Drupal version 10.2

Describe the bug

Mailhog configuration like this

      # For PHP 8.2 use busybox sendmail together with "PHP_MAIL_MIXED_LF_AND_CRLF=On".
#      PHP_MAIL_MIXED_LF_AND_CRLF: On
#      PHP_SENDMAIL_PATH: '/bin/busybox sendmail -t -i -S mailhog:25'
##      PHP_SENDMAIL_PATH: '/bin/busybox sendmail -t -i -S opensmtpd:25'
      # For PHP <8.2 use ssmtp instead of sendmail.
      SSMTP_MAILHUB: mailhog:1025
      # SSMTP_MAILHUB: opensmtpd:25
      PHP_SENDMAIL_PATH: '"/usr/bin/dos2unix -u | /usr/sbin/ssmtp -t -f"'

is working with PHP 8.1 and PHP 8.2

Mailhog configuratin like this

      # For PHP 8.2 use busybox sendmail together with "PHP_MAIL_MIXED_LF_AND_CRLF=On".
      PHP_MAIL_MIXED_LF_AND_CRLF: On
      PHP_SENDMAIL_PATH: '/bin/busybox sendmail -t -i -S mailhog:25'
#      PHP_SENDMAIL_PATH: '/bin/busybox sendmail -t -i -S opensmtpd:25'
      # For PHP <8.2 use ssmtp instead of sendmail.
#      SSMTP_MAILHUB: mailhog:1025
#      # SSMTP_MAILHUB: opensmtpd:25
#      PHP_SENDMAIL_PATH: '"/usr/bin/dos2unix -u | /usr/sbin/ssmtp -t -f"'

is NOT working with PHP 8.2 and Drupal 10.

Therefore I do not understand, what is this section for, if it does not work?

The new configuration

      # For PHP 8.2 use busybox sendmail together with "PHP_MAIL_MIXED_LF_AND_CRLF=On".
      PHP_MAIL_MIXED_LF_AND_CRLF: On
      PHP_SENDMAIL_PATH: '/bin/busybox sendmail -t -i -S mailhog:25'

is not working in Drupal 10. This is confusing and you have to spend a lot of time to figure it out and adjust default compose.yml file.

How can this be treated in the future?

csandanov commented 8 months ago

Hi, could you please try removing -f flag and keep it as:

'"/usr/bin/dos2unix -u | /usr/sbin/ssmtp -t"'
webprogrammierer commented 8 months ago

I have testet it csandanow:

'"/usr/bin/dos2unix -u | /usr/sbin/ssmtp -t"' is also working.

But why did you want this to be tested? Please re-read my initial issue. The problem is located here:

      # For PHP 8.2 use busybox sendmail together with "PHP_MAIL_MIXED_LF_AND_CRLF=On".
      PHP_MAIL_MIXED_LF_AND_CRLF: On
      PHP_SENDMAIL_PATH: '/bin/busybox sendmail -t -i -S mailhog:25'

This is NOT working. Please help to solve this or this lines should be removed from compser.yml.

csandanov commented 8 months ago

What your PHP image tag?

webprogrammierer commented 8 months ago

PHP_TAG=8.2-dev-4.53.2

csandanov commented 8 months ago

Oh, I see, the port is incorrect for mailhog, it should be 1025. Anyway, we're switching to msmtp for all versions in the upcoming update