在osTicket中使用电子邮件创build票证

我刚刚为我们公司安装了一个osTicket服务器,而且我从使用电子邮件创build票据时遇到了问题。 我使用Postfix作为我的SMTP服务器,Dovecot作为我的IMAP服务器。

在osTicket面板中,configuration电子邮件设置时不会出现任何错误。 但是,当我发送电子邮件到[email protected]时,它不会在我的托pipe面板中创build任何票据。 我检查了我的邮件日志,一切都很好。 我认为我的“automail.php”文件有问题。

如果你能帮助我,我会非常高兴。 提前致谢。

automail.php文件:

*** #!/usr/bin/php -q <?php /********************************************************************* automail.php PHP script used for remote email piping...same as as the perl version. Peter Rotich <[email protected]> Copyright (c) 2006-2013 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: **********************************************************************/ # Configuration: Enter the url and key. That is it. # url => URL to api/tickets.email eg http://yourdomain.com/support/api/tickets.email # key => API's Key (see admin panel on how to generate a key) # $config = array( 'url'=>'support.example.com/tickets.php', 'key'=>'A12857AA982EEE5612EF8F2443538D76' ); #pre-checks function_exists('file_get_contents') or die('upgrade php >=4.3'); function_exists('curl_version') or die('CURL support required'); #read stdin (piped email) $data=file_get_contents('php://stdin') or die('Error reading stdin. No message'); #set timeout set_time_limit(10); #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, 'osTicket API Client v1.7'); curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Expect:', 'X-API-Key: '.$config['key'])); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result=curl_exec($ch); curl_close($ch); //Use postfix exit codes...expected by MTA. $code = 75; if(preg_match('/HTTP\/.* ([0-9]+) .*/', $result, $status)) { switch($status[1]) { case 201: //Success $code = 0; break; case 400: $code = 66; break; case 401: /* permission denied */ case 403: $code = 77; break; case 415: case 416: case 417: case 501: $code = 65; break; case 503: $code = 69; break; case 500: //Server error. default: //Temp (unknown) failure - retry $code = 75; } } exit($code); ?> 

根据osTicket官方文档,电子邮件获取有两种方法:电子邮件pipe道和POP3 / IMAP轮询。 而且他们都需要进一步的configuration,你错过了。

路由传入的电子邮件

设置您的系统接受电子邮件因系统而异,取决于您的个人偏好。 osTicket目前支持pipe道(别名)和POP3 / IMAP轮询方法来路由传入的电子邮件。 门票被路由到部门,并分配了与电子邮件相关的默认优先级。

要启用传入的电子邮件提取function,请在pipe理控制台中转到设置和电子邮件,然后选中电子邮件提取框以启用它。 它默认是禁用的。

电子邮件pipe道

pipe道方法允许实时处理电子邮件。 邮件服务器级别需要额外的设置才能将原始电子邮件传送到osTicketpipe道处理程序。 远程和本地pipe道都受支持。 请参阅电子邮件pipe道指南 。

POP3 / IMAP轮询

POP3 / IMAP帐户轮询方式最适合具有远程邮件帐户和/或邮件传送设置受限的个人。 添加到系统中的每个电子邮件地址都可以有一个与其关联的帐户。 请参阅POP3 / IMAP设置指南 。