SiT! Bugs - SiT!
View Issue Details
0001014SiT!inbound emailpublic2009-11-26 19:242010-07-21 21:29
repostor 
paulh 
normalminoralways
closedfixed 
3.50 
3.62 LTS3.62 LTS 
0001014: inboundemail.php does not work
Hi,

I have created a .forward file like this:
daleto,|/srv/www/htdocs/sit-3.50/inboundemail.php

But it does not work.
I runned the script manually:
----------
# cat ~support/Maildir/new/1259261863.V807I14eb1cM654967.garwin|/srv/www/htdocs/sit-3.50/inboundemail.php
/srv/www/htdocs/sit-3.50/inboundemail.php: line 1: ?php: No such file or directory
/srv/www/htdocs/sit-3.50/inboundemail.php: line 2: //: is a directory
/srv/www/htdocs/sit-3.50/inboundemail.php: line 3: //: is a directory
/srv/www/htdocs/sit-3.50/inboundemail.php: line 4: syntax error near unexpected token `('
/srv/www/htdocs/sit-3.50/inboundemail.php: line 4: `// SiT (Support Incident Tracker) - Support call tracking system'
#
---------------
I added a "sheband"

#!/usr/bin/php
(at the top of this script)

but still a problem:

# cat ~support/Maildir/new/1259261863.V807I14eb1cM654967.garwin|/srv/www/htdocs/sit-3.50/inboundemail.php
PHP Fatal error: Call to undefined function return_bytes() in /srv/www/htdocs/sit-3.50/lib/base.inc.php on line 130
#

What is wrong here.?
No tags attached.
has duplicate 0001348closed paulh MTA problem solved 
Issue History
2009-11-26 19:24repostorNew Issue
2009-11-26 19:42paulhNote Added: 0002158
2009-11-26 20:04repostorNote Added: 0002159
2009-11-26 20:17repostorNote Added: 0002160
2009-11-26 20:21paulhNote Added: 0002161
2009-11-26 20:21paulhStatusnew => confirmed
2010-07-02 19:25paulhRelationship addedhas duplicate 0001348
2010-07-03 12:37paulhNote Added: 0003284
2010-07-03 12:37paulhAssigned To => paulh
2010-07-03 12:37paulhStatusconfirmed => resolved
2010-07-03 12:37paulhResolutionopen => fixed
2010-07-03 12:37paulhFixed in Version => Current SVN
2010-07-03 12:37paulhTarget Version => 3.62 LTS
2010-07-18 15:05ivanNote Added: 0003328
2010-07-18 15:05ivanStatusresolved => closed
2010-07-21 21:29ivanFixed in VersionCurrent SVN => 3.62 LTS

Notes
(0002158)
paulh   
2009-11-26 19:42   
Your MTA is trying to run inboundemail.php as a script though it doesn't know which interpreter to us so you either need to edit your .forward so it calls it with php e.g.

php /srv/www/htdocs/sit-3.50/inboundemail.php

Which may or may not work or guarenteed to work it to add a new line to start start of the file which is

#!/usr/bin/php

(or where ever PHP is installed), if your still having problems check that PHP is enabled for CLI (some distros have separate packages for this)
(0002159)
repostor   
2009-11-26 20:04   
Thanks Paulh,

The script does not know how to find routine:

Call to undefined function return_bytes() in /srv/www/htdocs/sit-3.50/lib/base.inc.php on line 130

maybee some of the "required" files are not loaded at the startup?

Do I need to add somthing to the /etc/php5/cli/php.ini file?

Or what is wrong.?

Please help
//tomas
(0002160)
repostor   
2009-11-26 20:17   
I will fallback to use the "polling" method instead again.
I just checked this if the problem with the function was solved in this release of sit.

Thanks in advance
(0002161)
paulh   
2009-11-26 20:21   
Hi Tomas,

Sorry missed that part of the initial report, its been a long week.

The problem seems to be caused by triggers.inc.php being included before functions.inc.php which declares this function, it seems triggers.inc.php somewhere down the line includes base.inc.php, seems this was added in 5466 (http://sitracker.svn.sourceforge.net/viewvc/sitracker?view=rev&revision=5466 [^]) Kieran can you shed any light on this?

Paul
(0003284)
paulh   
2010-07-03 12:37   
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"
(0003328)
ivan   
2010-07-18 15:05   
Released in v3.62