PHP Classes

File write errors

Recommend this page to a friend!

      pop3.class.inc  >  All threads  >  File write errors  >  (Un) Subscribe thread alerts  
Subject:File write errors
Summary:Authentication is successful but...
Messages:3
Author:Glenn Farrell
Date:2011-11-07 16:38:10
Update:2011-11-07 20:56:38
 

  1. File write errors   Reply   Report abuse  
Picture of Glenn Farrell Glenn Farrell - 2011-11-07 16:38:10
My site is www.valleycorp.com.au. The user I wish to download emails for is sr@valleycorp.com.au.

My hosting provider (www.webcity.com.au) requires for POP and IMAP authentication that you send the username as "sr+valleycorp.com.au" (because it's a shared host, I presume), on mail server mail.valleycorp.com.au.

I've been up all night playing with this. When you use the "correct" user id (sr+valleycorp.com.au), you get a bunch of messages as follows:
=====================================================================
Warning: fopen(.//mails//7770515c99f4045faf62ea4e15d77bac.txt) [function.fopen]: failed to open stream: No such file or directory in /home/val23298/public_html/sr/pop3.class.inc on line 777
POP3 save2file() - Error: Can't open file in write mode. (.//mails//7770515c99f4045faf62ea4e15d77bac.txt)
=====================================================================

Testing reveals that I'm authenticating ok. This is borne out by the following:

After mucking around all night I dropped the "+valleycorp.com.au" (ie a $username of "sr" only) and got rid of those messages but instead get the authentication error.

The script takes longer to fail and the error is:
=====================================================================
POP3 login() - Error: -ERR Authentication failed.
=====================================================================

This is a reasonable error to expect as they require the "+" symbol and the domain name as part of the mail user id.

So the fail messages appear to come from a correct user id and a successful authentication.

So I tried the steps you gave in a similar situation (chmod 777 on the directory), and instead get a 500 HTTP error!

I know this is an "old" class but I'd be grateful for any help.

  2. Re: File write errors   Reply   Report abuse  
Picture of Steffen Stollfuß Steffen Stollfuß - 2011-11-07 19:54:48 - In reply to message 1 from Glenn Farrell
Hi Glenn,

I think your problem is that the webserver where you the script run with is not allowed to write to the mails directory.

That seems to be the reason for this error message.

=====================================================================
Warning: fopen(.//mails//7770515c99f4045faf62ea4e15d77bac.txt) [function.fopen]: failed to open stream: No such file or directory in /home/val23298/public_html/sr/pop3.class.inc on line 777
POP3 save2file() - Error: Can't open file in write mode. (.//mails//7770515c99f4045faf62ea4e15d77bac.txt)
=====================================================================

If you can create a directory named "mails" into your "public_html/sr" directory and set the permission to 0777 (means ALL have read/write access).

The second error that your posted here is a result of your "testing" with username ;) .




Have you access to the server log files ??? I red you chmod to 0777 already so I think you will have to look into the logs to see what happend here.

regards
j0inty

  3. Re: File write errors   Reply   Report abuse  
Picture of Glenn Farrell Glenn Farrell - 2011-11-07 20:56:38 - In reply to message 2 from Steffen Stollfuß
Thank you so much for your help.

It's all sorted out now.

Best regards,

Glenn Farrell