Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

@@ -1,21 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Task: Incoming Email Handler - POP3
* Last Updated: $LastChangedDate: 2010-06-25 07:37:32 -0400 (Fri, 25 Jun 2010) $
* </pre>
*
* @author $Author: mark $
* @copyright (c) 2010 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @file pop3mail.php Task to handle incoming emails through POP3
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: mark $
* @since 25th June 2010
* @version $Rev: 6575 $
* $LastChangedDate: 2011-08-23 10:24:47 -0400 (Tue, 23 Aug 2011) $
* @version v3.2.3
* $Revision: 9404 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -24,69 +17,54 @@ if ( ! defined( 'IN_IPB' ) )
exit();
}
/**
*
* @class task_item
* @brief Task to handle incoming emails through POP3
*
*/
class task_item
{
/**
* Parent task manager class
* Object that stores the parent task manager class
*
* @access protected
* @var object
* @var $class
*/
protected $class;
/**
* This task data
*
* @access protected
* @var array
*/
protected $task = array();
/**
* Prevent logging
*
* @access protected
* @var boolean
*/
protected $restrict_log = false;
/**#@+
/**
* Array that stores the task data
*
* @var $task
*/
protected $task = array();
/**
* Registry Object Shortcuts
*
* @access protected
* @var object
* @var $registry
* @var $settings
* @var $lang
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $cache;
/**#@-*/
/**
* Constructor
*
* @access public
* @param object ipsRegistry reference
* @param object Parent task class
* @param array This task data
* @return void
* @param object $registry Registry object
* @param object $class Task manager class object
* @param array $task Array with the task data
* @return @e void
*/
public function __construct( ipsRegistry $registry, $class, $task )
{
/* Make registry objects */
$this->registry = $registry;
$this->DB = $this->registry->DB();
$this->settings =& $this->registry->fetchSettings();
$this->request =& $this->registry->fetchRequest();
$this->settings =& $this->registry->fetchSettings();
$this->lang = $this->registry->getClass('class_localization');
$this->member = $this->registry->member();
$this->memberData =& $this->registry->member()->fetchMemberData();
$this->cache = $this->registry->cache();
$this->caches =& $this->registry->cache()->fetchCaches();
$this->class = $class;
$this->task = $task;
}
@@ -94,17 +72,15 @@ class task_item
/**
* Run this task
*
* @access public
* @return void
* @return @e void
*/
public function runTask()
{
//--------------------------------------
// Init
//--------------------------------------
require_once( IPS_KERNEL_PATH . '/pop3class/pop3.php' );
require_once( IPS_KERNEL_PATH . '/pop3class/pop3.php' );/*noLibHook*/
$this->pop3 = new pop3_class;
$this->pop3->hostname = $this->settings['pop3_server'];
@@ -147,6 +123,14 @@ class task_item
if ( !$messages )
{
$this->pop3->Close();
/* Log to log table - modify but dont delete */
$this->class->appendTaskLog( $this->task, $this->lang->words['task_pop3email'] );
/* Unlock Task: DO NOT MODIFY! */
$this->class->unlockTask( $this->task );
return;
}
@@ -154,10 +138,10 @@ class task_item
// Well get them then!
//--------------------------------------
require_once ( IPS_KERNEL_PATH . 'classIncomingEmail.php' );
require_once ( IPS_KERNEL_PATH . 'classIncomingEmail.php' );/*noLibHook*/
$result = $this->pop3->ListMessages( '', TRUE );
if ( is_array( $result ) and !empty( $result ) )
{
foreach ( $result as $id => $messageID )
@@ -171,7 +155,13 @@ class task_item
}
$incomingEmail = new classIncomingEmail( $getMessage );
$incomingEmail->route();
if ( !$incomingEmail->ignore )
{
$incomingEmail->route();
}
// And delete
$this->pop3->DeleteMessage( $id );
}
}
@@ -181,11 +171,10 @@ class task_item
$this->pop3->Close();
//-----------------------------------------
// Cleanup
//-----------------------------------------
/* Log to log table - modify but dont delete */
$this->class->appendTaskLog( $this->task, $this->lang->words['task_pop3email'] );
/* Unlock Task: DO NOT MODIFY! */
$this->class->unlockTask( $this->task );
}
@@ -197,7 +186,7 @@ class task_item
}
$response = $this->pop3->GetLine();
if ( $response != "+OK message follows" )
if ( substr( $response, 0, 3 ) != '+OK' )
{
return NULL;
}
@@ -215,5 +204,4 @@ class task_item
return $message;
}
}