48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
#!/usr/bin/php -q
|
|
<?php
|
|
/**
|
|
* Invision Power Services
|
|
* Incoming Email Handler - Piping
|
|
* Last Updated: $Date: 2010-10-13 09:41:52 -0400 (Wed, 13 Oct 2010) $
|
|
*
|
|
* @author $Author: mark $
|
|
* @copyright (c) 2010 Invision Power Services, Inc.
|
|
* @license http://www.invisionpower.com/community/board/license.html
|
|
* @package IP.Board
|
|
* @link http://www.invisionpower.com
|
|
* @since 12th February 2010
|
|
* @version $Revision: 6968 $
|
|
*/
|
|
|
|
$writeDebug = FALSE;
|
|
$readDebug = FALSE;
|
|
|
|
//--------------------------------------
|
|
// Init
|
|
//--------------------------------------
|
|
|
|
$root = $_SERVER['argv'][0] ? $_SERVER['argv'][0] : $_SERVER['SCRIPT_FILENAME'];
|
|
define( 'DOC_IPS_ROOT_PATH', str_replace( 'interface/email/piping.php', '', $root ) );
|
|
|
|
require_once( DOC_IPS_ROOT_PATH . "initdata.php" );
|
|
define( 'IPS_ROOT_PATH', DOC_IPS_ROOT_PATH . CP_DIRECTORY . '/' );
|
|
define( 'IPS_KERNEL_PATH', DOC_IPS_ROOT_PATH . "ips_kernel/" );
|
|
|
|
$debugPath = DOC_IPS_ROOT_PATH . 'cache/_email.txt';
|
|
|
|
//-----------------------------------------
|
|
// Get the Email
|
|
//-----------------------------------------
|
|
|
|
$email = file_get_contents( $readDebug ? $debugPath : 'php://stdin' );
|
|
|
|
if ( $writeDebug )
|
|
{
|
|
file_put_contents( $debugPath, $email );
|
|
}
|
|
|
|
require_once ( IPS_KERNEL_PATH . 'classIncomingEmail.php' );
|
|
$incomingEmail = new classIncomingEmail( $email );
|
|
$incomingEmail->route();
|
|
|
|
exit(); |