mguessan / davmail

DavMail POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange and Office 365 Gateway - Synced with main subversion repository at
http://davmail.sourceforge.net
GNU General Public License v2.0
582 stars 86 forks source link

Issue with RFC822.TEXT #359

Closed 0xNath closed 5 months ago

0xNath commented 5 months ago

Hello, thanks for this tool, it's very useful !

We use davmail 6.2.2 with GLPI to collect mails and automatically create tickets. They are using the library laminas-mail to communicate with IMAP servers.

We currently encounter an issue while fetching mails body : image

The library use the fetch argument "RFC822.TEXT" to get mails body, which should return the same as "BODY[TEXT]" but doesn't.

I have tried to use this command using telnet :

NOTWORKING FETCH 1 RFC822.TEXT

Which return this :

* 1 FETCH (UID 106)
NOTWORKING OK FETCH completed

If we use this instead : WORKING FETCH 1 BODY[TEXT]

The we get the expected output :

* 1 FETCH (UID 106 BODY[TEXT] {186}
<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>test for davmail issue !<br>
    </p>
  </body>
</html>
)
WORKING OK FETCH completed

I have tried to do the same on a dovecot server, and I get the same output using both "RFC822.TEXT" and "BODY[TEXT]", and RFC3501 state those two arguments should be equivalent.

I have tried to fix the code of laminas-mail and it solve our issue on GLPI but I'd prefer to fix the issue here. Could I propose a PR for this ?

Best regards, Nathanaël.

0xNath commented 5 months ago

Merci beaucoup ! 👍🏻