Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
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
 
Old September 20th, 2004, 11:57 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

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
 
Old September 20th, 2004, 12:44 PM
Registered User
 
Join Date: Sep 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?

 
Old September 20th, 2004, 12:54 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

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
 
Old September 20th, 2004, 01:10 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

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
 
Old December 6th, 2004, 09:55 PM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to fgraph
Default

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.

 
Old December 6th, 2004, 10:08 PM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

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
 
Old December 7th, 2004, 07:54 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

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
 
Old December 7th, 2004, 11:16 AM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
Newbie help with imap on wamp with joomla MMS blog 123newbie PHP How-To 1 April 28th, 2007 04:06 AM
MIME attachments in PHP vibinkrish Beginning PHP 0 March 9th, 2006 07:45 AM
Imap _open() error vibinkrish PHP How-To 0 March 1st, 2006 05:31 AM
imap streaming error identification... bad_demon Pro PHP 3 December 5th, 2003 03:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.