Update of /cvsroot/comoblog/comoblog/batch
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23027/batch
Modified Files:
comoblog_batch.php
Log Message:
RFE: 1280310 - POP3 debugging and error reporting
Index: comoblog_batch.php
===================================================================
RCS file: /cvsroot/comoblog/comoblog/batch/comoblog_batch.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- comoblog_batch.php 2 Sep 2005 12:53:56 -0000 1.3
+++ comoblog_batch.php 4 Oct 2005 05:39:06 -0000 1.4
@@ -181,17 +181,26 @@
// pop3 connection and log-in
$pop3 =& new Net_POP3();
- $apop = 0;
+ $popMethod = 'USER';
if (CFG_MAIL_APOP == "yes")
- $apop = 1;
+ $popMethod = 'APOP';
+
+ if (CFG_MAIL_DEBUG == "yes")
+ $pop3->setDebug(true);
+
+ if (!$pop3->connect(CFG_MAIL_POP, 110)) {
+ echo "\n ** Failure to connect to POP3 Server **\n";
+ }
+
+ if(PEAR::isError($ret= $pop3->login(CFG_MAIL_USER, CFG_MAIL_PW, $popMethod))) {
+ echo "\n ** Error logging into POP3 Server **";
+ echo "\n ** Error Message: ".$ret->getMessage()." **";
+ }
- $pop3->connect(CFG_MAIL_POP, 110);
- $pop3->login(CFG_MAIL_USER, CFG_MAIL_PW, $apop);
-
$howmany_msg = $pop3->numMsg();
if ($howmany_msg == 0) {
- if ($BATCH_LOG) echo "\n ** No mail found **";
+ if ($BATCH_LOG) echo "\n ** No mail found **\n";
// pop3 disconnect
$pop3->disconnect();
|