Exemplo n.º 1
0
 echo $hesk_settings['debug_mode'] ? "<pre>User &quot;" . $hesk_settings['pop3_user'] . "&quot; logged in.</pre>\n" : '';
 // Get number of messages and total size
 if (($error = $pop3->Statistics($messages, $size)) == "") {
     echo $hesk_settings['debug_mode'] ? "<pre>There are {$messages} messages in the mail box with a total of {$size} bytes.</pre>\n" : '';
     // If we have any messages, process them
     if ($messages > 0) {
         // Connect to the database
         hesk_dbConnect();
         for ($message = 1; $message <= $messages; $message++) {
             echo $hesk_settings['debug_mode'] ? "<pre>Parsing message {$message} of {$messages}.</pre>\n" : '';
             $pop3->GetConnectionName($connection_name);
             $message_file = 'pop3://' . $connection_name . '/' . $message;
             // Parse the incoming email
             $results = parser($message_file);
             // Convert email into a ticket (or new reply)
             if ($id = hesk_email2ticket($results, 1, $set_category, $set_priority)) {
                 echo $hesk_settings['debug_mode'] ? "<pre>Ticket {$id} created/updated.</pre>\n" : '';
             } else {
                 echo $hesk_settings['debug_mode'] ? "<pre>Ticket NOT inserted - may be duplicate, blocked or an error.</pre>\n" : '';
             }
             // Queue message to be deleted on connection close
             if (!$hesk_settings['pop3_keep']) {
                 $pop3->DeleteMessage($message);
             }
             echo $hesk_settings['debug_mode'] ? "<br /><br />\n\n" : '';
         }
     }
     // Disconnect from the server - this also deletes queued messages
     if ($error == "" && ($error = $pop3->Close()) == "") {
         echo $hesk_settings['debug_mode'] ? "<pre>Disconnected from the POP3 server &quot;" . $pop3->hostname . "&quot;.</pre>\n" : '';
     }
Exemplo n.º 2
0
*  Using this code, in part or full, to create derivate work,
*  new scripts or products is expressly forbidden. Obtain permission
*  before redistributing this software over the Internet or in
*  any other medium. In all cases copyright and header must remain intact.
*  This Copyright is in full effect in any country that has International
*  Trade Agreements with the United States of America or
*  with the European Union.

*  Removing any of the copyright notices without purchasing a license
*  is expressly forbidden. To remove HESK copyright notice you must purchase
*  a license for this script. For more information on how to obtain
*  a license please visit the page below:
*  https://www.hesk.com/buy.php
*******************************************************************************/
define('IN_SCRIPT', 1);
define('HESK_PATH', dirname(dirname(dirname(__FILE__))) . '/');
// Get required files and functions
require HESK_PATH . 'hesk_settings.inc.php';
require HESK_PATH . 'inc/common.inc.php';
// Is this feature enabled?
if (empty($hesk_settings['email_piping'])) {
    die($hesklang['epd']);
}
// Email piping is enabled, get other required includes
require HESK_PATH . 'inc/pipe_functions.inc.php';
// Parse the incoming email
$results = parser();
// Convert email into a ticket (or new reply)
hesk_dbConnect();
hesk_email2ticket($results);
return NULL;
Exemplo n.º 3
0
define('HESK_PATH', dirname(dirname(dirname(__FILE__))) . '/');
// Get required files and functions
require HESK_PATH . 'hesk_settings.inc.php';
require HESK_PATH . 'inc/common.inc.php';
//============================================================================//
//                           OPTIONAL MODIFICATIONS                           //
//============================================================================//
// Set category ID where new tickets will be submitted to
$set_category = 1;
// Set ticket priority of new tickets with the following options:
// -1  = use default category priority
//  0  = critical
//  1  = high
//  2  = medium
//  3  = low
$set_priority = -1;
//============================================================================//
//                         END OPTIONAL MODIFICATIONS                         //
//============================================================================//
// Is this feature enabled?
if (empty($hesk_settings['email_piping'])) {
    die($hesklang['epd']);
}
// Email piping is enabled, get other required includes
require HESK_PATH . 'inc/pipe_functions.inc.php';
// Parse the incoming email
$results = parser();
// Convert email into a ticket (or new reply)
hesk_dbConnect();
hesk_email2ticket($results, 0, $set_category, $set_priority);
return NULL;
Exemplo n.º 4
0
 echo $hesk_settings['debug_mode'] ? "<pre>User &quot;" . $hesk_settings['pop3_user'] . "&quot; logged in.</pre>\n" : '';
 // Get number of messages and total size
 if (($error = $pop3->Statistics($messages, $size)) == "") {
     echo $hesk_settings['debug_mode'] ? "<pre>There are {$messages} messages in the mail box with a total of {$size} bytes.</pre>\n" : '';
     // If we have any messages, process them
     if ($messages > 0) {
         // Connect to the database
         hesk_dbConnect();
         for ($message = 1; $message <= $messages; $message++) {
             echo $hesk_settings['debug_mode'] ? "<pre>Parsing message {$message} of {$messages}.</pre>\n" : '';
             $pop3->GetConnectionName($connection_name);
             $message_file = 'pop3://' . $connection_name . '/' . $message;
             // Parse the incoming email
             $results = parser($message_file);
             // Convert email into a ticket (or new reply)
             if ($id = hesk_email2ticket($results, 1)) {
                 echo $hesk_settings['debug_mode'] ? "<pre>Ticket {$id} created/updated.</pre>\n" : '';
             } else {
                 echo $hesk_settings['debug_mode'] ? "<pre>Ticket NOT inserted - may be duplicate, blocked or an error.</pre>\n" : '';
             }
             // Queue message to be deleted on connection close
             if (!$hesk_settings['pop3_keep']) {
                 $pop3->DeleteMessage($message);
             }
             echo $hesk_settings['debug_mode'] ? "<br /><br />\n\n" : '';
         }
     }
     // Disconnect from the server - this also deletes queued messages
     if ($error == "" && ($error = $pop3->Close()) == "") {
         echo $hesk_settings['debug_mode'] ? "<pre>Disconnected from the POP3 server &quot;" . $pop3->hostname . "&quot;.</pre>\n" : '';
     }