php-imap-client
php-imap-client copied to clipboard
Duplicate properties neither of which work!
Hi again
There is a header.seen and header.details.Unseen.
Both don't seem to do anything, I marked a message as unread and header.seen had 1 and header.details.Unseen was still empty. Same if I send a new message.
{
"header": {
"subject": "testo",
"from": "Abdullah Seba <*****@***.com>",
"to": " ** shop <**@***uk>",
"date": "Thu, 20 Apr 2017 00:04:26 +0000",
"message_id": "<**@**.eurprd09.prod.outlook.com>",
"size": 48087,
"uid": 220,
"msgno": 17,
"recent": 0,
"flagged": 0,
"answered": 0,
"deleted": 0,
"seen": 1, //<<<<<<<<<<<------------------ this one
"draft": 0,
"udate": 1492646668,
"details": {
"date": "Thu, 20 Apr 2017 00:04:26 +0000",
"Date": "Thu, 20 Apr 2017 00:04:26 +0000",
"subject": "testo",
"Subject": "testo",
"message_id": "<**@**.eurprd09.prod.outlook.com>",
"toaddress": "** <**@**.org.uk>",
"to": [
{
"personal": "",
"mailbox": "**",
"host": "**.uk"
}
],
"fromaddress": "Abdullah Seba <**@**.com>",
"from": [
{
"personal": "Abdullah Seba",
"mailbox": "**",
"host": "outlook.com"
}
],
"Recent": " ",
"Unseen": " ", //<<<<<<<<<<<------------------ and this one
"Flagged": " ",
"Answered": " ",
"Deleted": " ",
"Draft": " ",
"Msgno": " 17",
"MailDate": "20-Apr-2017 01:04:28 +0100",
"Size": "48087",
"udate": 1492646668
}
Might be office 365 cuz when I refresh office it sometimes un does what I did. Have to look into it Still the duplicate tho.

Ok. Questions:
-
You first had 1 unread message. You have web interface and in it you see that the letter is not read?
-
You took it with getMessage(). And looked
$imap->inMess->header
Yes or No ?
-
The letter became read? Yes or No ?
-
Do you want to set it as not read?
-
To do this, you use $imap->setUnseenMessage() method?
-
You open the interface and the letter is read again?
P.S. When using getMessage() method, the letter is marked as read.
And 'details' property
$imap->inMess->header->details
Just uses it
imap_headerinfo($this->imapStream, $this->id);
This is a Php built-in function. See http://php.net/manual/ru/function.imap-headerinfo.php
Unseen - U if not seen AND not recent, ' ' if seen OR not seen and recent
When I use the web interface and use $imap->setUnseenMessage() method, the update in the web interface does not happen instantly, it is necessary to switch between folders, and then an unread message will appear.
I have not got to the bit that reads mail in the interface yet. All I'm doing is $imap->getMessages()
I think its a problem with the office interface.
I'll check with Gmail and let you know.
What about header.details.Unseen?
Cant get anything out of gmail....
$emails = $imap->getMessages();
returns this in gmail:
Notice: Unknown: Invalid quoted-printable sequence: =n&p=inboxcategories_all> [image: Customize] Customize your inbox If you see (errflg=3) in Unknown on line 0
works fine in office 365!
What this?
inboxcategories_all
Do you use it?
$imap = new ImapClient([
...
'mailbox' => [
'remote_system_name' => 'imap.server.ru',
'mailbox_name' => INBOX.categories,
],
...
]);
or
$imap = new ImapClient([
...
'mailbox' => [
'remote_system_name' => 'imap.server.ru',
'mailbox_name' => INBOX/categories,
],
...
]);
No, I don't. Its just $imap->getMessages() exact same code that works with 365 but returns this.
try this
$imap = new ImapClient([
...
'mailbox' => [
'remote_system_name' => 'imap.server.ru',
'mailbox_name' => INBOX,
],
...
]);
$imap->selectFolder(categories);
$emails = $imap->getMessages();
why? isn't that the advanced connection?
That is. You do not have a folder separator here.
inboxcategories_all
I believe your issue is not connecting to the default folder @abdullahseba. As @sergey144010 said, try and use the default then switch.
Do note @abdullahseba that an advanced connection is highly recommended.
I can reproduce this issue and debugged this issue. When using ImapClient::getMessages, each message is retrieved by the getMessage() function, which lead to IncomingMessage::init().
In this function, the getHeader() method is called AFTER getAttachments (which marks the e-mail as read/seen). In my opinion the getHeader() should be right before the getAttachments.
Yep its defiantly not outlook now. As soon as I refresh the client my emails get read.
@JerBlo's solution seems to be the most logical.
Thats something you have to do right?
Yes, I will commit in a minute.
I believe this has been fixed. Let me know
Yep seems to work. but the time is always 20 hours. Might be me but the code use to work.

Try with a fresh email please
Cant cuz of the attachment issue #153.
I have to use$emails = $imap->getMessages(10,1);
I was using header.udate
Try and send yourself a new one
No its ok must be my js somewhere. the duplicate headers are still there tho
"header": {
"subject": "Receipt for your PayPal payment to Bamford Trading (UK) Ltd",
"from": "\"[email protected]\" <[email protected]>",
"to": "Peter Spence <[email protected]>",
"date": "Mon, 17 Apr 2017 10:39:37 +0000",
"message_id": "<[email protected]>",
"size": 63770,
"uid": 177,
"msgno": 14,
"recent": 0,
"flagged": 1,
"answered": 0,
"deleted": 0,
"seen": 1,
"draft": 0,
"udate": 1492425583,
"details": {
"date": "Mon, 17 Apr 2017 10:39:37 +0000",
"Date": "Mon, 17 Apr 2017 10:39:37 +0000",
"subject": "Receipt for your PayPal payment to Bamford Trading (UK) Ltd",
"Subject": "Receipt for your PayPal payment to Bamford Trading (UK) Ltd",
"message_id": "<[email protected]>",
"toaddress": "Peter Spence <[email protected]>",
"to": [
{
"personal": "Peter Spence",
"mailbox": "admin",
"host": "e17pumphouse.org.uk"
}
],
"fromaddress": "\"[email protected]\" <[email protected]>",
"from": [
{
"personal": "[email protected]",
"mailbox": "service",
"host": "paypal.co.uk"
}
],
"Recent": " ",
"Unseen": " ",
"Flagged": "F",
"Answered": " ",
"Deleted": " ",
"Draft": " ",
"Msgno": " 14",
"MailDate": "17-Apr-2017 11:39:43 +0100",
"Size": "63770",
"udate": 1492425583
}
No its not fixed. I can see the mail getting marked as read in outlook as i refresh the page. Fixed the date issue (was my JS).
They come thorough as unread than when I refresh the page again its read. I can send link if you want.
Hm...