From 3fb7e5bee3f1982181efdb40feebfdcc7339da2a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 11 Dec 2018 09:36:16 +0100 Subject: [PATCH] Fixed issue #2397 - Unable to process emails without From (but with Sender) header. --- app/models/channel/email_parser.rb | 2 +- test/unit/email_process_test.rb | 39 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index e3cda61f4..be212453f 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.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 diff --git a/test/unit/email_process_test.rb b/test/unit/email_process_test.rb index 9d7f99f92..9dcbdd9ad 100644 --- a/test/unit/email_process_test.rb +++ b/test/unit/email_process_test.rb @@ -107,6 +107,45 @@ Some Textäöü", ], }, }, + { + 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