Improved error handling.

This commit is contained in:
Martin Edenhofer 2013-09-25 15:58:25 +02:00
parent 3982a3dadb
commit 92f0045bfc
2 changed files with 22 additions and 3 deletions

View file

@ -66,7 +66,7 @@ class Channel::EmailParser
# set all headers # set all headers
mail.header.fields.each { |field| mail.header.fields.each { |field|
data[field.name.downcase.to_sym] = Encode.conv( 'utf8', field.to_s ) data[field.name.to_s.downcase.to_sym] = Encode.conv( 'utf8', field.to_s )
} }
# set extra headers # set extra headers

View file

@ -47,7 +47,7 @@ Some Text',
To: customer@example.com To: customer@example.com
Subject: äöü some subject Subject: äöü some subject
Some Textäöü".encode("ISO-8859-1"), Some Textäöü",
:success => true, :success => true,
:result => { :result => {
0 => { 0 => {
@ -61,6 +61,25 @@ Some Textäöü".encode("ISO-8859-1"),
}, },
}, },
}, },
{
:data => "From: me@example.com
To: customer@example.com
Subject: äöü some subject
Some Textäöü".encode("ISO-8859-1"),
:success => true,
:result => {
0 => {
:ticket_priority => '2 normal',
:title => '', # should be äöü some subject, but can not be parsed from mime tools
},
1 => {
:body => 'Some Textäöü',
:ticket_article_sender => 'Customer',
:ticket_article_type => 'email',
},
},
},
] ]
files.each { |file| files.each { |file|
@ -90,4 +109,4 @@ Some Textäöü".encode("ISO-8859-1"),
end end
} }
end end
end end