magepal / magento2-gmail-smtp-app

Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
https://www.magepal.com
319 stars 148 forks source link

Test mail does not work with smtp.1und1.de, while normal mails work #175

Open amenk opened 3 years ago

amenk commented 3 years ago

Magento version #:

Edition (EE, CE, OS, etc):

2.3.5

Expected behavior:

It sends the test mail

Actual behavior:

Error message received

Bummer!

Transaction failed Reject due to policy restrictions. For explanation visit https://www.ionos.com/help/index.php?id=2425&c=hd />

We believe that is the right error text:

https://www.ionos.com/help/index.php?id=2425&c=hd#c139127

554 Transaction failed, reject due to policy restrictions
Problem:

The email was rejected by the IONOS SMTP server because the standards defined in RFC 5321 and RFC 5322 were not adhered to.

Solution:

The email client must meet the following criteria:

The header lines of the email must contain exactly one valid "Date" line according to RFC 2822.
The following header lines may only exist once: From, Sender, To, CC, Subject
The header lines mentioned must be syntactically correct
Note: The To and CC lines can contain multiple recipients.

In accordance with the recommendations from RFC7103, incorrect messages are not automatically corrected by IONOS, otherwise DKIM signatures become invalid. For more information about DKIM signatures, see the IONOS article Configuring DMARC Records for a Domain.

I had a log at the logging in vendor/laminas/laminas-mail/src/Protocol/AbstractProtocol.php:261

it shows this header which seems valid

image

I am pretty sure that 1und1 / ionos has a problem with the

To: me@example.com me@example.com

syntax

It tried with telnet and

To: me@example.com 

works

but

To: me@example.com <me@example.com> 

does not work for 1und1.

Steps to reproduce:

amenk commented 3 years ago

One addition: I realized that the Hello from MagePal SMTP (1 of 2) mail arrives, the above problem seems to be with the 2 of 2 mails. What is the difference between those two send-outs?

mkristandabm commented 3 years ago

One addition: I realized that the Hello from MagePal SMTP (1 of 2) mail arrives, the above problem seems to be with the 2 of 2 mails. What is the difference between those two send-outs?

I use the Magento 2.4.2 (fresh installation) and face the same challenge with the second email test and found that the domain name in "To" field is missing.

I'm using outlook SMTP on the configuration. The first test mail is successfull without any hassle and the second one give an error :

Title : Undeliverable: Hello from MagePal SMTP (2 of 2)
Delivery has failed to these recipients or groups:
info@
The format of the email address isn't correct. A correct address looks like this: someone@example.com. Please check the recipient's email address and try to resend the message.

For example:

The first mail there the "To" field refers to 'info@example.com' The second mail refers to 'info@ <example.com info@example.com>'

Any workaround?