wodby/docker4drupal

Busybox sendmail is not working with mailhog and Drupal 10

webprogrammierer opened this issue · 5 comments

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?

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

'"/usr/bin/dos2unix -u | /usr/sbin/ssmtp -t"'

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.

What your PHP image tag?

PHP_TAG=8.2-dev-4.53.2

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