Closed BorisNovg closed 2 years ago
Hi,
Please try to reproduce with no active plugin, especially "behaviors".
Regards
The error is reproduced on the test copy of the production server. No active plugins.
Error window on Home-Setup-Receivers-XXX@XXX.ru-Actions-Get email tickets now
(Debug mode enabled):
Problem message (format of message is plain text):
Subject: Re: [GLPI #0060738] test only
Comment LAST
[19-10-2021 15:33] glpi glpi
Comment 3
[19-10-2021 15:32] t.t.test
Comment 2
[19-10-2021 15:30] glpi glpi
Comment 1
Automatically generated by GLPI
=_=_=_= To answer by email, write under this line =_=_=_=
EML of message:
Received: from xxx.ru (10.10.1.72) by xxx.ru
(10.10.1.72) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.2176.2 via Mailbox
Transport; Tue, 19 Oct 2021 15:34:11 +0300
Received: from xxx.ru (10.10.1.72) by xxx.ru
(10.10.1.72) with Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.2176.2; Tue, 19
Oct 2021 15:34:11 +0300
Received: from xxx.ru ([10.10.1.72]) by xxx.ru
([10.10.1.72]) with mapi id 15.01.2176.009; Tue, 19 Oct 2021 15:34:11 +0300
From: xxx2 <xxx2@xxx.ru>
To: =?koi8-r?B?88zV1sLBINDPxMTF0tbLyQ==?= <xxx@xxx.ru>
Subject: Re: [GLPI #0060738] test only
Thread-Topic: [GLPI #0060738] test only
Thread-Index: AdfE6ef/aeKfL6aVQPWz8p1zRX3loA==
Date: Tue, 19 Oct 2021 15:34:11 +0300
Message-ID: <ad5d5792c66349e49ac339476a8a35ff@novreg.ru>
Accept-Language: en-US, ru-RU
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 04
X-MS-Exchange-Organization-AuthSource: xxx.ru
X-MS-Has-Attach:
X-MS-Exchange-Organization-Network-Message-Id:
8ff4b964-d172-49ad-71ac-08d992e406c3
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator:
X-MS-Exchange-Organization-RecordReviewCfmType: 0
Content-Type: text/plain; charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Comment LAST
[19-10-2021 15:33] glpi glpi
Comment 3
[19-10-2021 15:32] t.t.test
Comment 2
[19-10-2021 15:30] glpi glpi
Comment 1
Automatically generated by GLPI
=3D_=3D_=3D_=3D To answer by email, write under this line =3D_=3D_=3D_=3D=20
Additionally, if I add a solution to the ticket, after which I transfer the status of the ticket to Closed,
the letter is immediately processed without error:
A new ticket is created based on a letter with a comment:
and linked with previous ticket:
Due to the lack of discussion, I will add a debugging attempt. I enter commands to output the $input variable and backtrace: https://github.com/glpi-project/glpi/blob/e5e117787d28bf0e58a55948ac65d299f6ca7feb/inc/itilfollowup.class.php#L399-L401 ...... Toolbox::logError($input); Toolbox::backtrace();
php-errors.log: (real internet addresses have been replaced with xxx)
[2021-10-20 11:43:32] glpiphplog.ERROR: ITILFollowup::prepareInputForAdd() in /usr/share/glpi/inc/itilfollowup.class.php line 401
Array
(
[_blacklisted] =>
[_mailgate] => 1
[_uid] => 3
[_filename] => Array
(
)
[_tag] =>
[_users_id_requester] => 127
[_users_id_requester_notif] => Array
(
[use_notification] => Array
(
[0] => 1
)
)
[users_id] => 127
[_auto_import] => 1
[_do_not_check_users_id] => 1
[_message] => Laminas\Mail\Storage\Message Object
(
[flags:protected] => Array
(
[\Seen] => \Seen
)
[headers:protected] => Laminas\Mail\Headers Object
(
[headerLocator:Laminas\Mail\Headers:private] => Laminas\Mail\Header\HeaderLocator Object
(
[plugins:Laminas\Mail\Header\HeaderLocator:private] => Array
(
[bcc] => Laminas\Mail\Header\Bcc
[cc] => Laminas\Mail\Header\Cc
[contentdisposition] => Laminas\Mail\Header\ContentDisposition
[content_disposition] => Laminas\Mail\Header\ContentDisposition
[content-disposition] => Laminas\Mail\Header\ContentDisposition
[contenttype] => Laminas\Mail\Header\ContentType
[content_type] => Laminas\Mail\Header\ContentType
[content-type] => Laminas\Mail\Header\ContentType
[contenttransferencoding] => Laminas\Mail\Header\ContentTransferEncoding
[content_transfer_encoding] => Laminas\Mail\Header\ContentTransferEncoding
[content-transfer-encoding] => Laminas\Mail\Header\ContentTransferEncoding
[date] => Laminas\Mail\Header\Date
[from] => Laminas\Mail\Header\From
[in-reply-to] => Laminas\Mail\Header\InReplyTo
[message-id] => Laminas\Mail\Header\MessageId
[mimeversion] => Laminas\Mail\Header\MimeVersion
[mime_version] => Laminas\Mail\Header\MimeVersion
[mime-version] => Laminas\Mail\Header\MimeVersion
[received] => Laminas\Mail\Header\Received
[references] => Laminas\Mail\Header\References
[replyto] => Laminas\Mail\Header\ReplyTo
[reply_to] => Laminas\Mail\Header\ReplyTo
[reply-to] => Laminas\Mail\Header\ReplyTo
[sender] => Laminas\Mail\Header\Sender
[subject] => Laminas\Mail\Header\Subject
[to] => Laminas\Mail\Header\To
)
)
[pluginClassLoader:protected] =>
[headersKeys:protected] => Array
(
[0] => mimeversion
[1] => received
[2] => received
[3] => received
[4] => from
[5] => to
[6] => subject
[7] => threadtopic
[8] => threadindex
[9] => xmsexchangemessagesentrepresentingtype
[10] => date
[11] => messageid
[12] => acceptlanguage
[13] => contentlanguage
[14] => xmsexchangeorganizationauthas
[15] => xmsexchangeorganizationauthmechanism
[16] => xmsexchangeorganizationauthsource
[17] => xmshasattach
[18] => xmsexchangeorganizationnetworkmessageid
[19] => xmsexchangeorganizationscl
[20] => xmstnefcorrelator
[21] => xmsexchangeorganizationrecordreviewcfmtype
[22] => contenttype
[23] => contenttransferencoding
)
[headers:protected] => Array
(
[0] => Laminas\Mail\Header\MimeVersion Object
(
[version:protected] => 1.0
)
[1] => Laminas\Mail\Header\Received Object
(
[value:protected] => from xxx.ru (10.10.1.72) by xxx.ru (10.10.1.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.2176.2 via Mailbox Transport; Tue, 19 Oct 2021 12:37:11 +0300
)
[2] => Laminas\Mail\Header\Received Object
(
[value:protected] => from xxx.ru (10.10.1.72) by xxx.ru (10.10.1.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.2176.2; Tue, 19 Oct 2021 12:37:11 +0300
)
[3] => Laminas\Mail\Header\Received Object
(
[value:protected] => from xxx.ru ([10.10.1.72]) by xxx.ru ([10.10.1.72]) with mapi id 15.01.2176.009; Tue, 19 Oct 2021 12:37:11 +0300
)
[4] => Laminas\Mail\Header\From Object
(
[fieldName:protected] => From
[addressList:protected] => Laminas\Mail\AddressList Object
(
[addresses:protected] => Array
(
[xxx2@xxx.ru] => Laminas\Mail\Address Object
(
[comment:protected] =>
[email:protected] => xxx2@xxx.ru
[name:protected] => xxx
)
)
)
[encoding:protected] => ASCII
)
[5] => Laminas\Mail\Header\To Object
(
[fieldName:protected] => To
[addressList:protected] => Laminas\Mail\AddressList Object
(
[addresses:protected] => Array
(
[xxx@xxx.ru] => Laminas\Mail\Address Object
(
[comment:protected] =>
[email:protected] => xxx@xxx.ru
[name:protected] => Служба поддержки
)
)
)
[encoding:protected] => UTF-8
)
[6] => Laminas\Mail\Header\Subject Object
(
[subject:protected] => Re: [GLPI #0060738] test only
[encoding:protected] =>
)
[7] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => Thread-Topic
[fieldValue:protected] => [GLPI #0060738] test only
[encoding:protected] => ASCII
)
[8] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => Thread-Index
[fieldValue:protected] => AdfFhxB50MN4UsuKRjOtXA8gWpgZ3g==
[encoding:protected] => ASCII
)
[9] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => X-MS-Exchange-MessageSentRepresentingType
[fieldValue:protected] => 1
[encoding:protected] => ASCII
)
[10] => Laminas\Mail\Header\Date Object
(
[value:protected] => Tue, 19 Oct 2021 12:37:11 +0300
)
[11] => Laminas\Mail\Header\MessageId Object
(
[messageId:protected] => <ad5d5792c66349e49ac339476a8a35ff@xxx.ru>
)
[12] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => Accept-Language
[fieldValue:protected] => en-US, ru-RU
[encoding:protected] => ASCII
)
[13] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => Content-Language
[fieldValue:protected] => en-US
[encoding:protected] => ASCII
)
[14] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => X-MS-Exchange-Organization-AuthAs
[fieldValue:protected] => Internal
[encoding:protected] => ASCII
)
[15] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => X-MS-Exchange-Organization-AuthMechanism
[fieldValue:protected] => 04
[encoding:protected] => ASCII
)
[16] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => X-MS-Exchange-Organization-AuthSource
[fieldValue:protected] => xxx.ru
[encoding:protected] => ASCII
)
[17] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => X-MS-Has-Attach
[fieldValue:protected] =>
[encoding:protected] => ASCII
)
[18] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => X-MS-Exchange-Organization-Network-Message-Id
[fieldValue:protected] => 8ff4b964-d172-49ad-71ac-08d992e406c3
[encoding:protected] => ASCII
)
[19] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => X-MS-Exchange-Organization-SCL
[fieldValue:protected] => -1
[encoding:protected] => ASCII
)
[20] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => X-MS-TNEF-Correlator
[fieldValue:protected] =>
[encoding:protected] => ASCII
)
[21] => Laminas\Mail\Header\GenericHeader Object
(
[fieldName:protected] => X-MS-Exchange-Organization-RecordReviewCfmType
[fieldValue:protected] => 0
[encoding:protected] => ASCII
)
[22] => Laminas\Mail\Header\ContentType Object
(
[type:protected] => text/plain
[encoding:protected] => ASCII
[parameters:protected] => Array
(
[charset] => koi8-r
)
)
[23] => Laminas\Mail\Header\ContentTransferEncoding Object
(
[transferEncoding:protected] => quoted-printable
[parameters:protected] => Array
(
)
)
)
[encoding:protected] => ASCII
)
[content:protected] =>
[topLines:protected] =>
[parts:protected] => Array
(
)
[countParts:protected] =>
[iterationPos:protected] => 1
[mail:protected] => Laminas\Mail\Storage\Imap Object
(
[protocol:protected] => Laminas\Mail\Protocol\Imap Object
(
[socket:protected] => Resource id #13
[tagCount:protected] => 7
[novalidatecert:protected] => 1
)
[currentFolder:protected] => Test
[delimiter:protected] =>
[has:protected] => Array
(
[uniqueid] => 1
[delete] =>
[create] =>
[top] =>
[fetchPart] => 1
[flags] => 1
)
[iterationPos:protected] => 2
[iterationMax:protected] => 1
[messageClass:protected] => Laminas\Mail\Storage\Message
)
[messageNum:protected] => 1
)
[content] =>
[_supplier_email] =>
[name] => Re: [GLPI #0060738] test only
[add_reopen] => 1
[requesttypes_id] => 2
[itemtype] => Ticket
[items_id] => 60738
[_no_history] =>
[_job] => Ticket Object
(
[dohistory] => 1
[userlinkclass] => Ticket_User
[grouplinkclass] => Group_Ticket
[supplierlinkclass] => Supplier_Ticket
[userentity_oncreate:protected] => 1
[hardwaredatas] => Array
(
)
[computerfound] => 0
[users:protected] => Array
(
[1] => Array
(
[0] => Array
(
[id] => 125674
[tickets_id] => 60738
[users_id] => 127
[type] => 1
[use_notification] => 1
[alternative_email] =>
)
)
[2] => Array
(
[0] => Array
(
[id] => 125675
[tickets_id] => 60738
[users_id] => 2
[type] => 2
[use_notification] => 1
[alternative_email] =>
)
)
)
[groups:protected] => Array
(
)
[suppliers:protected] => Array
(
)
[notificationqueueonaction] => 1
[fields] => Array
(
[id] => 60738
[entities_id] => 2
[name] => test only
[date] => 2021-10-19 15:29:29
[closedate] =>
[solvedate] =>
[date_mod] => 2021-10-20 10:47:21
[users_id_lastupdater] => 2
[status] => 2
[users_id_recipient] => 127
[requesttypes_id] => 2
[content] => <div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: #000000; font-family: Calibri,Helvetica,sans-serif;"><p>test only</p></div>
[urgency] => 3
[impact] => 3
[priority] => 3
[itilcategories_id] => 115
[type] => 2
[global_validation] => 1
[slas_id_ttr] => 7
[slas_id_tto] => 0
[slalevels_id_ttr] => 7
[time_to_resolve] => 2021-10-21 15:22:22
[time_to_own] =>
[begin_waiting_date] =>
[sla_waiting_duration] => 13973
[ola_waiting_duration] => 0
[olas_id_tto] => 0
[olas_id_ttr] => 0
[olalevels_id_ttr] => 0
[ola_ttr_begin_date] =>
[internal_time_to_resolve] =>
[internal_time_to_own] =>
[waiting_duration] => 13973
[close_delay_stat] => 0
[solve_delay_stat] => 0
[takeintoaccount_delay_stat] => 35
[actiontime] => 0
[is_deleted] => 0
[locations_id] => 0
[validation_percent] => 0
[date_creation] => 2021-10-19 15:29:29
)
[history_blacklist] => Array
(
)
[auto_message_on_action] => 1
[no_form_page] =>
[additional_fields_for_dictionnary] => Array
(
)
[fkfield:protected] =>
[searchopt:protected] =>
[taborientation] => vertical
[get_item_to_display_tab] => 1
[usenotepad:protected] =>
[type:protected] => -1
[displaylist:protected] => 1
[showdebug] =>
)
[_close] => 0
[is_private] => 0
)
{"user":"2@xxx.ru"}
2021-10-20 11:43:32 [2@xxx.ru]
Backtrace :
inc/itilfollowup.class.php:401 Toolbox::backtrace()
inc/commondbtm.class.php:1129 ITILFollowup->prepareInputForAdd()
inc/mailcollector.class.php:889 CommonDBTM->add()
front/mailcollector.form.php:88 MailCollector->collect()
Backtrace: inc/itilfollowup.class.php:401 Toolbox::backtrace() https://github.com/glpi-project/glpi/blob/e5e117787d28bf0e58a55948ac65d299f6ca7feb/inc/itilfollowup.class.php#L399-L401
inc/commondbtm.class.php:1129 ITILFollowup->prepareInputForAdd() https://github.com/glpi-project/glpi/blob/e5e117787d28bf0e58a55948ac65d299f6ca7feb/inc/commondbtm.class.php#L1118-L1130
inc/mailcollector.class.php:889 CommonDBTM->add() https://github.com/glpi-project/glpi/blob/e5e117787d28bf0e58a55948ac65d299f6ca7feb/inc/mailcollector.class.php#L879-L895
front/mailcollector.form.php:88 MailCollector->collect() https://github.com/glpi-project/glpi/blob/e5e117787d28bf0e58a55948ac65d299f6ca7feb/front/mailcollector.form.php#L86-L88
Maybe this will help you find the source of the problem.
Hi,
Unless I am wrong, this is not a bug.
When the email is parsed, we try to detect these lines:
=-=-=-= To answer by email, write above this line =-=-=-=
(called HEADER),=_=_=_= To answer by email, write under this line =_=_=_=
(called FOOTER).I guess you are in case 3, so as content is only whitespace after the FOOTER line, it considers that content is empty, and it rejects the solution.
Regards
See https://github.com/glpi-project/glpi/blob/9.5/bugfixes/inc/mailcollector.class.php#L1117 for related code.
Judging by the contents of the content field, this problematic message is treated as empty.
[content] =>
[_supplier_email] =>
[name] => Re: [GLPI #0060738] test only
[add_reopen] => 1
A separate oddity is that when creating a new ticket, the text in the Description field is present!
As an addition, I sent an empty message and the reaction was exactly the same: If you reject the solution, you must specify a reason.
Accordingly, the problem narrows down to the reaction to an empty message - such a message is not deleted and hangs in the Inbox!
This is wrong.
Accordingly, the problem narrows down to the reaction to an empty message - such a message is not deleted and hangs in the Inbox!
You are right, it may cause issues. When a ticket or a followup add
operation returns a falsy result, which happens in this case, it is considered as an error (NotImportedEmail::FAILED_OPERATION
), but email is not moved into the refused
folder. It is not so easy, right now to know why the add
operation failed.
In the collector cofiguration, you can use the Collect only unread mail
configuration. It should prevent this kind of message to be fetched each time.
Specified the problem more precisely:
An empty message sent by e-mail as a comment to the ticket creates an error in the mail receiver, is not deleted and hangs in the Inbox, there is an error "If you reject the solution, you must specify a reason" in the log even if the ticket does not have a solution yet.
If a message is received by a mail receiver (not via the GLPI web interface) with empty content (or with content in which there is no informative part left after the quote has been deleted):
if the ticket does not yet contain a solution, the content should be replaced with the text "(Empty message)".
if the ticket already contains a solution (but has not yet been closed), the content should be replaced with the text "(If you reject the solution, you must specify a reason)", while the ticket status should be kept unchanged (Solved) and the last solution should not be rejected.
The goal is to inform the user by e-mail the result of his request (now in the current version of GLPI the user who sent the request by e-mail does not receive any feedback by e-mail or in the GLPI web interface, the information is recorded in the log where only the administrator can see it, but not the end user).
I dont get it.
We have fully working 9.4 where email followup works. When we upgrade to 9.5 emial followups stops to work and emails are stuck in inbox
Created emails are same, we reply in same way - it just down work. Even "=-=-=-= To answer by email, write above this line =-=-=-=" exists in the reply.
Mailgate response: If you reject the solution, you must specify a reason
Created emails are same, we reply in same way - it just down work. Even "=-=-=-= To answer by email, write above this line =-=-=-=" exists in the reply. Mailgate response: If you reject the solution, you must specify a reason
k0xak, I think the reason for the "If you reject the solution, you must specify a reason"
response is that the message handler concludes that a BLANK letter has arrived at glpi. And this conclusion is made due to the fact that the letter does not contain the line "=_=_=_= To answer by email, write under this line =_=_=_="
, meaning the end of the quote. The response "If you reject the solution, you must specify a reason"
is output precisely as a reaction to an EMPTY incoming message.
Tip - Look for the reason why "=-=-=-= To answer by email, write above this line =-=-=-="
is present in messages and "=_=_=_= To answer by email, write under this line =_=_=_="
is missing. Most likely, you should pay the attention of users so that when responding to a message from glpi, they do not delete the "unnecessary" message tail along with the line "=_=_=_= To answer by email, write under this line =_=_=_="
. Alternatively, they can remove the "unnecessary" tail, but strictly ensure that the string "=_=_=_= To answer by email, write under this line =_=_=_="
remains in the response (not deleted by the user).
Related to #10792 Proposed fix for GLPI 10 (done for next major version because it is a change in expected behavior): #10797
Fix #10797 was merged and will be included with 10.1.0.
Code of Conduct
Is there an existing issue for this?
Version
9.5.6
Bug description
The user to whom we provide support services responds to a comment on the ticket by e-mail, however, the comment does not appear in the web interface of our GLPI-based support system, and the letter remains indefinitely in the Inbox of the mail receiver.
The analysis of the letter shows that the user just accidentally deleted the line
=-=-=-= To answer by email, write above this line =-=-=-=
, habitually removing unnecessary linesFrom:
Sent:
To:
Subject:
from the header of the letter.The problem is not reproduced if the user writes the FIRST comment to the ticket (in this case, a letter with a comment without the line
=-=-=-= To answer by email, write above this line =-=-=-=
is processed in a completely normal way and appears in the web interface of our GLPI-based support system).But if there are already at least 3 comments in the dialog with the user, an error occurs.
In addition, a very strange error is recorded in the log, clearly indicating an incorrectly compiled algorithm for processing mail messages: "If you reject the solution, you must specify a reason". Please note that the ticket is not closed at this moment, and the error message indicates that the algorithm got into the part of the code that gives an error with this text, obviously by accident.
Relevant log output
Page URL
No response
Steps To reproduce
=-=-=-= To answer by email, write above this line =-=-=-=
when writing a response.Your GLPI setup information
Anything else?
No response