Skip to content

Commit f2543b6

Browse files
committed
Use FT_PEEK flag to avoid mark messages as read
1 parent 07f491a commit f2543b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/IMAP/Message.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ private function fetchStructure($structure, $partNumber = null) {
314314

315315
$encoding = $this->getEncoding($structure);
316316

317-
$content = imap_fetchbody($this->client->connection, $this->uid, $partNumber, FT_UID);
317+
$content = imap_fetchbody($this->client->connection, $this->uid, $partNumber, FT_PEEK);
318318
$content = $this->decodeString($content, $structure->encoding);
319319
$content = $this->convertEncoding($content, $encoding);
320320

@@ -331,7 +331,7 @@ private function fetchStructure($structure, $partNumber = null) {
331331

332332
$encoding = $this->getEncoding($structure);
333333

334-
$content = imap_fetchbody($this->client->connection, $this->uid, $partNumber, FT_UID);
334+
$content = imap_fetchbody($this->client->connection, $this->uid, $partNumber, FT_PEEK);
335335
$content = $this->decodeString($content, $structure->encoding);
336336
$content = $this->convertEncoding($content, $encoding);
337337

@@ -374,7 +374,7 @@ private function fetchStructure($structure, $partNumber = null) {
374374
break;
375375
}
376376

377-
$content = imap_fetchbody($this->client->connection, $this->uid, ($partNumber) ? $partNumber : 1, FT_UID);
377+
$content = imap_fetchbody($this->client->connection, $this->uid, ($partNumber) ? $partNumber : 1, FT_PEEK);
378378

379379
$attachment = new \stdClass;
380380
$attachment->type = $type;

0 commit comments

Comments
 (0)