SiT! Bugs - SiT!
View Issue Details
0000671SiT!inbound emailpublic2009-04-28 16:372010-07-21 21:29
repostor 
paulh 
normalmajorhave not tried
closedfixed 
3.45 
3.62 LTS3.62 LTS 
0000671: inbound email does not work (Using MTA mode)
The "she-bang is missing"

The head of the file contains:
<?php

running this from commandline:

support@garwin:~> /srv/www/htdocs/sit-3.45/inboundemail.php
/srv/www/htdocs/sit-3.45/inboundemail.php: line 1: ?php: Filen eller katalogen finns inte
/srv/www/htdocs/sit-3.45/inboundemail.php: line 2: //: is a directory
/srv/www/htdocs/sit-3.45/inboundemail.php: line 3: //: is a directory
/srv/www/htdocs/sit-3.45/inboundemail.php: line 4: syntax error near unexpected token `('
/srv/www/htdocs/sit-3.45/inboundemail.php: line 4: `// SiT (Support Incident Tracker) - Support call tracking system'
support@garwin:~>
support@garwin:~>
No tags attached.
related to 0001348closed paulh MTA problem solved 
Issue History
2009-04-28 16:37repostorNew Issue
2009-04-28 16:42repostorNote Added: 0000985
2009-04-28 17:01ivanNote Added: 0000986
2009-04-28 17:01ivanStatusnew => feedback
2009-04-28 17:07kieranNote Added: 0000987
2009-04-28 17:08kieranNote Edited: 0000987
2009-04-28 17:10repostorNote Added: 0000988
2009-04-28 17:16repostorNote Added: 0000989
2009-04-28 17:19ivanNote Added: 0000990
2009-04-28 17:28repostorNote Added: 0000992
2009-04-28 17:31repostorNote Added: 0000993
2009-04-28 17:34repostorNote Added: 0000994
2009-04-28 17:38ivanNote Added: 0000995
2009-04-28 17:40repostorNote Added: 0000996
2009-04-28 20:10repostorNote Added: 0000997
2009-04-28 22:03repostorNote Added: 0000998
2009-04-29 10:34ivanNote Added: 0000999
2009-04-29 10:34ivanReproducibilityalways => have not tried
2009-04-29 10:34ivanStatusfeedback => acknowledged
2009-08-15 16:25ivanSummarythe inbound email does not work => inbound email does not work (Using MTA mode)
2009-09-15 11:01ivanNote Added: 0001966
2009-09-15 12:46repostorNote Added: 0001967
2010-07-02 19:26paulhRelationship addedrelated to 0001348
2010-07-03 12:39paulhNote Added: 0003285
2010-07-03 12:39paulhStatusacknowledged => resolved
2010-07-03 12:39paulhResolutionopen => fixed
2010-07-03 12:39paulhFixed in Version => Current SVN
2010-07-04 12:11ivanTarget Version => 3.62 LTS
2010-07-04 12:11ivanAssigned To => paulh
2010-07-18 15:05ivanNote Added: 0003322
2010-07-18 15:05ivanStatusresolved => closed
2010-07-21 21:29ivanFixed in VersionCurrent SVN => 3.62 LTS

Notes
(0000985)
repostor   
2009-04-28 16:42   
After I added
#!/usr/bin/php5 into the head of the inboundemail.php

I got the following error:
PHP Notice: Undefined index: HTTP_HOST in /srv/www/htdocs/sit-3.45/lib/defaults
.inc.php on line 40
(0000986)
ivan   
2009-04-28 17:01   
Whether the #!/usr/bin/php line is needed depends on your MTA and how it launches the script. I should perhaps update the documentation to mention that.

The 'error' your seeing is actually a notice, not an error as such, you should adjust your php.ini error_reporting setting to E_ALL & ~E_NOTICE which will then hide these.

See
http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting [^]

For more about this.
(0000987)
kieran   
2009-04-28 17:07   
(edited on: 2009-04-28 17:08)
The command you gave in the original report needs to be prefixed with 'php' otherwise the shell will try and execute it directly.

Plus, if the shebang is included, it breaks non-MTA email functionality.

(0000988)
repostor   
2009-04-28 17:10   
Thanks Ivan, and Kieran..

I configured this according to the documentation:

support@garwin:~> cat .forward|/srv/www/htdocs/sit-3.45/inboundemail.php
support@garwin:~> ls -l /srv/www/htdocs/sit-3.45/inboundemail.php
-rwxr-xr-x 1 wwwrun www 19246 28 apr 17.39 /srv/www/htdocs/sit-3.45/inboundemail.php
support@garwin:~> head /srv/www/htdocs/sit-3.45/inboundemail.php
#!/usr/bin/php5
support@garwin:~> ls -l /usr/bin/php5
-rwxr-xr-x 1 root root 2570900 23 sep 2007 /usr/bin/php5
support@garwin:~>

But I do not recieve any emails into the SiT database.?
(0000989)
repostor   
2009-04-28 17:16   
wrong output by me: cut-and-paste problem...

It should show up:

support@garwin:~> cat .forward
daleto,|/srv/www/htdocs/sit-3.45/inboundemail.php
support@garwin:~>

Anyway; in previous versions of SiT; this was working..
(0000990)
ivan   
2009-04-28 17:19   
Hi Reposter,

Can you enable debug logging and see if that provides anything useful: http://sitracker.org/wiki/Debug_Logging [^]
(0000992)
repostor   
2009-04-28 17:28   
Hi Ivan,

I tried to enter the configuration settings as described on the link:
Here is my config.inc.php:

garwin:/srv/www/htdocs/sit-3.45 # cat config.inc.php
<?php
# config.inc.php - SiT! Config file generated automatically by setup.php on Sun, 26 Apr 2009 20:46:41 +0200

# Web Path
# The path to SiT! from the browsers perspective with a trailing slash. e.g. /sit/
$CONFIG['application_webpath'] = '/sit-3.45/';

# MySQL Database Username
$CONFIG['db_username'] = 'sit';

# MySQL Database Password
$CONFIG['db_password'] = 'XXXXXX';

# Attachment Filesystem Path
# The full absolute file system path to a directory to store attachments in (with a trailing slash). This directory should be writable
$CONFIG['attachment_fspath'] = '/srv/www/htdocs/sit-3.45/attachments-e3a5e07a7aa7418a98bfbcf57021035a/';

$CONFIG['error_logfile'] = '/tmp/siterrors.log';

$CONFIG['debug'] = TRUE;

garwin:/srv/www/htdocs/sit-3.45 #

---------------------
But; I can not see any ouput in the /tmp/siterrors.log file

I have "sent" a mail using :
# ls | mailx -s test support

garwin:/srv/www/htdocs/sit-3.45 # ls -l /tmp/siterrors.log
ls: cannot access /tmp/siterrors.log: No such file or directory
garwin:/srv/www/htdocs/sit-3.45 #

If I browse to the "holding_queue"

http://XXXXX/sit-3.45/holding_queue.php [^]

I can see:
==========
DEBUG

CPU Time: 0.084 seconds
Array
==========
At the bottom of the page...

What is wrong here?
(0000993)
repostor   
2009-04-28 17:31   
Hi,

I wasn't aware of that I could configure this part from SiT.
I will give that a try instead.
(0000994)
repostor   
2009-04-28 17:34   
Hi,

That part did not work either...
=================================
Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('enable_inbound_mail', 'POP/IMAP') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup

Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('email_server', 'localhost') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup

Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('email_servertype', 'imap') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup

Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('email_port', '995') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup

Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('email_options', '') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup

Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('email_username', 'support') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup

Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('email_password', 'mack981') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup

Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('email_address', 'support@repostor.com') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup

Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('max_incoming_email_perday', '15') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup

Application Warning [512]
Table 'sit.config' doesn't exist REPLACE INTO `config` (`config`, `value`) VALUES ('spam_email_subject', 'SPAMASSASSIN') in /srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103
Backtrace:
/srv/www/htdocs/sit-3.45/lib/functions.inc.php @ line 8103 trigger_error()
/srv/www/htdocs/sit-3.45/config.php @ line 89 cfgSave()

The SiT schema may need updating to fix this problem.Visit Setup
========================
(0000995)
ivan   
2009-04-28 17:38   
OK, it looks like you have more than one problem here. That latest list of errors you posted is related to your database schema, it looks like your schema hasn't been upgraded to the latest version. :-(

Running setup.php again should prompt you to upgrade it.

Have you been running an SVN version of SiT at any time? If you have this might explain why you're having so many problems.
(0000996)
repostor   
2009-04-28 17:40   
This is what I can see on my screen; when I rerun the setup.php
==========
Support Incident Tracker - Installation & Setup

Connected to database - ok
Installed OK

Your database schema is v3.45
Checking installation...

SiT! v3.45 is installed and ready.
(0000997)
repostor   
2009-04-28 20:10   
I have not runned any SVN...

I will try to do a new install to a new "empty" database to see what happends.
(0000998)
repostor   
2009-04-28 22:03   
inboundmail.php (does not work)
auto.php works with new install

What I did was the following to solve the inbound email using imap:

mysqldump > dump.sql
drop database; create database; grant...
setup.php
mysql < dump.sql
(0000999)
ivan   
2009-04-29 10:34   
It sounds like setup didn't complete properly and create the whole schema. I'm very confused by that, I'm going to have to do some testing to try and understand it.
(0001966)
ivan   
2009-09-15 11:01   
This bug has been mentioned on the forum at http://sitracker.org/forum/viewtopic.php?f=4&t=1416896 [^]
(0001967)
repostor   
2009-09-15 12:46   
Thanks.
(0003285)
paulh   
2010-07-03 12:39   
I belive r6533 and b6a0130 fix the includes problem, http://sitracker.org/wiki/Inbound_Email [^] updated to include either adding #!/usr/bin/php to the beginning of the file or to call the script with "php inboundemail.php"

if not please reopen
(0003322)
ivan   
2010-07-18 15:05   
Released in v3.62