Jump to content

imap extension, pop3 and UIDL, is it possible?


Jak

Recommended Posts

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
Link to comment
Share on other sites

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!



Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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!
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.