RfcComplianceException: RFC 2822 Return-Path

Created on 10 January 2022, over 2 years ago
Updated 26 June 2024, about 3 hours ago

Problem/Motivation

Mimemail produces RfcComplianceException when no "Return-Path" is provided or when this one equals site config email.
Thus triggers exception as follows:
Symfony\Component\Mime\Exception\RfcComplianceException: Email "<contact@mail.com>" does not comply with addr-spec of RFC 2822. in Symfony\Component\Mime\Address->__construct() (line 56 of ../vendor/symfony/mime/Address.php).

Steps to reproduce

None ? (except using mimail as email formatter)
In mailManager->doMail, From, Sender and Return-path are set as site e-mail (to avoid the mail to be treated as spam). Then they undoubtedly end up being rewritten in MimeMailFormatHelper as Return-Path = "<contact@mail.com>" in ::mimeMailHeaders().

Proposed resolution

Remove the wrapper "<>" when rewriting Return-Path.

Remaining tasks

This should be doubled-checked, maybe from a maintainer of the module.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇭🇷Croatia Aporie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024