Best way to use default mail folder in IMAP? {SOLVED}

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Best way to use default mail folder in IMAP? {SOLVED}

Post by Chris Corbyn »

Hi,

What's the best way to use the default mail folder path (eg. ~/netscape/mail) with the IMAP functions?

The INBOX is always in the home dir but the other folders (sent, trash, drafts etc) are kept in ~netscape/mail.

So far I've been looping over ALL folders then using a regexp to filter out the ones to use but this is extremely slow since the home dir cotains many many folders and files so the loop takes ages to complete every time the page is accessed. This is obviously not going to be acceptable when the application is put to public use.

I cannot afford to simply link to default folders such as trash, sent etc since I need to be able to access folders created by the user too.

Can one of the functions be manipulated in such a way? (Bear in mind the inbox is in the home dir (and there is an empty folder called inbox ~/netscape/mail)

Thanks for any help :-)
Last edited by Chris Corbyn on Fri Dec 31, 2004 2:44 am, edited 1 time in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I'm just going to have to connect twice I think. This way will be quicker than one connection with a massive loop in any case.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I've made the default folder path to be used and also forced an INBOX in the root dir to be used everytime.

This of course assumes that there is always an inbox in the root dir so I may need to modify again.
Post Reply