laravel-imap
laravel-imap copied to clipboard
Uncaught ErrorException: Unknown: Must use comma to separate addresses
Describe the bug
I am just trying to fetch a couple of mails in the inbox folder with:
$folder = $client->getFolder("INBOX");
$messages = $folder->messages()->all()->get();
This results into
PHP Fatal error: Uncaught ErrorException: Unknown: Must use comma to separate addresses: Office (errflg=3) in Unknown:0
Stack trace:
#0 /home/www/webhotels/webhotels2/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 {main}
thrown in Unknown on line 0
But only when there is one specific mail. When I delete/move this one email, the error is gone.
I can't even catch the exception and ignore this specific mail, since its an PHP Fatal error.
The following is the complete email, just with pseudonym domains and IP-Adresses:
Return-Path: <MAILER-DAEMON>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from smtp-out.example2.com (smtp-out.example2.com [1.2.3.4])
by www.example1.com (Postfix) with ESMTPS id 87C671702F7C
for <[email protected]>; Tue, 11 Jun 2024 12:55:31 +0200 (CEST)
Authentication-Results: www.example1.com;
spf=none (sender IP is 1.2.3.4) smtp.mailfrom= smtp.helo=smtp-out.example2.com
Received-SPF: none (www.example1.com: no valid SPF record)
Received: from [4.3.2.1] (helo=example2.com)
by smtp-out.example2.com with esmtp (Exim 4.89)
id 1sGzA5-00B6dR-HB
for [email protected]; Tue, 11 Jun 2024 12:55:33 +0200
Message-id: <[email protected]>
X-FC-Thread-ID: 3b9aca00-18ebf0cd
Date: Tue, 11 Jun 2024 12:55:29 +0200
Subject: NDN: Bereit =?UTF-8?B?ZsO8cg==?= den =?UTF-8?B?U29tbWVyPw==?=
X-Mailer: FirstClass 11.1 (build 11.172)
X-FC-Icon-ID: 2031
X-FC-SERVER-TZ: 181272584
X-FC-MachineGenerated: true
To: [email protected]
From: Post Office
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="--=_--3a1a7e21.3a1a7e20.e28ddda1"
This is a multi-part message in MIME format.
----=_--3a1a7e21.3a1a7e20.e28ddda1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sorry. Your message could not be delivered to:
Max Mustermann (Mailbox or Conference is full.)
----=_--3a1a7e21.3a1a7e20.e28ddda1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<?xml version=3D=221.0=22 encoding=3D=22UTF-8=22?>
<=21DOCTYPE HTML PUBLIC =22-//W3C//DTD HTML 4.0 Transitional//EN=22>
<html xmlns=3D=22http://www.w3.org/1999/xhtml=22>
<head>
<meta http-equiv=3D=22Content-Type=22 content=3D=22text/html; charset=3DUTF=
-8=22 />
<title></title>
<style type=3D=22text/css=22>
<=21--
body=7Bmargin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10p=
x;=7D
-->
</style>
</head>
<body marginleft=3D=2210=22 marginright=3D=2210=22 margintop=3D=2210=22 mar=
ginbottom=3D=2210=22>
<div align=3D=22left=22 style=3D=22text-align:left;=22><font face=3D=22Gene=
va=22 size=3D=22+0=22 color=3D=22=23000000=22 style=3D=22font-family:Geneva=
;font-size:10pt;color:=23000000;=22>Sorry. Your message could not be delive=
red to:</font></div>
<br />
<div align=3D=22left=22 style=3D=22text-align:left;=22><font face=3D=22Gene=
va=22 size=3D=22+0=22 color=3D=22=23000000=22 style=3D=22font-family:Geneva=
;font-size:10pt;color:=23000000;=22>Max Mustermann (Mailbox or Conference =
is full.)</font></div>
<br />
</body>
</html>
----=_--3a1a7e21.3a1a7e20.e28ddda1--
Expected behavior
It should not throw a fatal error and the error should be ignorable. In my case, I would just ignore this one mail.
Desktop:
- OS: Ubuntu 22.04
- PHP: PHP 8.1.2
Additional context Add any other context about the problem here.