From b7bcc2aeff119ddaa7bff6c89e8f3443460b5459 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 9 Aug 2019 12:47:21 +0200 Subject: [PATCH] Improved subject in oversized mail template. --- app/models/channel/email_parser.rb | 2 +- app/views/mailer/email_oversized/en.txt.erb | 2 +- spec/lib/notification_factory/mailer_spec.rb | 2 +- spec/models/channel/email_parser_spec.rb | 4 ++-- test/integration/email_postmaster_to_sender.rb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/channel/email_parser.rb b/app/models/channel/email_parser.rb index f8c82c23d..1e56a8969 100644 --- a/app/models/channel/email_parser.rb +++ b/app/models/channel/email_parser.rb @@ -812,7 +812,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again end # Auto reply as the postmaster to oversized emails with: - # [ALERT] Message too large + # [undeliverable] Message too large def postmaster_response(channel, msg) begin reply_mail = compose_postmaster_reply(msg) diff --git a/app/views/mailer/email_oversized/en.txt.erb b/app/views/mailer/email_oversized/en.txt.erb index 24eea2f21..d46af0a47 100644 --- a/app/views/mailer/email_oversized/en.txt.erb +++ b/app/views/mailer/email_oversized/en.txt.erb @@ -1,4 +1,4 @@ -[ALERT] Message too large +[undeliverable] Message too large Dear #{mail.from_display_name}, Unfortunately your email titled "#{mail.subject}" could not be delivered to one or more recipients. diff --git a/spec/lib/notification_factory/mailer_spec.rb b/spec/lib/notification_factory/mailer_spec.rb index 5cc98a22a..ac77fc2f2 100644 --- a/spec/lib/notification_factory/mailer_spec.rb +++ b/spec/lib/notification_factory/mailer_spec.rb @@ -16,7 +16,7 @@ RSpec.describe NotificationFactory::Mailer do mail end - let(:en_expected_subject) { '[ALERT] Message too large' } + let(:en_expected_subject) { '[undeliverable] Message too large' } let(:en_expected_body) do <<~BODY diff --git a/spec/models/channel/email_parser_spec.rb b/spec/models/channel/email_parser_spec.rb index c15e6a021..2eaabd362 100644 --- a/spec/models/channel/email_parser_spec.rb +++ b/spec/models/channel/email_parser_spec.rb @@ -1014,7 +1014,7 @@ RSpec.describe Channel::EmailParser, type: :model do context 'for English locale (en)' do include_examples 'postmaster reply' do let(:locale) { 'en' } - let(:expected_subject) { '[ALERT] Message too large' } + let(:expected_subject) { '[undeliverable] Message too large' } let(:expected_body) do body = <<~BODY Dear Smith Sepp, @@ -1074,7 +1074,7 @@ RSpec.describe Channel::EmailParser, type: :model do context 'for English locale (en)' do include_examples 'postmaster reply' do let(:locale) { 'en' } - let(:expected_subject) { '[ALERT] Message too large' } + let(:expected_subject) { '[undeliverable] Message too large' } let(:expected_body) do body = <<~BODY Dear Smith Sepp, diff --git a/test/integration/email_postmaster_to_sender.rb b/test/integration/email_postmaster_to_sender.rb index 9b68c3f72..14521c2cf 100644 --- a/test/integration/email_postmaster_to_sender.rb +++ b/test/integration/email_postmaster_to_sender.rb @@ -129,7 +129,7 @@ Oversized Email Message Body #{'#' * 120_000} parser = Channel::EmailParser.new mail = parser.parse(msg) assert_equal(mail[:from_email], @email_address.email) - assert_equal(mail[:subject], '[ALERT] Message too large') + assert_equal(mail[:subject], '[undeliverable] Message too large') assert_equal("<#{@test_id}@zammad.test.com>", mail['references'], 'Reply\'s Referecnes header must match the send message ID')