So I'm trying to trick the bug_report_mail.php script into thinking it is connecting to a mail server and reading a new message from the inbox. I commented out the code in private function process_pop3_mailbox() and added the following code instead:
Code: Select all
echo "** \$argv[1] = $argv[1]\r\n";
$t_msg = file_get_contents($argv[1],FALSE); # slurp in entire file passed on command line to this script
$t_emailresult = $this->process_single_email( $t_msg ); # changed param from $t_Msg to $t_msg
Code: Select all
$this->show_memory_usage( 'Single email retrieved from mailbox' );
$t_email = $this->parse_content( $t_msg );
unset( $t_msg );
$this->show_memory_usage( 'Parsed single email' );
Then to test this I go into the Scripts directory and call it manually, with the complete text of an email message in a text file:
Code: Select all
php bug_report_mail.php lastEmail-0.txt
Code: Select all
SYSTEM WARNING: 'file_get_contents(): Filename cannot be empty' in 'C:\Mantis\plugins\EmailReporting\core\mail_api.php' line 336