Permalink
Browse files

Fixed issue #2397 - Unable to process emails without From (but with S…

…ender) header.
  • Loading branch information...
martini committed Dec 11, 2018
1 parent 23059d7 commit 3fb7e5bee3f1982181efdb40feebfdcc7339da2a
Showing with 40 additions and 1 deletion.
  1. +1 −1 app/models/channel/email_parser.rb
  2. +39 −0 test/unit/email_process_test.rb
@@ -5,7 +5,7 @@
class Channel::EmailParser
EMAIL_REGEX = /.+@.+/
RECIPIENT_FIELDS = %w[to cc delivered-to x-original-to envelope-to].freeze
SENDER_FIELDS = %w[from reply-to return-path].freeze
SENDER_FIELDS = %w[from reply-to return-path sender].freeze

=begin
@@ -107,6 +107,45 @@ class EmailProcessTest < ActiveSupport::TestCase
],
},
},
{
data: "Sender: me_sender@example.com
To: customer@example.com
Subject: äöü some subject 3
Some Textäöü",
channel: {
trusted: false,
},
success: true,
result: {
0 => {
priority: '2 normal',
title: 'äöü some subject 3',
},
1 => {
body: 'Some Textäöü',
sender: 'Customer',
type: 'email',
internal: false,
},
},
verify: {
users: [
{
firstname: '',
lastname: '',
fullname: 'me@example.com',
email: 'me@example.com',
},
{
firstname: '',
lastname: '',
fullname: 'customer@example.com',
email: 'customer@example.com',
},
],
},
},
{
data: "From: me@example.com
To: customer@example.com

0 comments on commit 3fb7e5b

Please sign in to comment.