Carriage Return char when ticket is created from email

Moderator: crythias

Locked
akkaOctogon
Znuny newbie
Posts: 6
Joined: 08 Jan 2014, 11:17
Znuny Version: 3.3.3
Real Name: Stefan Gohlke
Company: AKKA Octogon

Carriage Return char when ticket is created from email

Post by akkaOctogon »

Hello,

we are using OTRS 3.3.5 on a Windows 2008 R2 Server (64bit).

Most of the tickets that are created from an email work fine. In some cases I noticed a Carriage Return character inside a "String". I had a look at the OTRS log file "otrs.log" which told me something went wrong.

Example 1:

Code: Select all

[Tue Mar 11 10:40:53 2014][Error][Kernel::System::Main::FileWrite][485] Can't write 'C:/otrs/OTRS/var/article/2014/03/11/340/A_very_long_filename_created_from_an_embedded_mail_message CR
_and_it_goes_on CR
.eml.content_type': Invalid argument CR LF
"CR" and "LF" are Carriage Return and Line Feed special characters. The last line seems to be correct (one CR and one LF), but the CR in the first two lines should not be there.

Example 2

Code: Select all

[Tue Mar 11 10:30:12 2014][Notice][Kernel::System::PostMaster::Filter::MatchDBSource::Run] Filter: 'PriorityFilter' Set param 'X-OTRS-Priority' to 'High CR
' 

...

[Tue Mar 11 10:30:12 2014][Error][Kernel::System::Priority::PriorityLookup][363] No Priority for High CR
 found! CR LF
[Tue Mar 11 10:30:12 2014][Error][Kernel::System::PostMaster::NewTicket::Run][86] Priority High CR
 does not exist, falling back to High! CR LF
Normally I get a notice like " Filter: 'PriorityFilter' Set param 'X-OTRS-Priority' to 'High' " but in this case there seems to be a CR character at the end of the string. This causes some problems because "High CR" is no valid priority.


I had a look at the plain text of one of these emails and it seems there is an embedded message at the end of the mail that is not shown in AgentTicketZoom. It has the content type "message/rfc822" and if I'm correct this message should be stored as the above mentioned .eml file. But I don't have any clue where theses CR chars (that seem to cause "Can't write" errors) came from.

Does someone have an idea where to look or what to try in order to solve this problem? For the embedded messages it would be nice if they are shown as text within the ticket but I'm not sure if OTRS can do that.


Sincerly yours,
akkaOctogon
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Carriage Return char when ticket is created from email

Post by reneeb »

Can you attach an original mail (with testdata instead of your customers data)? Without that it's hard to reproduce the error...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
akkaOctogon
Znuny newbie
Posts: 6
Joined: 08 Jan 2014, 11:17
Znuny Version: 3.3.3
Real Name: Stefan Gohlke
Company: AKKA Octogon

Re: Carriage Return char when ticket is created from email

Post by akkaOctogon »

Hello reneeb,

how/in which format shall I attach the original e-mail? As text file? As html-file? The saved "plain.txt" file?

Example 1:

Code: Select all

Dear Colleagues,

Please be informed of the following task request:

During the discussion of ... .
This task shall clarify this with ... 

Description:

A description what to do

A friendly note



For condition (refer to Table 1 in Appendix C):
#normal,
#abnormal,
#emergency,
#switching,
#power supply removal,
.. .

Details:

Priority: High
dynField_A1: 1234
dynField_A2: proc
dynField_A3: act
dynField_A4: H. Meier

Deliverable:

the product to deliver

Target date: 30.01.2014
 

Confirmation required within 24h

Thanks in advance,
Best Regards,

A Customer
Instead of # there are strange signs like "􀂃 " (which does not seem to be a valid Unicode character).


Example 2:

Code: Select all

Dear Colleagues,

Please be informed of the following task request:

See attachment

Description:

Please answer e-mails from 1 to 14

Details:

Priority: High
dynField_A1: 1234
dynField_A2: proc
dynField_A3: act
dynField_A4: H. Meier
dynField_A5: middle

Deliverable:

E-Mail

Target date: 24.01.2014
 

Confirmation required within 24h

Thanks in advance,
Best Regards,

A Customer

---

The first part is what is in the OTRS ticket, the second part from "Content-Type: message/rfc822" is not shown in ticket but in plain.txt file and in orginial email

---

----- Message from "Mail, Ees" <ees.mail@email.com> on Thu, 16 Jan 2014 01:12:26 +0100 -----
To:	"customer 1" <customer1@mail.com>, "customer2" <customer2@mail.com>
cc:	"customer 3" <customer3@mail.com>
Subject:	Uploading documents
--------------------------------
Please, do not reply this email.
--------------------------------

Uploading 7 files a1 to a7.  Can be found in the zip file in the abc folder

------------------
This alert is send to: customer1, customer2
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Carriage Return char when ticket is created from email

Post by reneeb »

Activate the Sysconfig option "PlainView", open a ticket created with such an email, klick plain view in the article menu, save the file and attach it here in the forum.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
akkaOctogon
Znuny newbie
Posts: 6
Joined: 08 Jan 2014, 11:17
Znuny Version: 3.3.3
Real Name: Stefan Gohlke
Company: AKKA Octogon

Re: Carriage Return char when ticket is created from email

Post by akkaOctogon »

Hello,

sorry, some parts of the email are non-public/private/company classified information. It seems to be to much work to edit this message and remove every bit of information to have a test email.

I had a talk with our client. He told me that their customers seem to use some Microsoft Exchange Server and file sharing component and the embedded part seems to be an auto-generated message from the file sharing component. I don't know what the customer has been doing, perhaps dragging and droppping things arround where they should not be.
Our client also told me the original email had a ".msg" attachment (an Outlook message if I'm corret). This file seems to be stored as ".eml" file (by OTRS), I don't know if that would cause any problems for our client (I'll have a look at that later).

I made a slight modification (copying it to Custom folder and adding it to our personal developer documentation) in "Kernel/System/Main.pm" in "sub FileWrite", line 467. I added the following code to remove the carriage return character from "Location", told our client to send the problematic emails again and everything was okay this time. The second message was stored as .eml file and I could open it with my Lotus Notes Client.

Code: Select all

# remove carriage return characters from filename
$Param{Location} =~ s/[\r]//g;
Perhaps it might be a good idea to extend the cleanup part in Main.pm, line 457

Code: Select all

# filename clean up
$Param{Location} =~ s/\/\//\//g;
though I'm not sure what it does as I'm new to PERL and my RegEx skills are just very basic.


Sincerly yours,
akkaOctogon

PS:
I'm not sure but viewtopic.php?f=35&t=23526 might have/be the same problem, it looks quite similar.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Carriage Return char when ticket is created from email

Post by reneeb »

Please report is as a bug at http://bugs.otrs.org
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Locked