Useful IMAP Header Information Not Displayed

I use standard IMAP functions to receive emails in PHP. I need to track Message-ID(and References, and In-Reply-To) for each message to create a thread. After deploying this system, I want users to be able to reply to messages in their email client in order to add a message to the stream, but in my web interface, the responses cannot be attached to the original message because I do not have a In-Reply-ToID from any email headers mail. I would use an identifier In-Reply-Toto attach my response to the notification that I sent them in a new message, but I cannot, because I cannot get the identifiers. If I have a header In-Reply-To, messages can be grouped, as there is a stream of identifiers connecting them.

In addition, I want to be able to reply to any message that the user sends to the server’s email address if there was an error with their presentation or something like that, in which case I will need Message-IDthem so that I can make a In-Reply-Tomessage identifier that I am sending back.

I cannot get values ​​for Message-ID, but not In-Reply-Toeven if they really matter. (Go to any message in Gmail, click the drop-down menu next to the reply button, click "show original" and you will see that all the header information that is missing for me when I call the IMAP functions actually exists, since although Gmail doesn't want to give this information to IMAP servers.)

I have tried a variety of challenges that allegedly receive header information ( imap_headerinfo, imap_fetchheader, imap_fetch_overview), but they return the sparse array of values for the header information that is not necessary to me, After

$this->mbox = imap_open('{imap.gmail.com:993/imap/ssl}', $email, $password);

I can only get a few useful values ​​from the header with any of these calls:

imap_header($this->getImapStream(), "1");
imap_fetch_overview($this->getImapStream(), "1");
imap_fetchheader($this->getImapStream(), "1");

I can see things such as Subject, To, Reply-Toand other header values, and all of them are accurate, but the Message-ID, References, In-Reply-Toand other valuable information in the header is largely absent (or rather, the values of arrays that represent them, are empty in each case).

I can almost guarantee that the problem is not in the code itself, since I see some values ​​in the headers, and I can successfully get message bodies; it's just as if Google is filtering the header information that I see.

, , , , , , .


- , Message-ID , , .


EDIT 2

Message-ID , , , 40% . , Message-ID s. , Message-ID, .

Message-ID ( , IMAP), IMAP .

+2
2

, . print_r, :

imap_header($this->getImapStream(), "1");
imap_fetch_overview($this->getImapStream(), "1");
imap_fetchheader($this->getImapStream(), "1");

escape- htmlspecialchars, , Message-ID - <lotsOfArbitraryNumbersAndLetters@domain.com> - , : ", , !"

+9

, , , " " IMAP "ENVELOPE", , "" " . , , , PHP - . GMail MIME, .

, ENVELOPE.

? , , .

0

All Articles