Inbound Email Problems

Discuss and get help installing, using and configuring SiT!

Inbound Email Problems

Postby camealy » Fri Aug 28, 2009 9:21 am

I just setup SiT! 3.50 and I must first say this is really awesome software!

For my question, I did some searching and found people having similar problems with inbound email in 3.45 but no one for 3.50. Basically I receive no mail and if I turn on Debug the log is full of the below message. (every minute because of the scheduled task)

C:\wamp\www\sit\auto.php ERROR: Application Notice SiT requires the php IMAP module to recieve incoming mail. If you really don't need this, you can set $CONFIG['enable_inbound_mail'] to false in C:\wamp\www\sit\lib\functions.inc.php at line 8256

However I created an IMAPTEST.php file in the same /sit folder and I can check the inbox through IMAP no problem there. So I have the extension and it appears to be functioning. It is almost like SiT! needed to see it during installation? I did activate the IMAP php extension in the ini after initially installing and configuration SiT!.

Any help would be greatly appreciated!

Thanks,

Kurt
camealy
SiT! Fan
SiT! Fan
 
Posts: 23
Joined: Fri Aug 28, 2009 9:15 am

Re: Inbound Email Problems

Postby ivanlucas » Fri Aug 28, 2009 9:29 am

Hi Kurt,

camealy wrote:I just setup SiT! 3.50 and I must first say this is really awesome software!


Thanks!

camealy wrote:C:\wamp\www\sit\auto.php ERROR: Application Notice SiT requires the php IMAP module to recieve incoming mail. If you really don't need this, you can set $CONFIG['enable_inbound_mail'] to false in C:\wamp\www\sit\lib\functions.inc.php at line 8256

However I created an IMAPTEST.php file in the same /sit folder and I can check the inbox through IMAP no problem there. So I have the extension and it appears to be functioning. It is almost like SiT! needed to see it during installation? I did activate the IMAP php extension in the ini after initially installing and configuration SiT!.


When you're running auto.php in your scheduler you are using the command line version of php, I think it's likely from what you've pasted that this copy of PHP is using a separate php.ini file to the one you've configured for the web. You can find out for sure if you run this php --ini from the command line. That should print which config file (or files) it's using.

Hope this helps, let us know if it doesn't. (or if it does! ;))

Cheers,

Ivan
Ivan Lucas, Project Lead, Support Incident Tracker (SiT!) GPL. ......... Chat live on irc, #sit on freenode.
Help free software: Make a donation to the SiT! project or Join the Free Software Foundation as an Associate Member.
User avatar
ivanlucas
SiT! Developer
SiT! Developer
 
Posts: 981
Joined: Sun Feb 01, 2009 9:49 pm
Location: Derbyshire, UK

Re: Inbound Email Problems

Postby camealy » Fri Aug 28, 2009 9:54 am

That solved the error message I was getting in the debug file. Now messages sent to the incoming mailbox still aren't getting picked up, but I have no error messages to help determine why? :mystery:

Thank you for the help,

Kurt
camealy
SiT! Fan
SiT! Fan
 
Posts: 23
Joined: Fri Aug 28, 2009 9:15 am

Re: Inbound Email Problems

Postby ivanlucas » Fri Aug 28, 2009 10:31 am

Hi Kurt,

Do you have IMAP incoming folder set to something? I wonder if that's the reason. We have had SiT collecting email from gmail before and it works fine, I can't find that I've stored the settings from last time I did it though unfortunately. :-(

If you leave IMAP incoming folder blank the default should be fine I think. I'm not sure of the syntax for using other folders, I'd have to check.

Ivan
Ivan Lucas, Project Lead, Support Incident Tracker (SiT!) GPL. ......... Chat live on irc, #sit on freenode.
Help free software: Make a donation to the SiT! project or Join the Free Software Foundation as an Associate Member.
User avatar
ivanlucas
SiT! Developer
SiT! Developer
 
Posts: 981
Joined: Sun Feb 01, 2009 9:49 pm
Location: Derbyshire, UK

Re: Inbound Email Problems

Postby ivanlucas » Fri Aug 28, 2009 10:34 am

I'm going to set this up myself, seems there are two of you trying to get SiT! set up with gmail and both having issues.

I'll let you know what I find.

Ivan
Ivan Lucas, Project Lead, Support Incident Tracker (SiT!) GPL. ......... Chat live on irc, #sit on freenode.
Help free software: Make a donation to the SiT! project or Join the Free Software Foundation as an Associate Member.
User avatar
ivanlucas
SiT! Developer
SiT! Developer
 
Posts: 981
Joined: Sun Feb 01, 2009 9:49 pm
Location: Derbyshire, UK

Re: Inbound Email Problems

Postby camealy » Fri Aug 28, 2009 10:52 am

I am actuallly running Exchange 07, but IMAP connection should be similar to GMAIL. I just don't have to use SSL and in my IMAPTEST.php I used the /notls switch.

Thanks!

Kurt
camealy
SiT! Fan
SiT! Fan
 
Posts: 23
Joined: Fri Aug 28, 2009 9:15 am

Re: Inbound Email Problems

Postby ivanlucas » Fri Aug 28, 2009 10:55 am

Hi,

Ah ok, I thought it was gmail for some reason.

You may also need the /novalidate-cert option, i've seen issues where it wouldn't connect without that even when not using an encrypted connection.

Also, can you check your Scheduler page to make sure that the scheduler action to collect mail is actually running, you can check the 'last run' column to see. There is a bug in 3.50rc1 that prevents this running in some circumstances.

Is there nothing in your debug log at all then?

Ivan
Ivan Lucas, Project Lead, Support Incident Tracker (SiT!) GPL. ......... Chat live on irc, #sit on freenode.
Help free software: Make a donation to the SiT! project or Join the Free Software Foundation as an Associate Member.
User avatar
ivanlucas
SiT! Developer
SiT! Developer
 
Posts: 981
Joined: Sun Feb 01, 2009 9:49 pm
Location: Derbyshire, UK

Re: Inbound Email Problems

Postby camealy » Fri Aug 28, 2009 11:08 am

What is wierd is I have the email related scheduler items Enabled, but the last run time when you view the list is "Never"??
camealy
SiT! Fan
SiT! Fan
 
Posts: 23
Joined: Fri Aug 28, 2009 9:15 am

Re: Inbound Email Problems

Postby camealy » Fri Aug 28, 2009 11:13 am

If I go the command line on the server and run the auto.php manually I get some errors below... none of them look related to email though...


C:\wamp\bin\php\php5.3.0>php.exe C:\wamp\www\sit\auto.php
PHP Notice: Undefined variable: _SESSION in C:\wamp\www\sit\lib\strings.inc.php
on line 19

Notice: Undefined variable: _SESSION in C:\wamp\www\sit\lib\strings.inc.php on l
ine 19
PHP Notice: Undefined variable: hmenu in C:\wamp\www\sit\lib\strings.inc.php on
line 36

Notice: Undefined variable: hmenu in C:\wamp\www\sit\lib\strings.inc.php on line
36
PHP Notice: Undefined offset: 10 in C:\wamp\www\sit\lib\strings.inc.php on line
45

Notice: Undefined offset: 10 in C:\wamp\www\sit\lib\strings.inc.php on line 45
PHP Notice: Undefined offset: 1030 in C:\wamp\www\sit\lib\strings.inc.php on li
ne 63

Notice: Undefined offset: 1030 in C:\wamp\www\sit\lib\strings.inc.php on line 63

PHP Notice: Undefined offset: 103010 in C:\wamp\www\sit\lib\strings.inc.php on
line 81

Notice: Undefined offset: 103010 in C:\wamp\www\sit\lib\strings.inc.php on line
81
PHP Notice: Undefined offset: 103090 in C:\wamp\www\sit\lib\strings.inc.php on
line 88

Notice: Undefined offset: 103090 in C:\wamp\www\sit\lib\strings.inc.php on line
88
PHP Notice: Undefined offset: 1040 in C:\wamp\www\sit\lib\strings.inc.php on li
ne 92

Notice: Undefined offset: 1040 in C:\wamp\www\sit\lib\strings.inc.php on line 92

PHP Notice: Undefined offset: 20 in C:\wamp\www\sit\lib\strings.inc.php on line
103

Notice: Undefined offset: 20 in C:\wamp\www\sit\lib\strings.inc.php on line 103
PHP Notice: Undefined offset: 2010 in C:\wamp\www\sit\lib\strings.inc.php on li
ne 111

Notice: Undefined offset: 2010 in C:\wamp\www\sit\lib\strings.inc.php on line 11
1
PHP Notice: Undefined offset: 2020 in C:\wamp\www\sit\lib\strings.inc.php on li
ne 115

Notice: Undefined offset: 2020 in C:\wamp\www\sit\lib\strings.inc.php on line 11
5
PHP Notice: Undefined offset: 2030 in C:\wamp\www\sit\lib\strings.inc.php on li
ne 119
camealy
SiT! Fan
SiT! Fan
 
Posts: 23
Joined: Fri Aug 28, 2009 9:15 am

Re: Inbound Email Problems

Postby ivanlucas » Fri Aug 28, 2009 12:28 pm

camealy wrote:If I go the command line on the server and run the auto.php manually I get some errors below... none of them look related to email though...


C:\wamp\bin\php\php5.3.0>php.exe C:\wamp\www\sit\auto.php
PHP Notice: Undefined variable: _SESSION in C:\wamp\www\sit\lib\strings.inc.php
on line 19


You need to edit your php.ini file and set error_reporting = E_ALL & ~E_NOTICE to remove these notices. None of them indicate a problem with email though.

Since you're seeing "last run" as Never it looks like you're hitting a known bug with 3.50rc1 that prevents these tasks from running. To fix it you could try patching your code or you can wait for 3.50 final to be released (soon now I hope).

if you want to try patching your code, first make a backup of your php files and then edit the file lib/functions.inc.php. Then find the schedule_actions_due function and replace it with the new code below.

Code: Select all
/**
* Finds out which scheduled tasks should be run right now
* @author Ivan Lucas, Paul Heaney
* @returns array
*/
function schedule_actions_due()
{
    global $now;
    global $dbScheduler;

    $actions = FALSE;
    $sql = "SELECT * FROM `{$dbScheduler}` WHERE status = 'enabled' AND type = 'interval' ";
    $sql .= "AND UNIX_TIMESTAMP(start) <= $now AND (UNIX_TIMESTAMP(end) >= $now OR UNIX_TIMESTAMP(end) = 0) ";
    $sql .= "AND IF(UNIX_TIMESTAMP(lastran) > 0, UNIX_TIMESTAMP(lastran) + `interval` <= $now, 1=1) ";
    $sql .= "AND IF(laststarted > 0, laststarted <= lastran, 1=1)";
    $result = mysql_query($sql);
    if (mysql_error()) trigger_error(mysql_error(),E_USER_WARNING);
    if (mysql_num_rows($result) > 0)
    {
        while ($action = mysql_fetch_object($result))
        {
            $actions[$action->action] = $actions->params;
        }
    }

    // Month
    $sql = "SELECT * FROM `{$dbScheduler}` WHERE status = 'enabled' AND type = 'date' ";
    $sql .= "AND UNIX_TIMESTAMP(start) <= $now AND (UNIX_TIMESTAMP(end) >= $now OR UNIX_TIMESTAMP(end) = 0) ";
    $sql .= "AND ((date_type = 'month' AND (DAYOFMONTH(CURDATE()) > date_offset OR (DAYOFMONTH(CURDATE()) = date_offset AND CURTIME() >= date_time)) ";
    $sql .= "AND DATE_FORMAT(CURDATE(), '%Y-%m') != DATE_FORMAT(lastran, '%Y-%m') ) ) ";  // not run this month
    $sql .= "AND IF(laststarted > 0, laststarted <= lastran, 1=1)";
    $result = mysql_query($sql);
    if (mysql_error()) trigger_error(mysql_error(),E_USER_WARNING);
    if (mysql_num_rows($result) > 0)
    {
        while ($action = mysql_fetch_object($result))
        {
            $actions[$action->action] = $actions->params;
        }
    }

    // Year TODO CHECK
    $sql = "SELECT * FROM `{$dbScheduler}` WHERE status = 'enabled' ";
    $sql .= "AND type = 'date' AND UNIX_TIMESTAMP(start) <= $now ";
    $sql .= "AND (UNIX_TIMESTAMP(end) >= $now OR UNIX_TIMESTAMP(end) = 0) ";
    $sql .= "AND ((date_type = 'year' AND (DAYOFYEAR(CURDATE()) > date_offset ";
    $sql .= "OR (DAYOFYEAR(CURDATE()) = date_offset AND CURTIME() >= date_time)) ";
    $sql .= "AND DATE_FORMAT(CURDATE(), '%Y') != DATE_FORMAT(lastran, '%Y') ) ) ";  // not run this year
    $sql .= "AND IF(laststarted > 0, laststarted <= lastran, 1=1)";

    $result = mysql_query($sql);
    if (mysql_error()) trigger_error(mysql_error(),E_USER_WARNING);
    if (mysql_num_rows($result) > 0)
    {
        while ($action = mysql_fetch_object($result))
        {
            $actions[$action->action] = $actions->params;
        }
    }

    return $actions;
}


Ivan
Ivan Lucas, Project Lead, Support Incident Tracker (SiT!) GPL. ......... Chat live on irc, #sit on freenode.
Help free software: Make a donation to the SiT! project or Join the Free Software Foundation as an Associate Member.
User avatar
ivanlucas
SiT! Developer
SiT! Developer
 
Posts: 981
Joined: Sun Feb 01, 2009 9:49 pm
Location: Derbyshire, UK

Next

Return to Installing, Configuring and Using SiT!

Who is online

Users browsing this forum: No registered users and 2 guests

cron