"X-GM-THRID" via imap php
Asked Answered
Z

2

1

Vivek, could you give an example HOWTO grab "X-GM-THRID" via imap php?

Zwiebel answered 14/4, 2011 at 16:11 Comment(3)
I think you clicked the wrong button somewhere: This is a public Q&A web site for programming questions.Sungod
Probably a followup question to #5220762Plicate
thanks, I tried to run openssl s_client -crlf -connect imap.gmail.com:993 . FETCH 1:4 (X-GM-THRID) * 1 FETCH (X-GM-THRID 1327644189674155015) But in gmail web interface 1st msg uid look's like this 12f0d9019b80216a Any ideas?Zwiebel
O
1

It's simple with Zend's IMAP class. The IDs in the web interface are supposed to be HEX versions of the same number Gmail expects through IMAP (http://www.limilabs.com/blog/tag/x-gm-thrid), tough I'm still having trouble using those because if I convert them from HEX the numbers are a bit off.

$imap = new Zend\Mail\Protocol\Imap('imap.gmail.com', '993', true);
$imap->search(array('X-GM-THRID', '1424628081834791276');
Oh answered 23/1, 2013 at 0:45 Comment(0)
D
0

Here an example for getting the "X-GM-THRID" for a given message with $messageId.

$messageId = 1; // E.g. the message number one
$imap = new Zend_Mail_Protocol_Imap('imap.gmail.com', '993', true);
$message = $imap->requestAndResponse("FETCH $messageId (X-GM-THRID)");
$idHex = (int) $message[0][2][1];
$xGmThrid = base_convert($idHex, 10, 16);

Hope it helps.

Digiacomo answered 10/10, 2013 at 7:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.