You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2013-11-08 08:14:08

igortru
Member
Registered: 2013-11-08
Posts: 3

glpi lost mail from users

Hi.

Sorry for my english )
I have problem, glpi lost some mail from users, no ticket create.
i switch on debug mode and view errors on sql-errors.log

2013-11-08 11:13
*** MySQL query error :
***
SQL: SELECT `users_id` as id
                FROM `glpi_useremails`
                LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_useremails`.`users_id`)
                WHERE `glpi_useremails`.`email` = \'\'helpdesk@domain.ru\'\'
                ORDER BY `glpi_users`.`is_active`  DESC
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
 near 'helpdesk@domain.ru''
                ORDER BY `glpi_users`.`is_active`  DESC' at line 4
Backtrace :
/usr/share/glpi/inc/user.class.php :2786           DBmysql->query()
/usr/share/glpi/inc/mailcollector.class.php :607           User::getOrImportByEmail()
/usr/share/glpi/inc/mailcollector.class.php :417           MailCollector->buildTicket()
/usr/share/glpi/front/mailcollector.form.php :72           MailCollector->collect()
/usr/share/glpi/front/mailcollector.form.php

i find code in user.class.php and insert debug code

   static function getOrImportByEmail($email='') {
      global $DB, $CFG_GLPI;

      $query = "SELECT `users_id` as id
                FROM `glpi_useremails`
                LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_useremails`.`users_id`)
                WHERE `glpi_useremails`.`email` = '$email'
                ORDER BY `glpi_users`.`is_active`  DESC";
[b]    $new_file=fopen("/var/log/glpi/test.log","a+"); 
    fwrite($new_file, "\n".$email."\n");
    fwrite($new_file, $query);
    fclose($new_file);
[/b]      $result = $DB->query($query);

in test.log i see normaly user e-mail  (not helpdesk@domain.ru)

SELECT `users_id` as id
                FROM `glpi_useremails`
                LEFT JOIN `glpi_users` ON (`glpi_users`.`id` = `glpi_useremails`.`users_id`)
                WHERE `glpi_useremails`.`email` = 'user@domain.ru'
                ORDER BY `glpi_users`.`is_active`  DESC

I don't know as to solve a problem....
glpi sync ldap, glpi get e-mail in pop3 account.
thx
Igor, Russia

Last edited by igortru (2013-11-08 08:14:59)

Offline

#2 2013-11-08 09:39:32

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,273

Re: glpi lost mail from users

What is the From in the header of the mail ?
Version of GLPI used ?


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#3 2013-11-08 09:46:48

igortru
Member
Registered: 2013-11-08
Posts: 3

Re: glpi lost mail from users

yllen wrote:

What is the From in the header of the mail ?
Version of GLPI used ?

thx for reply,
I had a few times for a solution,  i find problem - some mail client not insert Message-ID in message header.
glpi drop this mail.
how solve this problem?

Offline

#4 2013-11-08 10:11:18

igortru
Member
Registered: 2013-11-08
Posts: 3

Re: glpi lost mail from users

i solve problem, but unknown correct is

in mailcollector.class.php
in line 933

        // secu on subject setting
         if (!isset($mail_header->subject)) {
            $mail_header->subject = '';
         }

add

         if (!isset($mail_header->message_id)) {
            $mail_header->message_id = '';
         }

Offline

Board footer

Powered by FluxBB