Login   Register  
PHP Classes
elePHPant
Icontem

A bug found

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      POP3 e-mail client  >  All threads  >  A bug found  >  (Un) Subscribe thread alerts  
Subject:A bug found
Summary:DeleteMessage() not deleting messages...
Messages:10
Author:Tony
Date:2006-01-03 02:12:10
Update:2012-12-19 03:34:27
 

  1. A bug found   Reply   Report abuse  
Picture of Tony
Tony
2006-01-03 02:12:10
Very nice class.

One thing I noticed was my messages weren't deleted, even when DeleteMessage() was called. The message is marked as eligible for deleting, but when the close() function is called, $this->must_update was never set to 1. I removed the line $pop3->must_update=1; and moved it to my script, in the form of $pop3->must_update=1; so that the instance variable would be correctly processed in the close() function.

Perhaps the use of instanceof operator would be more appropriate. I don't know how to use it, though.

  2. Re: A bug found   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2006-01-03 04:05:14 - In reply to message 1 from Tony
That is because there is a call to the ResetDeletedMessages() function in the script. If you do not call that function, all messages scheduled to be deleted will be removed when the QUIT command is executed before disconnecting.

  3. Re: A bug found   Reply   Report abuse  
Picture of Tony
Tony
2006-01-06 19:18:31 - In reply to message 2 from Manuel Lemos
Even after removing the call to reset, the problem still exists.

  4. Re: A bug found   Reply   Report abuse  
Picture of Tony
Tony
2006-01-06 19:24:10 - In reply to message 3 from Tony
I am running PHP 4.3.11


  5. Re: A bug found   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2006-01-06 19:35:41 - In reply to message 3 from Tony
Are you sure the Close() function is called?

Can you show the debug output?

  6. Re: A bug found   Reply   Report abuse  
Picture of Tony
Tony
2006-01-06 20:11:49 - In reply to message 5 from Manuel Lemos
Here is the debug output for the script without the explicit setting

$pop3->must_update = 1;

After the script was run, the message was still not deleted.
Once I explicitly set the class variable I re-ran the script. This time the message was deleted, as expected.

-Tony

Output:
----------------------------
Connecting to mail.lightning-mortgage.com ...
S +OK <45603.1136577693@host373.ipowerweb.com>
C USER emailcampaigns@lightning-mortgage.com
S +OK
C PASS pr
S +OK
C STAT
S +OK 1 3227
C LIST
S +OK
S 1 3227
S .
C RETR 1
S +OK
S Return-Path: <>
S Delivered-To: lightnin-EmailCampaigns@lightning-mortgage.com
S Received: (qmail 45137 invoked from network); 6 Jan 2006 20:01:04 -0000
S Received: from unknown (HELO smtp101.sbc.mail.mud.yahoo.com) (68.142.198.200)
S by host373.ipowerweb.com with SMTP; 6 Jan 2006 20:01:04 -0000
S Received: (qmail 35331 invoked for bounce); 6 Jan 2006 19:59:08 -0000
S DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
S s=s1024; d=yahoo.com;
S h=Date:From:To:Subject;
S b=zpCge92ytgTf4TCgWCbSmXm+vIWN7fvLQ7Z8smIjklWCipsjGgjCq27SEomeAQkbqVsE3D47jXpNDAb39U/nQfEp/dLO4NgH09bN2X4w7Fdr3F8Q7e+U32Q8nSmiX63QpP/jq1x0JJsaX4T3SUVdkcGkuUpeGLGgft+Z3JzwryM= ;
S Date: 6 Jan 2006 19:59:08 -0000
S From: MAILER-DAEMON@yahoo.com
S To: EmailCampaigns@lightning-mortgage.com
S Subject: failure notice
S
S Hi. This is the qmail-send program at yahoo.com.
S I'm afraid I wasn't able to deliver your message to the following addresses.
S This is a permanent error; I've given up. Sorry it didn't work out.
S
S <lemos.bad.address@yahoo.com>:
S 67.28.113.19 failed after I sent the message.
S Remote host said: 554 delivery error: dd This user doesn't have a yahoo.com account (lemos.bad.address@yahoo.com) [0] - mta220.mail.re2.yahoo.com
S
S --- Below this line is a copy of the message.
S
S Return-Path: <EmailCampaigns@lightning-mortgage.com>
S Received: (qmail 35315 invoked from network); 6 Jan 2006 19:59:08 -0000
S Received: from unknown (HELO lightning-mortgage.com) (tferlazzo@sbcglobal.net@72.22.69.58 with login)
S by smtp101.sbc.mail.mud.yahoo.com with SMTP; 6 Jan 2006 19:59:07 -0000
S Date: Fri, 6 Jan 2006 12:01:02 -0800
S Return-Path: EmailCampaigns@lightning-mortgage.com
S To: Friend <lemos.bad.address@yahoo.com>
S From: Anthony Ferlazzo <EmailCampaigns@lightning-mortgage.com>
S Reply-to: anthony@lightning-mortgage.com
S Subject: Thanks for Signing Up, Friend
S Message-ID: <03188c359e18c2a80d92ae1f72ea5d10@lightning-mortgage.com>
S X-Priority: 3
S X-Mailer: PHPMailer [version 1.73]
S MIME-Version: 1.0
S Content-Transfer-Encoding: 8bit
S Content-Type: text/plain; charset="iso-8859-1"
S
S Hi Friend,
S
S Looking forward to hearing from you,
S
S -Anthony
S .
C DELE 1
S +OK
Closing connection.

  7. Re: A bug found   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2006-01-08 19:20:49 - In reply to message 6 from Tony
I think there is something wrong in your script. Could you be passing the pop3 class object to a function by value, delete the message there, and then close the connection after returning from the class?

Other than that possibility, it may also be related with some of the latest PHP versions bugs. What version are you using?

  8. Re: A bug found   Reply   Report abuse  
Picture of Tony
Tony
2006-01-08 20:50:08 - In reply to message 7 from Manuel Lemos
As I already said, I am running PHP 4.3.11.

As far as a bug in the script, the script supplied with the class results in the same outcome. If you aren't experiencing the problem on your end then it may be the version of php supplied by my host provider.

  9. Re: A bug found   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2006-01-09 01:24:51 - In reply to message 8 from Tony
I use PHP 4.3.11 and the example script works correctly. I just need to comment the call the ResetDeletedMessages function.

Are you using any kind of PHP optimizing (caching) extension?

  10. Re: A bug found   Reply   Report abuse  
Picture of Ketil Engmark
Ketil Engmark
2012-12-19 03:34:27 - In reply to message 8 from Tony
Works great just added a GET link from message ID in a array to table function ang if get ID fired delete.
Thanks sir for the grear class!