Magento2: Magento 2.3: Password Reset Email not being sent: SMTPUTF8

Created on 21 Jan 2019  路  6Comments  路  Source: magento/magento2

Preconditions (*)

  1. Magento 2.3.0
  2. PHP 7.2
  3. Postfix
  4. Ubuntu 18.04.1

Steps to reproduce (*)

  1. Configure Postfix to be able to send the Magento emails
  2. Create a new user -> receive account creation mail on user address
  3. "Forgot Password" in Magento, to try and reset the password

Expected result (*)

  1. Email should be sent properly and customer should receive reset email on his address

Actual result (*)

  1. Email cannot be sent because of missing SMTPUTF8 on SMTP relay (SMTPUTF8 is required, but was not offered by host)

Notes

This is not an issue of my relay or similar (I鈥檓 using Amazon Simple Email Service as a SMTP relay from postfix). It is configured properly and I can send emails using sendmail or from a PHP file with mail() without any issues. Also, none of the email addresses (neither customer address nor shop address) do contain any UTF8 characters, I even checked them with a hex reader. Other Magento emails like Account Creation send without any issues.

Customer Clear Description Format is valid

Most helpful comment

@engcom-backlog-nazar Interesting. I just figured out that when I disable smtputf8 on the local postfix (it is enabled by default) the issue disappears. Apparently the local postfix tries to encode the mail as utf8 which then fails on the AWS SMTP server. I haven鈥檛 yet figured out why this only happens for some emails though. Thank you for your help and sorry for filing this issue.

For reference:
adding smtputf8_enable = no to /etc/postfix/main.cfg solved it (reference)

All 6 comments

Hi @rauberdaniel. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@rauberdaniel do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [x] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

Hi @rauberdaniel thank you for you report, i'm not able to reproduce following steps you described,
selection_284
selection_285

@engcom-backlog-nazar Interesting. I just figured out that when I disable smtputf8 on the local postfix (it is enabled by default) the issue disappears. Apparently the local postfix tries to encode the mail as utf8 which then fails on the AWS SMTP server. I haven鈥檛 yet figured out why this only happens for some emails though. Thank you for your help and sorry for filing this issue.

For reference:
adding smtputf8_enable = no to /etc/postfix/main.cfg solved it (reference)

@rauberdaniel thanks, nice find.

As we faced similar issues with a newly installed Debian stretch system and Magento 2.2.8, the culprit was - as far as I could debug - following:

Postfix on newer or freshly installed Debian (and derivates) systems sets following value in /etc/postfix/main.cf
Found this behavior on:
Postix version on Debian: 9.9: 3.1.12-0+deb9u1

  • or -
    Postfix version on Ubuntu 18.04.1: 3.3.0-1ubuntu0.2
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

As Postfix manpages explain (http://www.postfix.org/COMPATIBILITY_README.html#smtputf8_enable):

The smtputf8_enable default value has changed from "no" to "yes. With the new "yes" setting, the Postfix SMTP server rejects non-ASCII addresses from clients that don't request SMTPUTF8 support, after Postfix is updated from an older version.

Check if you are affected

run postconf -p | grep comp
it might result in:

user@host:~$ postconf -p | grep comp
backwards_bounce_logfile_compatibility = yes
**compatibility_level = 2**
enable_idna2003_compatibility = no
mynetworks_style = ${{$compatibility_level} < {2} ? {subnet} : {host}}
relay_domains = ${{$compatibility_level} < {2} ? {$mydestination} : {}}
**smtputf8_enable = ${{$compatibility_level} < {1} ? {no} : {yes}}**
sun_mailtool_compatibility = no

Workaround

Set smtputf8_enable = no on affected systems

Solution

Magento should encode non-ASCII addresses in Unicode (utf8 I guess)

Was this page helpful?
0 / 5 - 0 ratings