Error: header_reply_to_contains_too_many_addresses (reply-to issue)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jacao
    Member
    • Mar 2024
    • 39

    #1

    Error: header_reply_to_contains_too_many_addresses (reply-to issue)

    Hello!

    We have encountered an issue in the mass mailing module (Espo 9.1.2, AP 3.9.0). Even when the Reply-To Address and Reply-To Name fields are empty, we are getting the following error:

    Code:
    [2025-05-15 08:35:01] ERROR: Mass Email, send item: 0, unknownError
    [2025-05-15 08:35:01] ERROR: (554) Email sending error: Expected response code "250" but got code "554", with message "554 Error: header_reply_to_contains_too_many_addresses". :: /var/www/html/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(338)
    [object] (Symfony\Component\Mailer\Exception\UnexpectedResponseException(code: 554): Expected response code "250" but got code "554", with message "554 Error: header_reply_to_contains_too_many_addresses". at /var/www/html/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php:338)
    We used the SMTP server provided by our transactional email service provider for sending. While there are some restrictions on their side, we were surprised by the error message about multiple addresses in the Reply-To field, especially since we did not provide any.

    We ran tests using our own SMTP server, and here is what we found: the address from the From Address field is being added to the Reply-To field. Examples:

    If the Reply-To field in the mass mail was empty, the header looks like this:

    Code:
    Reply-To: info@ourdomain.com, info@ourdomain.com
    If the Reply-To fields were filled, the header looks like this:

    Code:
    From: Info <info@ourdomain.com>
    Sender: info@ourdomain.com
    Reply-To: Someone <info@ourdomain.com>, info@ourdomain.com
    It seems that the Reply-To header is being constructed incorrectly when generating the message header and always using From Address (and double it).

    Moreover, the same issue occurs in Flowcharts, in the Send Message Task block, where we can specify a Reply-To address. If we do so, the email fails to send and we get an unknown error in the log:

    Code:
    {main} [2025-05-15 09:47:01] ERROR: (500) Process 6825b80c451337076, element d7ks9hzehb, send message error: Workflow[][sendEmail]: unknownError. :: /var/www/html/custom/Espo/Modules/Advanced/Tools/Workflow/SendEmailService.php(257) [object] (Espo\Core\Exceptions\Error(code: 500): Workflow[][sendEmail]: unknownError. at /var/www/html/custom/Espo/Modules/Advanced/Tools/Workflow/SendEmailService.php:257)


    I would be very grateful for any help.

    Regards, Jacek
    Last edited by jacao; 05-15-2025, 10:27 AM.
  • lazovic
    Super Moderator
    • Jan 2022
    • 1053

    #2
    Hi jacao,

    Unfortunately, I can't reproduce your situation with mass emails, workflows, or flowcharts. I don't get any errors, and the Reply To address is filled in correctly in all cases.

    Comment

    • lazovic
      Super Moderator
      • Jan 2022
      • 1053

      #3
      jacao,

      I use regular email addresses, Gmail ones; maybe that's why I can't reproduce the problems, because I don't have my own email provider with complex settings. For now I think you need to analyze the issue on their side.

      Comment

      • yuri
        Member
        • Mar 2014
        • 9037

        #4
        Maybe this fix will help: https://github.com/espocrm/espocrm/c...3bf3fe8b171742
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • jacao
          Member
          • Mar 2024
          • 39

          #5
          Thank you, Yuri. I appreciate your input, but I don't think this is the solution. We've been investigating the issue all day, and I’ll share my thoughts next week. I believe we’re dealing with two separate problems: one related to sending messages with a reply-to address from flowcharts, and another concerning mass emails.

          Best regards,
          Jacek

          Comment

          • yuri
            Member
            • Mar 2014
            • 9037

            #6
            Hi Jacek,

            Did you try to apply this field manually? I believe there's a high chance that it will solve the problem.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            • jacao
              Member
              • Mar 2024
              • 39

              #7
              Hi,

              Here are the steps to reproduce the bug for workflow part I mentioned before. They have been verified on a fresh installation of Espo 9.1.2 with the Advanced Pack 3.9.0 extension. A group email account was added for sending messages.

              1. Create a simple flowchart, e.g., from the Contact entity, with a single block for sending messages.

              Click image for larger version  Name:	image.png Views:	0 Size:	28.0 KB ID:	117856

              2. Configure the message block for manual sending to specified addresses – add an address in the reply-to field.Use any e-mail template.

              Click image for larger version  Name:	image.png Views:	0 Size:	52.7 KB ID:	117857

              3. Start the process via Processes – Start Process. Use created flowchart and any Contact as input.

              4. Wait for the message to be sent.

              5. Here is the message received by the recipient and its header:

              Click image for larger version  Name:	image.png Views:	0 Size:	28.1 KB ID:	117858

              Code:
              Return-Path: <espo912@xxxxxxxxxxxxxxx>
              Delivered-To:
              Received: from xxxxxxxxxxxxxxxxxx [...]
              From: "espo912@xxxxxxxxxxxxxxx" <espo912@xxxxxxxxxxxxxxx>
              Sender: espo912@xxxxxxxxxxxxxxx
              Reply-To: someone@somedomain.com, someone@somedomain.com
              To: b.xxxxxxxxxxx@xxxxxxxxxxxxxxxxx
              Subject: Test e-mail number 1
              Message-ID: <Contact/682adbcd73ac0607b/1747640282/3652@espo>
              MIME-Version: 1.0
              Date: Mon, 19 May 2025 07:38:02 +0000
              Content-Type: multipart/alternative; boundary=E1ifIVLx​
              Note that the reply-to field contains two email addresses separated with comma, but it should contain only one.


              EDIT:

              Applying changes to Sender.php (https://forum.espocrm.com/forum/bug-...764#post117764) is sloving the issue for both purposes. Thank you Yuri.


              Regards
              Jacek
              Last edited by jacao; 05-19-2025, 08:29 AM.

              Comment

              Working...