You are viewing a plain text version of this content. The canonical link for it is here.
Posted to zeta-dev@incubator.apache.org by Tobias Schlitt <to...@schlitt.info> on 2010/06/08 17:38:40 UTC
[zeta-dev] Re: [Components] Error Parsing Mail
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Allessio,
On 06/08/2010 06:27 PM, Alessio Spoto wrote:
> > Sorry i wrote 2009.1 ( forget the 2 in the keyboard )
> > i'm using :
> >
> > * ezComponents 2009.2.1
> > * PHP 5.2.10
> > * CentOS 5.4
OK, that sounds fine.
> > here part of the script
> >
> > $pop3 = new ezcMailImapTransport( "mail.xxx.com" );
> > $pop3->authenticate( "backup_posta@xxx.com", "pass" );
> > $pop3->selectMailbox( "Inbox" );
> > $set = $pop3->fetchByFlag('NEW');
> > $parser = new ezcMailParser();
> > $mails = $parser->parseMail( $set );
> >
> > $db = ezcDbFactory::create( 'mysql://user:pass@127.0.0.1/maillog' );
> > ezcDbInstance::set($db);
> >
> > foreach ( $mails as $mail ){
> > $zfrom='';
> > $zto='';
> > $zfrom = "{$mail->from->email}";
> > foreach ( $mail->to as $to ) {
> > $zto = "{$to->email}";
> > $q = ezcDbInstance::get()->createInsertQuery();
> > $q->insertInto( 'messages' )
> > ->set( '_From', $q->bindValue( $zfrom ) )
> > ->set( '_To', $q->bindValue( $zto ) )
> > ->set( 'Data', $q->bindValue(Date( "o-m-d", $mail->timestamp
> > ) ))
> > ->set( 'Time', $q->bindValue(Date( "H:i",
$mail->timestamp ) ))
> > ->set( 'Subject', $q->bindValue( $mail->subject ) );
> >
> > $stmt = $q->prepare(); // $stmt is a normal PDOStatement
> > $stmt->execute();
> > }
> > ....
> > .....
> > echo "From: {$zfrom}\n";
> > echo "To: {$zto}\n";
> > echo "Data : {$mail->timestamp}\n";
> > echo "Subject: {$mail->subject}\n";
> > echo
"-----------------------------------------------------------\n";
> > echo "\n";
> >
> > }
I cannot spot any issue at a first glance. Could you try to either
reproduce the issue or to generate an Xdebug function trace from its
occurance?
Please do not forget to use "Reply-All" instead of just "Reply" in your
mail client.
Cheers,
Toby
- --
Tobias Schlitt tobias@schlitt.info GPG Key: 0xC462BC14
a passion for php http://schlitt.info/opensource
eZ Components are Zeta Components now! http://bit.ly/9S7zbn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkwOgCAACgkQ5bO3TcRivBSxmwCeKGhxfN1IkhPd1qTPlvhyzq4o
ti8An087423FEsa7EelDia8YpGaRtGYW
=6Wbg
-----END PGP SIGNATURE-----
Re: [zeta-dev] Re: [Components] Error Parsing Mail
Posted by Alessio Spoto <al...@aspoto.net>.
Hello Toby,
I hope the attached file is wat you need
thanks
Alessio
Il 17/06/2010 17.35, Tobias Schlitt ha scritto:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Alessio,
>
> On 06/17/2010 12:50 PM, Alessio Spoto wrote:
>
>
>> Tracing ; ezc/Mail/src/transports/transport_connection.php
>> have a look at this debug : ( xdebug_var_dump( ) )
>>
> <snip />
>
> this is not the type of trace I was talking about, what I actually need
> is a function trace. Please take a look here for details on that:
>
> http://xdebug.org/docs/execution_trace
>
> - From what I saw in the stack trace, you're not using the most recent
> version of the Mail component or you have local changes. Therefore, I'd
> recommend to upgrade to the latest version before further investigation.
>
> Regards,
> Toby
> - --
> Tobias Schlitt tobias@schlitt.info GPG Key: 0xC462BC14
> a passion for php http://schlitt.info/opensource
> eZ Components are Zeta Components now! http://bit.ly/9S7zbn
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkwaQLgACgkQ5bO3TcRivBR1gwCgg6Dv9Y35NwlQO+AnjzwnD9Xx
> 7QYAn0Pu8uFPdxdUZlKhW0vz1St57OZR
> =Pdre
> -----END PGP SIGNATURE-----
>
Re: [zeta-dev] Re: [Components] Error Parsing Mail
Posted by Tobias Schlitt <to...@schlitt.info>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alessio,
On 06/17/2010 12:50 PM, Alessio Spoto wrote:
> Tracing ; ezc/Mail/src/transports/transport_connection.php
> have a look at this debug : ( xdebug_var_dump( ) )
<snip />
this is not the type of trace I was talking about, what I actually need
is a function trace. Please take a look here for details on that:
http://xdebug.org/docs/execution_trace
- From what I saw in the stack trace, you're not using the most recent
version of the Mail component or you have local changes. Therefore, I'd
recommend to upgrade to the latest version before further investigation.
Regards,
Toby
- --
Tobias Schlitt tobias@schlitt.info GPG Key: 0xC462BC14
a passion for php http://schlitt.info/opensource
eZ Components are Zeta Components now! http://bit.ly/9S7zbn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkwaQLgACgkQ5bO3TcRivBR1gwCgg6Dv9Y35NwlQO+AnjzwnD9Xx
7QYAn0Pu8uFPdxdUZlKhW0vz1St57OZR
=Pdre
-----END PGP SIGNATURE-----
Re: [zeta-dev] Re: [Components] Error Parsing Mail
Posted by Alessio Spoto <al...@aspoto.net>.
Hello Toby,
Tracing ; ezc/Mail/src/transports/transport_connection.php
have a look at this debug : ( xdebug_var_dump( ) )
[root@centos55 parser]# php parser3a.php
array(2) {
[0]=>
string(29) "* OK O soi pront, dimi dut.
"
["object"]=>
resource(13) of type (stream)
}
array(2) {
[0]=>
string(21) "A0001 OK Logged in.
"
["object"]=>
resource(13) of type (stream)
}
array(2) {
[0]=>
bool(false)
["object"]=>
resource(13) of type (stream)
}
PHP Fatal error: Uncaught exception 'ezcMailTransportException' with
message 'An error occured while sending or receiving mail. Could not
read from the stream. It was probably terminated by the host.' in
/root/parser/ezc/Mail/src/transports/transport_connection.php:220
Stack trace:
#0 /root/parser/ezc/Mail/src/transports/imap/imap_transport.php(2655):
ezcMailTransportConnection->getLine()
#1 /root/parser/ezc/Mail/src/transports/imap/imap_transport.php(739):
ezcMailImapTransport->getResponse('A0002')
#2 /root/parser/parser3a.php(9):
ezcMailImapTransport->selectMailbox('Inbox')
#3 {main}
thrown in
/root/parser/ezc/Mail/src/transports/transport_connection.php on line 220
thanks in advance
Alessio
Re: [zeta-dev] Re: [Components] Error Parsing Mail
Posted by Alessio Spoto <al...@aspoto.net>.
Hello Toby,
Tracing ; ezc/Mail/src/transports/transport_connection.php
have a look at this debug : ( xdebug_var_dump( ) )
[root@centos55 parser]# php parser3a.php
array(2) {
[0]=>
string(29) "* OK O soi pront, dimi dut.
"
["object"]=>
resource(13) of type (stream)
}
array(2) {
[0]=>
string(21) "A0001 OK Logged in.
"
["object"]=>
resource(13) of type (stream)
}
array(2) {
[0]=>
bool(false)
["object"]=>
resource(13) of type (stream)
}
PHP Fatal error: Uncaught exception 'ezcMailTransportException' with
message 'An error occured while sending or receiving mail. Could not
read from the stream. It was probably terminated by the host.' in
/root/parser/ezc/Mail/src/transports/transport_connection.php:220
Stack trace:
#0 /root/parser/ezc/Mail/src/transports/imap/imap_transport.php(2655):
ezcMailTransportConnection->getLine()
#1 /root/parser/ezc/Mail/src/transports/imap/imap_transport.php(739):
ezcMailImapTransport->getResponse('A0002')
#2 /root/parser/parser3a.php(9):
ezcMailImapTransport->selectMailbox('Inbox')
#3 {main}
thrown in
/root/parser/ezc/Mail/src/transports/transport_connection.php on line 220
:--------------------------------------------------------------------------------------
:--------------------------------------------------------------------------------------
:--------------------------------------------------------------------------------------
string(61) "* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)
"
string(61) "* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $MDNSent)
"
string(95) "* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen
\Draft $MDNSent \*)] Flags permitted.
"
string(16) "* 56216 EXISTS
"
string(13) "* 37 RECENT
"
string(34) "* OK [UNSEEN 7928] First unseen.
"
string(42) "* OK [UIDVALIDITY 1272976880] UIDs valid
"
string(41) "* OK [UIDNEXT 56217] Predicted next UID
"
string(232) "* SEARCH 56180 56181 56182 56183 56184 56185 56186 56187
56188 56189 56190 56191 56192 56193 56194 56195 56196 56197 56198 56199
56200 56201 56202 56203 56204 56205 56206 56207 56208 56209 56210 56211
56212 56213 56214 56215 56216
"
string(232) "* SEARCH 56180 56181 56182 56183 56184 56185 56186 56187
56188 56189 56190 56191 56192 56193 56194 56195 56196 56197 56198 56199
56200 56201 56202 56203 56204 56205 56206 56207 56208 56209 56210 56211
56212 56213 56214 56215 56216
"
PHP Fatal error: Uncaught exception 'ezcMailTransportException' with
message 'An error occured while sending or receiving mail. Could not
read from the stream. XXX It was probably terminated by the host.' in
/root/parser/ezc/Mail/src/transports/transport_connection.php:218
Stack trace:
#0 /root/parser/ezc/Mail/src/transports/imap/imap_set.php(239):
ezcMailTransportConnection->getLine()
#1 /root/parser/ezc/Mail/src/transports/imap/imap_set.php(167):
ezcMailImapSet->nextMail()
#2 /root/parser/ezc/Mail/src/parser/parser.php(234):
ezcMailImapSet->getNextLine()
#3 /root/parser/parser3a.php(16):
ezcMailParser->parseMail(Object(ezcMailImapSet))
#4 {main}
thrown in
/root/parser/ezc/Mail/src/transports/transport_connection.php on line 218
:--------------------------------------------------------------------------------------
:--------------------------------------------------------------------------------------
:--------------------------------------------------------------------------------------
thanks in advance
Alessio
Re: [zeta-dev] Re: [Components] Error Parsing Mail
Posted by Tobias Schlitt <to...@schlitt.info>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Alessio,
On 06/09/2010 02:26 PM, Alessio Spoto wrote:
> I've installed xdebug.so, now, please, help me with debug
be careful when debugging on a life system, since Xdebug will definitely
slow down your system, when being activated. Furthermore, the function
trace generation will polute your HD with traces.
You can find documentation about generating function traces here:
http://xdebug.org/docs/execution_trace. Please only trace the method
call in your code, that results in the exception. If performance of your
script is not critical, I would suggest to trace each of these calls and
to delete traces, where the error did not occur. As soon as you have a
trace where the exception was thrown, please upload it somewhere so we
can try to analyze it.
Do you think that could work?
Once again: Please do not use Xdebug on systems where performance is
critical and watch the HD space, since trace files can become quite large.
HTH,
Toby
- --
Tobias Schlitt tobias@schlitt.info GPG Key: 0xC462BC14
a passion for php http://schlitt.info/opensource
eZ Components are Zeta Components now! http://bit.ly/9S7zbn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkwPll8ACgkQ5bO3TcRivBR7rACeMJBlhyg4KAHhy3IOWctWC0mj
YNcAoLqM0nIezMj7POjvsCBEXoxZLX6r
=EL9l
-----END PGP SIGNATURE-----
[zeta-dev] Re: [Components] Error Parsing Mail
Posted by Alessio Spoto <al...@aspoto.net>.
Hi Tobias
I've installed xdebug.so, now, please, help me with debug
tell me how & where i've to put the break code
Thanks
Alessio
Il 08/06/2010 19.38, Tobias Schlitt ha scritto:
... Could you try to either
reproduce the issue or to generate an Xdebug function trace from its
occurance? ....
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Allessio,
>
> On 06/08/2010 06:27 PM, Alessio Spoto wrote:
>
>
>>> Sorry i wrote 2009.1 ( forget the 2 in the keyboard )
>>> i'm using :
>>>
>>> * ezComponents 2009.2.1
>>> * PHP 5.2.10
>>> * CentOS 5.4
>>>
> OK, that sounds fine.
>
>
>>> here part of the script
>>>
>>> $pop3 = new ezcMailImapTransport( "mail.xxx.com" );
>>> $pop3->authenticate( "backup_posta@xxx.com", "pass" );
>>> $pop3->selectMailbox( "Inbox" );
>>> $set = $pop3->fetchByFlag('NEW');
>>> $parser = new ezcMailParser();
>>> $mails = $parser->parseMail( $set );
>>>
>>> $db = ezcDbFactory::create( 'mysql://user:pass@127.0.0.1/maillog' );
>>> ezcDbInstance::set($db);
>>>
>>> foreach ( $mails as $mail ){
>>> $zfrom='';
>>> $zto='';
>>> $zfrom = "{$mail->from->email}";
>>> foreach ( $mail->to as $to ) {
>>> $zto = "{$to->email}";
>>> $q = ezcDbInstance::get()->createInsertQuery();
>>> $q->insertInto( 'messages' )
>>> ->set( '_From', $q->bindValue( $zfrom ) )
>>> ->set( '_To', $q->bindValue( $zto ) )
>>> ->set( 'Data', $q->bindValue(Date( "o-m-d", $mail->timestamp
>>> ) ))
>>> ->set( 'Time', $q->bindValue(Date( "H:i",
>>>
> $mail->timestamp ) ))
>
>>> ->set( 'Subject', $q->bindValue( $mail->subject ) );
>>>
>>> $stmt = $q->prepare(); // $stmt is a normal PDOStatement
>>> $stmt->execute();
>>> }
>>> ....
>>> .....
>>> echo "From: {$zfrom}\n";
>>> echo "To: {$zto}\n";
>>> echo "Data : {$mail->timestamp}\n";
>>> echo "Subject: {$mail->subject}\n";
>>> echo
>>>
> "-----------------------------------------------------------\n";
>
>>> echo "\n";
>>>
>>> }
>>>
> I cannot spot any issue at a first glance. Could you try to either
> reproduce the issue or to generate an Xdebug function trace from its
> occurance?
>
>
> Please do not forget to use "Reply-All" instead of just "Reply" in your
> mail client.
>
> Cheers,
> Toby
> - --
> Tobias Schlitt tobias@schlitt.info GPG Key: 0xC462BC14
> a passion for php http://schlitt.info/opensource
> eZ Components are Zeta Components now! http://bit.ly/9S7zbn
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkwOgCAACgkQ5bO3TcRivBSxmwCeKGhxfN1IkhPd1qTPlvhyzq4o
> ti8An087423FEsa7EelDia8YpGaRtGYW
> =6Wbg
> -----END PGP SIGNATURE-----
>