php-imap
php-imap copied to clipboard
fwrite(): Argument #1 ($stream) must be of type resource, null given
Code to Reproduce
$client = Client::account('price');
$client->connect();
$client->getConnection()->enableDebug();
$inbox = $client->getFolder('INBOX');
$message = $inbox->messages()->getMessage($uid);
$message->setFlag('Seen');
$message->move($folder);
Exception
>> TAG2 LIST "" "*"
<< * LIST (\HasNoChildren \Unmarked) "|" "&BD0ENQ- &BD4EPwRABDUENAQ1BDsENQQ9-"
<< * LIST (\HasNoChildren \Unmarked \Drafts) "|" Drafts
<< * LIST (\HasNoChildren \Unmarked \NoInferiors) "|" INBOX
<< * LIST (\HasNoChildren \Unmarked) "|" Outbox
<< * LIST (\HasNoChildren \Unmarked \Sent) "|" Sent
<< * LIST (\HasNoChildren \Unmarked \Junk) "|" Spam
<< * LIST (\HasNoChildren \Unmarked \Trash) "|" Trash
<< * LIST (\HasNoChildren \Unmarked) "|" test
<< TAG2 OK LIST Completed.
>> TAG3 SELECT "INBOX"
<< * FLAGS (\Answered \Seen \Draft \Deleted $Forwarded)
<< * 456 EXISTS
<< * 0 RECENT
<< * OK [UNSEEN 169]
<< * OK [PERMANENTFLAGS (\Answered \Seen \Draft \Flagged \Deleted $Forwarded \*)] Limited
<< * OK [UIDNEXT 470] Ok
<< * OK [UIDVALIDITY 1660628761] Ok
<< TAG3 OK [READ-WRITE] SELECT Completed.
>> TAG4 UID FETCH 1:* (UID)
<< * 1 FETCH (UID 1)
*****
<< * 456 FETCH (UID 469)
<< TAG4 OK UID FETCH Completed.
>> TAG5 UID FETCH 469 (FLAGS)
<< * 456 FETCH (UID 469 FLAGS (encrypted system_hamon))
<< TAG5 OK UID FETCH Completed.
>> TAG6 UID FETCH 469 (RFC822.HEADER)
<< * 456 FETCH (UID 469 RFC822.HEADER {3505}
<< Received: from postback14j.mail.yandex.net (postback14j.mail.yandex.net [2a02:6b8:c04:242:0:640:b4e8:b14])
<< by y6pztjrigrteiejr.iva.yp-c.yandex.net with LMTP id y3S1k74mII-fiIYZ2p4
<< for <[email protected]>; Mon, 29 Aug 2022 20:14:47 +0300
<< Received: from myt5-ea56983ea3f5.qloud-c.yandex.net (myt5-ea56983ea3f5.qloud-c.yandex.net [IPv6:2a02:6b8:c12:1119:0:640:ea56:983e])
<< by postback14j.mail.yandex.net (Yandex) with ESMTP id 5CD6C26B44B7
<< for <[email protected]>; Mon, 29 Aug 2022 20:14:47 +0300 (MSK)
<< Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [2607:f8b0:4864:20::1130])
<< by myt5-ea56983ea3f5.qloud-c.yandex.net (mxfront/Yandex) with ESMTPS id MES6tAm3NP-EkdSTiRJ;
<< Mon, 29 Aug 2022 20:14:46 +0300
<< (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
<< (Client certificate not present)
<< X-Yandex-Internal: 1
<< X-Yandex-Fwd: 1
<< Authentication-Results: myt5-ea56983ea3f5.qloud-c.yandex.net; spf=pass (myt5-ea56983ea3f5.qloud-c.yandex.net: domain of gmail.com designates 2607:f8b0:4864:20::1130 as permitted sender, rule=[ip6:2607:f8b0:4000::/36]) smtp.mail=m
[email protected]; dkim=pass [email protected]
<< X-Yandex-Spam: 1
<< X-Yandex-Uid-Status: 1 1130000060622826
<< Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-340f82c77baso96872567b3.1
<< for <[email protected]>; Mon, 29 Aug 2022 10:14:46 -0700 (PDT)
<< DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
<< d=gmail.com; s=20210112;
<< h=to:subject:message-id:date:from:mime-version:from:to:cc;
<< bh=cx1Z2WoQwEjZzXqS09OiLq5Xe4Td/caO4gtX+RAQS30=;
<< b=VeWMSOxuhVeMY2jO9Ed4IVScdZKoyOHqK4hwLpqazy3SAlmC8huY57LDkWUJgN/qXl
<< rBgEb7OcCnGCoaDo6GsCd/MNAx2H2RH4GnQFKiNbEW8raUWX3woVlt9x1J6Hog4YyOiB
<< Jjrh6Oh0wRJsbOl3qSw4HsL1gofphnEG4iorgi9WHoBHvEnwqb4JKNvXoVKlyoTjD0vi
<< 8d4wBncPiHXwlJkuGZGoFi2ryutm+5hOHconILNjHtui+o+tuAnH6F3p/6nI1cYy8c9U
<< CeBxs8AnlWgtlIhbE2MWJyYjNh+Wn/bqVbERS9MPDKu/rW0C8XSB68ZbSENfSVeVhfhe
<< BBCQ==
<< X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
<< d=1e100.net; s=20210112;
<< h=to:subject:message-id:date:from:mime-version:x-gm-message-state
<< :from:to:cc;
<< bh=cx1Z2WoQwEjZzXqS09OiLq5Xe4Td/caO4gtX+RAQS30=;
<< b=UhrCZCL14h2s23LLfnC8jB9otNPmFJL8nRKcbHDYolfSpfJ6tIxjwXNOphpryPSbk/
<< otjJQETKvx1s8KIP/w86Wsx+qGFYI4ZRgv29OR81xaIADHNXbnSVdI1EYomIf3eR3dVP
<< VNA5DoKrkg6r/SwQ3qHrF13ioHftWcU49PAtA1Kxe7Qdzx6A2rsrEmOx8QsmMp8Wko7f
<< Vp3B28DIPEDD07cEAz7fuZ/VXcmNmrqa8V+SfwaQO3iiZSvW1QPxaED63aNDw7Z/DpRZ
<< 1qUYsssij4jz4j0tWPd+piH6ZoJ925fQuNqd+RVe5xRmT1hauUH6eXPs0V2lDaJ/vMXl
<< le9A==
<< X-Gm-Message-State: ACgBeo0Wn94yqjLn1xQma/fqB7MCbsQTvoKuA2yBO2se+DIkiTJ1ZEE7
<< /eJ0pqSKqBBwRVVjAQTco+auOooMZkdCt9OUsMNzXH0C
<< X-Google-Smtp-Source: AA6agR4nBBM7zbLzJ9bxb6wFTUFDcfdJANTugo3Ke22NAxpd7vxrx7tgXh7A9ogAePgKHOwIJhEoQtz8nFyhKO90eS4=
<< X-Received: by 2002:a25:4dc2:0:b0:696:32b3:3c33 with SMTP id
<< a185-20020a254dc2000000b0069632b33c33mr9609612ybb.166.1661793285242; Mon, 29
<< Aug 2022 10:14:45 -0700 (PDT)
<< MIME-Version: 1.0
<< From: MihaKot <[email protected]>
<< Date: Mon, 29 Aug 2022 20:14:10 +0300
<< Message-ID: <CAB_7BgqWSEjkq6dj+xTq1fD6+edspRkUEHVJMb0Q5rptj9OVEw@mail.gmail.com>
<< Subject: sdfasldjfa;sldfgasdhf[08y
<< To: [email protected]
<< Content-Type: multipart/alternative; boundary="0000000000007506a205e7646692"
<< Return-Path: [email protected]
<< X-Yandex-Forward: 4b6c49c59b97a0a335651d7ca3ce4a6b
<<
<< )
<< TAG6 OK UID FETCH Completed.
>> TAG7 UID FETCH 469 (RFC822.TEXT)
<< * 456 FETCH (UID 469 RFC822.TEXT {1288}
<< --0000000000007506a205e7646692
<< Content-Type: text/plain; charset="UTF-8"
<< Content-Transfer-Encoding: base64
<<
<< a2puO2FzZGggcGFzZGZnYWZkZ2FzZGZhc2RmDQoNCi0tIA0KUC5TLiDQodC+0YXRgNCw0L3Rj9C5
<< 0YLQtSDQv9C10YDQtdC/0LjRgdC60YMg0LIg0YLQtdC70LUg0L/QuNGB0YzQvNCwLg0KX19fX19f
<< X19fX19fX19fX19fX19fX19fX19fX19fX19fX18NCkJlc3QgcmVnYXJkcywgS29uc3RhbnRpbiBA
<< TWloYUtvdEAgQWtzYXJpbi4NClBob25lOiArNyA5MjEgNzQgNjYgODE4DQpTa3lwZTogbWloYWtv
<< dA0KRS1tYWlsOiBtaWhha290QGdtYWlsLmNvbQ0K
<< --0000000000007506a205e7646692
<< Content-Type: text/html; charset="UTF-8"
<< Content-Transfer-Encoding: quoted-printable
<<
........
<< --0000000000007506a205e7646692--
<< FLAGS (\Seen encrypted system_hamon))
<< TAG7 OK UID FETCH Completed.
>> TAG8 UID STORE 471:471 -FLAGS.SILENT (\Seen)
<< TAG8 OK UID STORE Completed.
>> TAG9 UID FETCH 471 (FLAGS)
<< * 457 FETCH (UID 471 FLAGS (encrypted system_hamon))
<< TAG9 OK UID FETCH Completed.
>> TAG10 UID STORE 471:471 +FLAGS.SILENT (\Seen)
<< TAG10 OK UID STORE Completed.
>> TAG11 UID FETCH 471 (FLAGS)
<< * 457 FETCH (UID 471 FLAGS (\Seen encrypted system_hamon))
<< TAG11 OK UID FETCH Completed.
>> TAG12 SELECT "не определен"
<< TAG12 BAD [CLIENTBUG] SELECT Folder encoding error. sc=1XPIMkULF0U1_291733_5-9b0bc92fe44a
>> TAG13 EXAMINE "не определен"
<< TAG13 BAD [CLIENTBUG] EXAMINE Folder encoding error. sc=1XPIMkULF0U1_291733_5-9b0bc92fe44a
TypeError
fwrite(): Argument #1 ($stream) must be of type resource, null given
at W:\home\jeeparts\vendor\webklex\php-imap\src\Connection\Protocols\ImapProtocol.php:330
326▕ */
327▕ public function write(string $data) {
328▕ if ($this->debug) echo ">> ".$data ."\n";
329▕
➜ 330▕ if (fwrite($this->stream, $data . "\r\n") === false) {
331▕ throw new RuntimeException('failed to write - connection closed?');
332▕ }
333▕ }
334▕
1 W:\home\jeeparts\vendor\webklex\php-imap\src\Connection\Protocols\ImapProtocol.php:330
fwrite()
2 W:\home\jeeparts\vendor\webklex\php-imap\src\Connection\Protocols\ImapProtocol.php:318
Webklex\PHPIMAP\Connection\Protocols\ImapProtocol::write()
>> TAG14 LOGOUT
<< * BYE IMAP4rev1 Server logging out
<< TAG14 OK LOGOUT Completed.
Tried to move to test folder, same error
Version 4.0.0 php 8.1
p.s.
hm. interesting.
Letters have moved to the test folder, but it still gives an error.
But it does not move to the "не определено" folder.