I am trying to set up a Help Desk system called osTicket.
The system wants me to set up a forwarding account in the mta.
(in Zimbra's case this is postfix) but I am trying to do it in the zimbra interface.
1. I tried to do this as a forward from the Zimbra interface
2. I also tried to do this as a Distribution list with my email as one of the members and a "mail pipe" as the other.
This is the "address" i'm supposed to set the forward to:
|/usr/bin/php -q /opt/automail.php
1. The forwarding tab (correctly) comes up with "Value did not match valid values", and wouldn't let me add the pipe.
2.When I add it to the distro list it shows on the list of names to add, but when I click save, an alert comes up (correctly) saying:
Server error encountered
Message: invalid request: must be vailid member email address: |/usr/bin/php -q /opt/automail.php
Error code: service:INVALID_REQUEST
Method: ZmCsfeCommand.invoke
Details:soap:Sender
Is there anyway I CAN set this up?
FYI: I have copied automail.php to the opt folder and given it 764 permissions to test it. So once it is set right it should run.
Here is the content of automail.php (so you can see WHAT its trying to do):
PHP Code:
<?php
/*********************************************************************
automail.php
PHP script used for remote email piping...same as as the perl version.
Peter Rotich <peter@osticket.com>
Copyright (c) 2006,2007,2008 osTicket
http://www.osticket.com
Released under the GNU General Public License WITHOUT ANY WARRANTY.
See LICENSE.TXT for details.
vim: expandtab sw=4 ts=4 sts=4:
$Id: $
**********************************************************************/
#pre-checks
function_exists('file_get_contents') or die('upgrade php >=4.3');
set_time_limit(20);
#Configuration: Enter the url and key. That is it.
# url=> URL to pipe.php e.g http://yourdomain.com/support/api/pipe.php
# key=> API's pass phrase
$config=array('url'=>'http://www.domain.com/support/api/pipe.php',
'key'=>'pass phrase here');
#read stdin
$data=file_get_contents('php://stdin');
if(empty($data)) die('Error reading stdin. No message');
#curl post
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$config['url']);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
curl_setopt($ch, CURLOPT_USERAGENT,md5($config['key']));
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result=curl_exec($ch);
curl_close($ch);
$code=0;
if(preg_match('/HTTP\/.* ([0-9]+) .*/', $result, $status))
$code=$status[1];
//Depending on your MTA add the exit codes.
//echo $code;
?>