 |
| Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

September 20th, 2004, 11:57 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
Ok, I did have a few typos in there, but I fixed them (edited into last reply).
Regards,
Rich
--
[ http://www.smilingsouls.net]
[ http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
|
|

September 20th, 2004, 12:44 PM
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i may be having issues installing your program. i don't know about this whole pear deal, i read in the documentation you don't need it if yuo have a newer version of PHP? i have 4.3. somethign if i'm not mistaken.
whatever the case, i tried putting your imap.php into my folder, and using your code above, inputting the username/pass etc.
didn't work, blank page. so i added the code:
if($msg->mailboxInfo['Nmsgs'] == 0)
print("no messages");
and it prints no messages. but i know for sure there is one message in the mailbox with an attachment, in the folder "Inbox", i just checked again.
whats the issue here?
|
|

September 20th, 2004, 12:54 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
PEAR comes with PHP, but PEAR isn't installed by default, execute the go-pear.php file at the command line.
>C:\PHP\php.exe C:\PHP\go-pear.php
That installs PEAR.
Once PEAR is installed install the Mail_IMAP 2.0.0 tarball from the command line:
>C:\PHP\pear.bat install C:\path\to\tgz\file\Mail_IMAP-2.0.0alpha1.tgz
That installs Mail_IMAP.
Look in C:\PHP\PEAR\Mail\ for IMAP.php to see that installation was successful.
>C:\PHP\pear.bat help
lists pear installer options.
To migrate these to your server you need to replicate the directory structure that you see in the PEAR folder in a folder in your server and then add the include path to that directory in the include_path directive via a .htaccess configuration.
Regards,
Rich
--
[ http://www.smilingsouls.net]
[ http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
|
|

September 20th, 2004, 01:10 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
I forgot to mention you also have to install Net_URL to use a URI-style syntax to connect.
At the command line:
C:\PHP\>pear install Net_URL
Regards,
Rich
--
[ http://www.smilingsouls.net]
[ http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
|
|

December 6th, 2004, 09:55 PM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
has this code worked for anyone? this script is exactly what i need but i'm getting some errors that i can't seem to resolve.
|
|

December 6th, 2004, 10:08 PM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Just thought I might add a quick security note...
Using the <from> address in the email is going to be really really easy to spoof, so if your site has something like this (to display the pictures in a galery):
"Title: me enjoying a beer Filename: beer.jpg Sender: [email protected]"
It's going to be really easy for people to upload images into someone elses dir/space.
Probably a bit late now, but it hope it helps
Cheers
--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com
|
|

December 7th, 2004, 07:54 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
Colin is right about the security issues. Just depends on how secure you want (or need) to be I guess. It can be more secure by:
1.) Never publishing the address to a website (where bots, etc can get it).
2.) Use a secret address and a web frontend to post to the gallery.
3.) Implement from address verificiation, e.g. click on this link (in an auto-reply) to verify your post.
The code had some parse errors, I wrote it without testing it. I'll revisit the code later today and see what's wrong with it.
Regards,
Rich
--
[ http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
|
|

December 7th, 2004, 11:16 AM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yep, or add a password in the subject line of the email?
Not exactly the best way to keep the password safe, but since the password is probably sent as plaintext when you login, it's vulnerable anyway.
Also, you could have a randomized password that is re-generated every 24 hours or something, which you can copy'n'paste off your profile page when you're logged in?
Would possibly take away the point of using email rather than just normal form uploads though.
Thing with autoreplies is it would have to store the file in a buffer until it got a reply...
Or actually...
How about sending a "request" email, which is replied to with a password. You then reply to the password email and attach the file in the last email sent?
Then all that needs buffering is the password.
Cheers
PS: Thinking aloud a bit there :P
--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com
|
|
 |