Skip to content
Permalink
Browse files

Improved subject in oversized mail template.

  • Loading branch information...
zammad-sync committed Aug 9, 2019
1 parent 77d0b2d commit b7bcc2aeff119ddaa7bff6c89e8f3443460b5459
@@ -812,7 +812,7 @@ def archive_mail(folder, msg)
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)
@@ -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.
@@ -16,7 +16,7 @@
mail
end

let(:en_expected_subject) { '[ALERT] Message too large' }
let(:en_expected_subject) { '[undeliverable] Message too large' }

let(:en_expected_body) do
<<~BODY
@@ -1014,7 +1014,7 @@
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 @@
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,
@@ -129,7 +129,7 @@ class EmailPostmasterToSender < ActiveSupport::TestCase
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')

0 comments on commit b7bcc2a

Please sign in to comment.
You can’t perform that action at this time.