Webklex / php-imap

PHP-IMAP is a wrapper for common IMAP communication without the need to have the php-imap module installed / enabled. The protocol is completely integrated and therefore supports IMAP IDLE operation and the "new" oAuth authentication process as well.
https://www.php-imap.com
MIT License
297 stars 141 forks source link

found a bug that causes body to be empty #275

Closed Yasser-Chen closed 1 year ago

Yasser-Chen commented 1 year ago

Describe the bug $message->getHTMLBody(); returns null

Used config default config 100%

Code to Reproduce

$messages = $folder->messages()->all()
      ->unseen() // THIS CAUSES THE ERROR //IF THIS IS REMOVED PROBLEM SOLVED
      ->limit(1,1)// I have only one email anyways
      ->get();
foreach($messages as $message){
     $message->hasHTMLBody();//returns null
}

Expected behavior must return an html content as the name says Screenshots If applicable, add screenshots to help explain your problem.

Desktop / Server (please complete the following information):

Additional context please fix this bug and stay the best thing in the internet !! and thanks for reading all this

Webklex commented 1 year ago

Hi @Yasser-Chen , many thanks for your report. Please enable the debug mode inside your config. This will output all the command send to the sever as well as all responses received from the server. This might provide some additional insight into whats happening.

Best regards & happy coding,

BBonnet22 commented 1 year ago

Hello, i'm facing the same issue and it seem that on Gmail if the mail is unread, the body will be empty. However the PR #233 seems to fix this problem, maybe @Yasser-Chen you can try the fix proposed in the PR and see if it work for you as well ?

herbert30 commented 1 year ago

Hello, I've got the same problem. I tried changes from https://github.com/Webklex/php-imap/pull/233. It has pretty much solved this problem. @Webklex When can we expect update of library?

maxkvbn commented 1 year ago

Any updates??

Webklex commented 1 year ago

Hi @maxkvbn , what kind of updates do you expect? This library has received a few updates since than - it all points to being solved. Please let me know if that is the case or not :)

Best regards & happy coding,

freescout-helpdesk commented 1 year ago

We are still experiencing this issue https://github.com/freescout-helpdesk/freescout/issues/1972#issuecomment-1326357106

freescout-helpdesk commented 1 year ago

@Yasser-Chen @maxkvbn @herbert30 @BBonnet22 Are you using OAuth to retrieve emails via IMAP or just plain authentication? Maybe it will help developers to track the issue.

Webklex commented 1 year ago

Hi @freescout-helpdesk @Yasser-Chen @maxkvbn @herbert30 @BBonnet22 , could someone provide me an anonymized broken email which has exactly this issue? This way I can write a test and replicate the issue :)

Best regards & happy coding,

BBonnet22 commented 1 year ago

Hello, since the PR #233 has been merged everything is working fine for me. I'm using laravel-imap with the plain text authentication.

JanKoppe commented 1 year ago

Hi, we're affected by this issue in Freescout.

We're using the tiredofit/freescout:latest_php8.1 Docker image with the hash sha256:00495c014ae87876091068ea0fe53fb242df698eeb14e7fc8d35cad8da57bc1d.

This is build on Freescout 1.8.50, PHP 8.1.14, nginx 1.23.3.

Freescout 1.8.50 seems to be using version 1.2.7 of this library (https://github.com/freescout-helpdesk/freescout/blob/c42b9fa0cb1b034a140bc01534a002b7f0872697/composer.lock#L4341)

We are accessing our mailbox via Exchange365 with OAuth for authentication, as described in the Freescout Wiki.

I'm attaching two emails.

This email is working correctly. It will show the full body in Freescout. This was sent from another E-mail account on the same Exchange365 Domain.

Received: from FR2P281MB2656.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:65::10)
 by BEZP281MB2374.DEUP281.PROD.OUTLOOK.COM with HTTPS; Tue, 17 Jan 2023
 09:29:03 +0000
Received: from FR3P281MB2604.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:5b::12)
 by FR2P281MB2656.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:65::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Tue, 17 Jan
 2023 09:29:03 +0000
Received: from FR3P281MB2604.DEUP281.PROD.OUTLOOK.COM
 ([fe80::690c:853f:dc1f:3ace]) by FR3P281MB2604.DEUP281.PROD.OUTLOOK.COM
 ([fe80::690c:853f:dc1f:3ace%9]) with mapi id 15.20.5986.023; Tue, 17 Jan 2023
 09:29:03 +0000
From: **
To: **
Subject: test
Thread-Topic: test
Thread-Index: AQHZKlYjHynhL2VIpkmWVFv8kIWXiA==
Date: Tue, 17 Jan 2023 09:29:02 +0000
Message-ID: **
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 04
X-MS-Exchange-Organization-AuthSource: FR3P281MB2604.DEUP281.PROD.OUTLOOK.COM
X-MS-Has-Attach:
X-MS-Exchange-Organization-Network-Message-Id:
    f850c72e-d782-4f95-9716-08daf86d458c
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator:
X-MS-Exchange-Organization-RecordReviewCfmType: 0
x-ms-publictraffictype: Email
X-Microsoft-Antispam-Mailbox-Delivery:
    ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(425001)(930097);
X-Microsoft-Antispam-Message-Info:
    ZLoqypCzszDuUH4tTSYyvUH+********ucevuGLh39xVK1+xGbDOQ2EaR2v+TAmJwczFm3KvHw8FSWK4bHcLcwwBvRZ/nUWcfMB0x6iFrhJJWbBYLynry/Hr6X8N9L0mtgZRiiCiAbnRXlSMHrmyJwW5ISDfTuNoC9IrxdqzwVXFpo3EdSEhByPLls1XODb6O8wKavocx2ctbafXF44Hnem7dupbUB9uV++rKl/x3qZW0+H4NmThwAcTB5B/6dpp6YPo9wJhCqJ61UqeEA4FYnDjTZG6+XXfrdU8a3npLqcysB6RjpT4BIUDdOOxVr5bvc10/OgkxTBUqjMA/8tOQ1V4UsUnvBaLp0BNTDwgbgs++X9mOrfKa6CInGcDSfAvYWYAIqZLd3Y1+cw4eopiaiRbDstmcPlgkWTHazUvP+Pggq8bS6l+jsUFoK5fNd3QDVj9BqVFjcZyd632xJ5XbIJB33dleO2YPSF6gwMwnbIyCIk3IcxtSH1tTjxi0i0/E7kNEdWPVez1tJBVMiCzkbHGyBPqn6wyrXyxDJyFDcoLpUVJoxrrFo3DwuYajdtmGnhPB/XFhig0a0mYgN5pq7Cnrp4jQ==
Content-Type: text/plain; charset="utf-8"
Content-ID: <733CAC7058514E48840E4096FD73533D@DEUP281.PROD.OUTLOOK.COM>
Content-Transfer-Encoding: base64
MIME-Version: 1.0

dGVzdHNldHNldA0KLS0gDQpKYW4gS29wcGUNClNlbmlvciBDbG91ZCBFbmdpbmVlciAvIFRlY2hP
cGVyYXRpb25zDQpCdXJkYUZvcndhcmQgR21iSA0KTW9iaWxlICs0OSAxNTEgNTM4Njg5MDMNCg0K
DQo=

This email is not working correctly. Only the headers seem to be parsed, Message subject, recipient, will all show correctly, but the body is completely empty. There are no error logs in Freescout at all. This mail was sent from my private email account at mailbox.org, which is probably why it ran through many more spam filters.

Received: from FR0P281MB2649.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:50::12)
 by BEZP281MB2374.DEUP281.PROD.OUTLOOK.COM with HTTPS; Tue, 17 Jan 2023
 09:25:19 +0000
Received: from DB6P191CA0002.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::12) by
 FR0P281MB2649.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:50::12) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.5986.23; Tue, 17 Jan 2023 09:25:18 +0000
Received: from DB5EUR02FT011.eop-EUR02.prod.protection.outlook.com
 (2603:10a6:6:28:cafe::3b) by DB6P191CA0002.outlook.office365.com
 (2603:10a6:6:28::12) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend
 Transport; Tue, 17 Jan 2023 09:25:18 +0000
Authentication-Results: spf=pass (sender IP is 80.241.56.171)
 smtp.mailfrom=*****; dkim=pass (signature was verified)
 header.d=jankoppe.de;dmarc=pass action=none
 header.from=jankoppe.de;compauth=pass reason=100
Received-SPF: Pass (protection.outlook.com: domain of **** designates
 80.241.56.171 as permitted sender) receiver=protection.outlook.com;
 client-ip=80.241.56.171; helo=mout-p-201.mailbox.org; pr=C
Received: from ****
 DB5EUR02FT011.mail.protection.outlook.com (10.13.58.70) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id
 15.20.6002.13 via Frontend Transport; Tue, 17 Jan 2023 09:25:18 +0000
Received: from  ****
 (***) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.2375.34; Tue, 17
 Jan 2023 10:25:18 +0100
Received: from *****
 (***) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.34; Tue, 17 Jan
 2023 10:25:16 +0100
Received: from ****
 (***) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.2375.34 via Frontend
 Transport; Tue, 17 Jan 2023 10:25:16 +0100
Received: from *****
 (***) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P521) id 15.1.2375.34; Tue, 17
 Jan 2023 10:25:18 +0100
IronPort-SDR: qF6UeVYj8pb73gXrskSNOtfmUEgr2JLTtqbIK+/6ymuIu+hw8DzzyKrOGqm7zNPwG/4zr+ma5y
 XERFv6Zyf/cxrWoVjWXswWrkCVjqQuHglLaONZt1Mg4okFzEByeEZsyg3/3n6kI4O+kgViBgLW
 nNMzGlNLSqYBX+EDhOfE1GEWB/4iRbwDY32SnTr5BYqR0HwgHf+0M0E3b23/NqV6iYrF3KETah
 cLtLRt/b5JY6f5KvmKoz0Y395r7MwryWR1eLKAU2j3w+ioNYBUw36K/hsIRojcquvQk9w3Qtfu
 Yz1BUNwOEOwfxr0VjQScHirO
X-IRON-External-Mail-Tag: Extern
X-IronPort-MID: 60840111
X-IPAS-Result: =?us-ascii?q?A0G0CQCSaMZjmKs48VBaglqEBz5Fk0mfZoFqEw8BAQEBA?=
 =?us-ascii?q?QEBAQEJRAQBAQQDihcCJToEDQECBAEBAQEDAgMBAQEBBQEBAQQBAQECAQEGA?=
 =?us-ascii?q?wEBAQIQAQEBAQEBAQEV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cfvF05XIxAqN7zR2fYRkzjUzPI0PESjunAup+faDBwMMknekjFZIZt0LJghn
 bUrtvkQul62hRcdO9qbijxZqjaXJXsaXqR56pwXXN3xhgwwxg0QaJDQEHWsspSIdskJKgxwe
 mbSgaPDg75b1gzFaXVqTSrB2u9UhJIvvhFWzQZceA3Sx4eY36E6jE9L7DA6bgVJ1REbgeh9D
 W46ZUR6KJKH8ypsmMUeDXunHBtMBUPF90H8o7fTeLY1k6V1uqfxwKHR9ApDEI31M46RQ9SDw
 Iyl9Q==
IronPort-HdrOrdr: A9a23:8y8NqqHssZLZ5JoIpLqE88eALOsnbusQ8zAXPidKKSC9E/b4qy
 nKpp4mPHDP+VUssR0b9uxoW5PwI080l6QZ3WB5B97LNzUO01HFEGgN1+Xf/wE=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-AV: E=Sophos;i="5.97,222,1669071600"; 
   d="scan'208";a="60840111"
X-Amp-Result: SKIPPED(no attachment in message)
Received: from mout-p-201.mailbox.org ([80.241.56.171])
  by maila.burda.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 10:25:16 +0100
Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1])
    (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
     key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256)
    (No client certificate requested)
    by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Nx3QJ6GdJz9sQp
    for <***>; Tue, 17 Jan 2023 10:25:12 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=****; s=MBO0001;
    t=1673947512;
    h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
     to:to:cc:mime-version:mime-version:content-type:content-type:
     content-transfer-encoding:content-transfer-encoding;
    bh=OMh+Pfp7SvIiDJjyXg53DevMPfaJRBhjQUkokwQIgDY=;
    b=m3nM2KPbJdO7D+Vq/fMLLCXpkeDgvLs/JRzGTzWO4OoQhSaXLp76/vkBGPCU7BSGxir2Fu
    g6e9Ggnrf0l8vL7rpvTgttta64wImaP9wOmJ0fOjzHcg/PX7sYjlUjyVyfThqZ7M5qg6/P
    E9wItt4lQoUeQRVc6EoUlUaL7S+2R4P2WsQ6HCjulmpC3fmZdPOTXph/a1YfGvSfSj0pjp
    LauH2n6EURKFmtMv8MbDcvTVKcq7o1bLGnK/RAjkLmRAORt+eC08IEAb5stVE6T6UPZ14Q
    GUqrK2HEm5THS9vlH/11LwxwmnAdqUm8nl+Ymo3n1UNF9r8wkh8BUndGQFOQqQ==
Message-ID: <****>
Subject: Testing 123
From: ****
To: ***
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Date: Tue, 17 Jan 2023 10:25:11 +0100
Return-Path: ***
X-OrganizationHeadersPreserved: ***
X-MS-Exchange-Organization-ExpirationStartTime: 17 Jan 2023 09:25:18.2389
 (UTC)
X-MS-Exchange-Organization-ExpirationStartTimeReason: OriginalSubmit
X-MS-Exchange-Organization-ExpirationInterval: 1:00:00:00.0000000
X-MS-Exchange-Organization-ExpirationIntervalReason: OriginalSubmit
X-MS-Exchange-Organization-Network-Message-Id:
 ca3e116b-7c15-4efe-897e-08daf86cbfae
X-EOPAttributedMessage: 0
X-MS-Exchange-Organization-MessageDirectionality: Originating
X-MS-Exchange-SkipListedInternetSender:
 ip=[80.241.56.171];domain=mout-p-201.mailbox.org
X-MS-Exchange-ExternalOriginalInternetSender:
 ip=[80.241.56.171];domain=mout-p-201.mailbox.org
X-CrossPremisesHeadersPromoted:
 DB5EUR02FT011.eop-EUR02.prod.protection.outlook.com
X-CrossPremisesHeadersFiltered:
 DB5EUR02FT011.eop-EUR02.prod.protection.outlook.com
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DB5EUR02FT011:EE_|FR0P281MB2649:EE_
X-MS-Exchange-Organization-AuthSource: ****
X-MS-Exchange-Organization-AuthAs: Anonymous
X-OriginatorOrg: ***
X-MS-Office365-Filtering-Correlation-Id: ca3e116b-7c15-4efe-897e-08daf86cbfae
X-MS-Exchange-Organization-SCL: 1
X-Microsoft-Antispam: BCL:0;
X-Forefront-Antispam-Report:
 CIP:193.26.100.144;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mout-p-201.mailbox.org;PTR:mout-p-201.mailbox.org;CAT:NONE;SFS:(13230022)(4636009)(451199015)(6916009)(82310400005)(558084003)(2616005)(7116003)(6266002)(36005)(8676002)(86362001)(36756003)(5660300002)(1096003)(336012)(8936002)(156005)(7636003)(7596003);DIR:INB;
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 09:25:18.1452
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ca3e116b-7c15-4efe-897e-08daf86cbfae
X-MS-Exchange-CrossTenant-Id: 0a3106bb-aab1-42df-9639-39f349ecd2a0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0a3106bb-aab1-42df-9639-39f349ecd2a0****
X-MS-Exchange-CrossTenant-AuthSource: ***
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: FR0P281MB2649
X-MS-Exchange-Transport-EndToEndLatency: 00:00:01.4839051
X-MS-Exchange-Processed-By-BccFoldering: 15.20.6002.012
X-Microsoft-Antispam-Mailbox-Delivery:
    ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(930097);
X-Microsoft-Antispam-Message-Info:
    =?iso-8859-1?Q?DN6oyY29jzFhRK1BGCOfg1yFnX4ACBaHBh9nbhnIoNZ4DGdi6zN+tIXnUR?=
 =?iso-8859-1?Q?AY3F6SV1doOncexZBgqeE70YqvkB0xmo97NgnkQFb48xPvmZwoiAqkmIrS?=
 =?iso-8859-1?Q?EbPesMMRL/pVX22Pde2C0KNThL0e02Li5ZCNvDxq+mEt0T9cww7Hho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?iso-8859-1?Q?WrVWN1eIbPedT77yCWDwLAjGBWSrpmI1bZkqI=3D?=
MIME-Version: 1.0

Asdf testing123 this is a body

One difference, beside all the headers, that I can see is that in the working email the body is base64 encoded, whereas in the nonworking email the body is in plaintext.

freescout-helpdesk commented 1 year ago

@Webklex The issue may be related to Microsoft Azure configuration: https://github.com/freescout-helpdesk/freescout/issues/1972#issuecomment-1385554715

Webklex commented 1 year ago

Hi @JanKoppe , thanks for the provided example. I've just added a test based on it. It seems to work fine with the current master.

Webklex commented 1 year ago

Hi @freescout-helpdesk , thanks for the info. I didn't know that this is a thing, but that could explain a lot! I just wonder if there is a way to somehow "detect" if this is the case and somehow "warn" the user?

mbl72 commented 1 year ago

Hi @Webklex

I have another example for an email that shows as empty in Freescout

Received: from AS4PR02MB8234.eurprd02.prod.outlook.com (2603:10a6:20b:4f1::17)
 by PA4PR02MB7071.eurprd02.prod.outlook.com with HTTPS; Wed, 18 Jan 2023
 09:17:10 +0000
Received: from AS1PR02MB7917.eurprd02.prod.outlook.com (2603:10a6:20b:4a5::5)
 by AS4PR02MB8234.eurprd02.prod.outlook.com (2603:10a6:20b:4f1::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Wed, 18 Jan
 2023 09:17:09 +0000
Received: from AS1PR02MB7917.eurprd02.prod.outlook.com
 ([fe80::4871:bdde:a499:c0d9]) by AS1PR02MB7917.eurprd02.prod.outlook.com
 ([fe80::4871:bdde:a499:c0d9%9]) with mapi id 15.20.5986.023; Wed, 18 Jan 2023
 09:17:09 +0000
From: =?iso-8859-1?Q?Martin_B=FClow_Larsen?= <xxxxx@feline.dk>
To: Cofman Drift <xxxxxxxxx@cofman.com>
Subject: Test 1017
Thread-Topic: Test 1017
Thread-Index: AdkrHaKsy+bUiL/eTIS5W3AP+zzLjQ==
Date: Wed, 18 Jan 2023 09:17:09 +0000
Message-ID:
    <AS1PR02MB791721260DE0273A15AFEC3EB5C79@AS1PR02MB7917.eurprd02.prod.outlook.com>
Accept-Language: da-DK, en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 04
X-MS-Exchange-Organization-AuthSource: AS1PR02MB7917.eurprd02.prod.outlook.com
X-MS-Has-Attach:
X-MS-Exchange-Organization-Network-Message-Id:
    98cea1c9-a497-454a-6606-08daf934c6c4
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator:
X-MS-Exchange-Organization-RecordReviewCfmType: 0
x-ms-publictraffictype: Email
X-Microsoft-Antispam-Mailbox-Delivery:
    ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(425001)(930097);
X-Microsoft-Antispam-Message-Info:
    BzqL6hvPyQW0lSkWGop6vQlsIZK48umY74vuKlNgF0pb/H659W+0fuTB+6guqGM0oof00mlzu3gn1pu1R5pUOE2Fb58OqnBEFkB30vVrG6TNsG/6KBtecXkP3FptqO/WRmsxCQx7bK7J2VyS2SbOibqX8mDZhkTrwP1+IA0R9eD0/NvoMqX9GssewUDxSAbaaKdADCuU1dG7qpF8M9tfLDJz+dUL5qZoO+oGINGLLdo2y6Z/F+h3UWv7BXiS4BJKc+jwAng26BUMKmg2VVRdMvc+LbZTovUr9hyEq1orS9fOg1iIV6sPcyIVl3NIEy5bHMYh1d6sUCqvTO1UPSdf7lIvKxSszyKptIPNgioOvFpF9tTHDyKU5p1IiLm5FxW/+kGdPq6ZoTIZVriJoyjx6gWKpPY3vHN6bHUK9mA+LspIYAeuDFFvwkZx2b2Rtw3S99S7zz3eBqv3xlGqJixx/apl4Af7ZaxKFpMj9XZXAQVIv9BA0tIA+1nLByt4dPW4Xzoj3KcBbX5K/HkuR/30Lrq7gRQQDyNYgf5S/MO2MLJqcvnVFPXgVubK6XFu5quDibsZjPjxOUfBTJkJ/n4gB8Z8/TOM0oKD76hszXXoaWd9leUeQ1x88oy+QuXPRxzuLzVec3GiPNMYA42QvvTiWmrrhdceRzhV0J7pJBbi10ik+hXqSeNkldgktd5cWPss5F74yxAaEaPJO9I7MOUpE0XzlRfljPptykrIQt8SARMllykzJNrDt8VAl37ArEZbWxFLm3RuypOI0zgCZMRLf5JeElpCv1ay4wilz4vsYGr4fs3KUQzI1YY43uaDxNMz8k7dH/UkC9Dfg1oyHlNs+w==
Content-Type: multipart/alternative;
    boundary="_000_AS1PR02MB791721260DE0273A15AFEC3EB5C79AS1PR02MB7917eurp_"
MIME-Version: 1.0

--_000_AS1PR02MB791721260DE0273A15AFEC3EB5C79AS1PR02MB7917eurp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Test

Med venlig hilsen
Martin Larsen
Feline Holidays A/S
Tlf 78 77 04 12

--_000_AS1PR02MB791721260DE0273A15AFEC3EB5C79AS1PR02MB7917eurp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
    {font-family:"Cambria Math";
    panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
    {font-family:Calibri;
    panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
    {font-family:"Lucida Console";
    panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
    {margin:0cm;
    font-size:11.0pt;
    font-family:"Calibri",sans-serif;
    mso-fareast-language:EN-US;}
span.EmailStyle18
    {mso-style-type:personal-compose;
    font-family:"Calibri",sans-serif;
    color:windowtext;}
.MsoChpDefault
    {mso-style-type:export-only;
    font-family:"Calibri",sans-serif;
    mso-fareast-language:EN-US;}
@page WordSection1
    {size:612.0pt 792.0pt;
    margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
    {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"DA" link=3D"#0563C1" vlink=3D"#954F72" style=3D"word-wrap:bre=
ak-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Test<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:black;mso-fareast-language:DA">=
Med venlig hilsen<o:p></o:p></span></p>
<p class=3D"MsoNormal"><b><span style=3D"color:red;mso-fareast-language:DA"=
>Martin Larsen<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"color:black;mso-fareas=
t-language:DA">Feline Holidays A/S<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"color:black;mso-fareas=
t-language:DA">Tlf 78 77 04 12<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"mso-fareast-language:D=
A"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>

--_000_AS1PR02MB791721260DE0273A15AFEC3EB5C79AS1PR02MB7917eurp_--

Regards, Martin

jopdorp commented 1 year ago

we are also hitting this issue

Webklex commented 1 year ago

Hi @mbl72 , thanks for the additional example. I just created a new test case based on it. It seems to work well with the current master.

Best regards,

freescout-helpdesk commented 1 year ago

@Webklex Do you have a possibility to test provided emails with Webklex/php-imap 4.1.1? We keep using it as Webklex/php-imap 5.0.0 requires to drop PHP 7.x support.

Webklex commented 1 year ago

Hi @freescout-helpdesk , I unfortunately have no setup to test emails with with any version below 5.x.

Best regards,

jopdorp commented 1 year ago

@Webklex Do you have a possibility to test provided emails with Webklex/php-imap 4.1.1? We keep using it as Webklex/php-imap 5.0.0 requires to drop PHP 7.x support.

So drop PHP 7.x support, it is end-of-life: https://www.php.net/supported-versions.php

freescout-helpdesk commented 1 year ago

In our case here is what happens (the issue with Azure seems to be fixed by settings proper permissions for the app): https://github.com/Webklex/php-imap/issues/320#issuecomment-1404898745