Jak Posted October 5, 2006 Share Posted October 5, 2006 Hey, Quick question, is there any way, at all, to get the UIDL data from a pop3 server using just the php imap extension functions?I’m currently using PEAR's Net_POP3 package to get the e-mails, and this returns the UIDL successfully. However that package isn’t as feature rich as the imap extension, so I’m still having to use other packages and functions to perform additional tasks (such as Mail_mime).If I can use the imap extension I would like to, but I don’t want to do it unless I can do the whole job with it. I don’t want to write my own function or use another class to get the UIDL data, as that requires making two connections to the mail server, and is generally pretty sloppy.Thanks in advance, Jack Quote Link to comment https://forums.phpfreaks.com/topic/23119-imap-extension-pop3-and-uidl-is-it-possible/ Share on other sites More sharing options...
printf Posted October 5, 2006 Share Posted October 5, 2006 No IMAP, PHP does not support direct access to the UIDL for POP3, but you can get it with...[code]$obj_header = imap_headerinfo ( $box, $number );$uidl = $obj_header->message_id;[/code]Please understand PHP gives you core functions, but that does not mean you can not do the some thing some other way that the core doesn't support, sometimes your made up way will even be 5X to 10X faster than the core way! In this case it shouldn't case a problem, because I would think you still need the header info, so it wouldn't be a extra function call!me! Quote Link to comment https://forums.phpfreaks.com/topic/23119-imap-extension-pop3-and-uidl-is-it-possible/#findComment-104626 Share on other sites More sharing options...
Jak Posted October 5, 2006 Author Share Posted October 5, 2006 Cheers for your reply, but the value of message_id is not the same as the UIDL. I have got a system that works perfectly well using the pear packages, but i just assumed that using those classes would be slower than the all-in-one imap extension. Its a shame that the extension dosent support it, as it seems to be the only thing missing (from my point of view).I read somewhere that the author said it simply cannot be done, but i know thats wrong seeing as the PEAR packages can do it, and you can very easily get the UIDLs using telnet or something. Quote Link to comment https://forums.phpfreaks.com/topic/23119-imap-extension-pop3-and-uidl-is-it-possible/#findComment-104630 Share on other sites More sharing options...
printf Posted October 5, 2006 Share Posted October 5, 2006 I tried it with what I told you, it worked on Merak Windows, but not Merak Linux, Postfix or Courier. But it does work on all of them if I use fsockopen() or the PHP POP3 extension, I wonder what the PHP IMAP extension does different than using a socket or the POP3 extension. I will have to look at the source and see. Have tried the PHP POP3 extension, I justed it and it seem to work.me! Quote Link to comment https://forums.phpfreaks.com/topic/23119-imap-extension-pop3-and-uidl-is-it-possible/#findComment-104645 Share on other sites More sharing options...
Jak Posted October 5, 2006 Author Share Posted October 5, 2006 I dont know about the POP3 extension, my hosts dont have it installed so i cant use it :( . If you find anything out that would be great, cheers. Quote Link to comment https://forums.phpfreaks.com/topic/23119-imap-extension-pop3-and-uidl-is-it-possible/#findComment-104654 Share on other sites More sharing options...
printf Posted October 5, 2006 Share Posted October 5, 2006 I will post something when I look at it later, are you running PHP 4 or 5? Do you want the fsockopen() function to get the uidl?me! Quote Link to comment https://forums.phpfreaks.com/topic/23119-imap-extension-pop3-and-uidl-is-it-possible/#findComment-104669 Share on other sites More sharing options...
Jak Posted October 5, 2006 Author Share Posted October 5, 2006 Im running 5, ive written a function that uses fsocketopen already, but dont want to use it as you end up with two connections to the server, which (although unlikley) could be out of sync if the messages changed during connecting to the two? Quote Link to comment https://forums.phpfreaks.com/topic/23119-imap-extension-pop3-and-uidl-is-it-possible/#findComment-104675 Share on other sites More sharing options...
printf Posted October 5, 2006 Share Posted October 5, 2006 got ya, I will look at the CVS source tree for version 5, and see if I can find another way to get the UIDL for you.me! Quote Link to comment https://forums.phpfreaks.com/topic/23119-imap-extension-pop3-and-uidl-is-it-possible/#findComment-104691 Share on other sites More sharing options...
Jak Posted October 6, 2006 Author Share Posted October 6, 2006 Thanks, that would be incredibly useful, cheers for all your help. Quote Link to comment https://forums.phpfreaks.com/topic/23119-imap-extension-pop3-and-uidl-is-it-possible/#findComment-104820 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.