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

Mime prepare email message body error #247

Open
triada63 opened this issue Jul 21, 2023 · 2 comments
Open

Mime prepare email message body error #247

triada63 opened this issue Jul 21, 2023 · 2 comments
Labels
Bug Something isn't working

Comments

@triada63
Copy link

Bug Report

Q A
Version(s) 2.24.0

Summary

Problem when sending an email that has a link to the store "". Occurs in a specific situation where the laminas-mime module slices the text of a message, and "to:" may appear at the beginning of a line. Then the mail server thinks that it is necessary to send a letter to this address, and gives:
ssmtp: RCPT TO: *** (555 5.5.2 Syntax error)

image

Current behavior

It is necessary to check and escape the presence of special words at the beginning of each line

How to reproduce

add '' to body of mail, add some characters for show "to:" in begginning of line, and use "quoted-printable" encoding method.

Expected behavior

@triada63 triada63 added the Bug Something isn't working label Jul 21, 2023
@Slamdunk
Copy link
Contributor

and "to:" may appear at the beginning of a line. Then the mail server thinks that it is necessary to send a letter to this address

That would be a very wierd server then: the e-mail standard tells that the first two-newline sequence breaks the headers from the body, and the body shall never be used as a source of truth for any header-like purpose.

As far as I can tell, I see no bug here

@triada63
Copy link
Author

triada63 commented Jul 21, 2023

and "to:" may appear at the beginning of a line. Then the mail server thinks that it is necessary to send a letter to this address

That would be a very wierd server then: the e-mail standard tells that the first two-newline sequence breaks the headers from the body, and the body shall never be used as a source of truth for any header-like purpose.

As far as I can tell, I see no bug here

I thought so too. But i debug it in project. This code in Magento 2 project, which uses laminas-mail for send order mails, it use base php mail() function for send in laminas Transport/Sendmail:send($message), headers and body sending separately, but wrong "to:" is still taken from the message body.

image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants