Issue with Email Encoding in IMAP 'Store Sent Emails'

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

    #1

    Issue with Email Encoding in IMAP 'Store Sent Emails'

    Hi,

    Tested on a clean version 9.1.2 of Espo + Advanced Pack 3.9.0 + patch of Sender.php (email sender: reply-to after addresses · espocrm/espocrm@07a09dd · GitHub)

    There is an issue with the sent message copies saved on the server. It concerns the group account option, IMAP tab – Store Sent Emails:

    Click image for larger version

Name:	image.png
Views:	117
Size:	38.8 KB
ID:	117883

    After sending from Espo, the message appears correctly to the recipient. The problem concerns the copies of the messages saved on the server – both in plain text and HTML formats. It looks like a part of Header goes to the Body of e-mail.

    Looks like a part of Header goes to Body of this email...


    HTML:

    Click image for larger version

Name:	image.png
Views:	65
Size:	30.5 KB
ID:	117884

    Plain:

    Click image for larger version

Name:	image.png
Views:	68
Size:	20.2 KB
ID:	117885
    Attached Files
  • yuri
    Member
    • Mar 2014
    • 9009

    #2
    Could not reproduce with Outlook.com. Any help with a fix appreciated.
    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

      #3
      I can confirm that this issue does not occur with an O365 account, but those mailboxes are connected differently – through your Outlook Integration extension.

      While we're on the topic, I noticed some time ago that for Microsoft accounts, the "Store Sent Emails" option is not required. Interestingly, if you enable this option, sent emails get duplicated (saved twice). If you specify a different folder than Sent, the second copy of the sent message will be saved in that folder (one in Sent Items and one in the designated folder).

      With regular IMAP accounts, the issue appeared in the latest version of EspoCRM. Our Zimbra server does not save sent messages at all, and a test account on an external hosting provider displays the messages as shown at the beginning.

      As I mentioned, the issue only affects copies of sent messages that are supposed to remain on the server (the recipient receives the message correctly). It’s also not a hosting issue – for testing purposes, both the sending and receiving accounts are on the same server and domain.
      Last edited by jacao; 05-19-2025, 08:35 PM.

      Comment

      • yuri
        Member
        • Mar 2014
        • 9009

        #4
        I'd appreciate if somebody could help fixing this bug.
        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

      • yuri
        Member
        • Mar 2014
        • 9009

        #5
        Fix: https://github.com/espocrm/espocrm/c...609c0c748f078c
        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

        • tvio
          Member
          • Feb 2017
          • 30

          #6
          yuri
          After update to newest version 9.13 we have problem with store sent emails:
          [2025-05-26 08:20:58] ERROR: Email sending: Could not store sent email (Email Account 5a5344e7d9818e2ea): Invalid header value detected.
          Attached Files

          Comment


          • yuri
            yuri commented
            Editing a comment
            Need more details to be able to reproduce.
        • yuri
          Member
          • Mar 2014
          • 9009

          #7
          Any help with a fix appreciated.
          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

          • tvio
            Member
            • Feb 2017
            • 30

            #8
            The sent message looks fine, but the email sent from Espo is not saved in the specified folder for saving on the server (in Sent folder).


            Click image for larger version

Name:	image.png
Views:	31
Size:	45.6 KB
ID:	118082

            Comment

            • yuri
              Member
              • Mar 2014
              • 9009

              #9
              Does it happen with every message for every user?
              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


              • tvio
                tvio commented
                Editing a comment
                Thanks for asking. I checked and on another user, the new configuration (personal email configuration) email is saved correctly in the specified folder on the server.

                So what changed after the update? What to look for? What to check?
            • tvio
              Member
              • Feb 2017
              • 30

              #10
              OK. The problem is in name (first name) of user and polish special charakter " ł ". After changed the first name on Michal (witout polish special character) sent email is seved corrrectly.
              As Michał email not saved on server.
              Click image for larger version

Name:	image.png
Views:	23
Size:	59.3 KB
ID:	118123
              Attached Files

              Comment

              • yuri
                Member
                • Mar 2014
                • 9009

                #11
                I'm not sure there's a possible fix without fixing the Laminas Mail library. Will are going to switch to another library in the future (which is quite a big endevour).

                I recommend just disabling storing sent emails for now.
                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

                Working...