Improved subject in oversized mail template.

This commit is contained in:
Martin Edenhofer 2019-08-09 12:47:21 +02:00
parent 77d0b2d5c9
commit b7bcc2aeff
5 changed files with 6 additions and 6 deletions

View file

@ -812,7 +812,7 @@ process unprocessable_mails (tmp/unprocessable_mail/*.eml) again
end end
# Auto reply as the postmaster to oversized emails with: # Auto reply as the postmaster to oversized emails with:
# [ALERT] Message too large # [undeliverable] Message too large
def postmaster_response(channel, msg) def postmaster_response(channel, msg)
begin begin
reply_mail = compose_postmaster_reply(msg) reply_mail = compose_postmaster_reply(msg)

View file

@ -1,4 +1,4 @@
[ALERT] Message too large [undeliverable] Message too large
Dear #{mail.from_display_name}, Dear #{mail.from_display_name},
Unfortunately your email titled "#{mail.subject}" could not be delivered to one or more recipients. Unfortunately your email titled "#{mail.subject}" could not be delivered to one or more recipients.

View file

@ -16,7 +16,7 @@ RSpec.describe NotificationFactory::Mailer do
mail mail
end end
let(:en_expected_subject) { '[ALERT] Message too large' } let(:en_expected_subject) { '[undeliverable] Message too large' }
let(:en_expected_body) do let(:en_expected_body) do
<<~BODY <<~BODY

View file

@ -1014,7 +1014,7 @@ RSpec.describe Channel::EmailParser, type: :model do
context 'for English locale (en)' do context 'for English locale (en)' do
include_examples 'postmaster reply' do include_examples 'postmaster reply' do
let(:locale) { 'en' } let(:locale) { 'en' }
let(:expected_subject) { '[ALERT] Message too large' } let(:expected_subject) { '[undeliverable] Message too large' }
let(:expected_body) do let(:expected_body) do
body = <<~BODY body = <<~BODY
Dear Smith Sepp, Dear Smith Sepp,
@ -1074,7 +1074,7 @@ RSpec.describe Channel::EmailParser, type: :model do
context 'for English locale (en)' do context 'for English locale (en)' do
include_examples 'postmaster reply' do include_examples 'postmaster reply' do
let(:locale) { 'en' } let(:locale) { 'en' }
let(:expected_subject) { '[ALERT] Message too large' } let(:expected_subject) { '[undeliverable] Message too large' }
let(:expected_body) do let(:expected_body) do
body = <<~BODY body = <<~BODY
Dear Smith Sepp, Dear Smith Sepp,

View file

@ -129,7 +129,7 @@ Oversized Email Message Body #{'#' * 120_000}
parser = Channel::EmailParser.new parser = Channel::EmailParser.new
mail = parser.parse(msg) mail = parser.parse(msg)
assert_equal(mail[:from_email], @email_address.email) 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>", assert_equal("<#{@test_id}@zammad.test.com>",
mail['references'], mail['references'],
'Reply\'s Referecnes header must match the send message ID') 'Reply\'s Referecnes header must match the send message ID')