Commit 034135b1 authored by malte's avatar malte

add original mail to body when capturing autogenerated mails

parent 293974c7
Pipeline #15438 failed with stages
......@@ -3,7 +3,7 @@ module Schleuder
def self.forward_bounce_to_admins(list, mail)
if mail.automated_message?
list.logger.info "Forwarding automated message to admins"
list.logger.notify_admin I18n.t(:forward_automated_message_to_admins), mail.original_message, I18n.t('automated_message_subject')
list.logger.notify_admin I18n.t(:forward_automated_message_to_admins) + "\n\n\n" + mail.original_message.to_s, mail.original_message, I18n.t('automated_message_subject')
exit
end
end
......
......@@ -90,7 +90,7 @@ describe 'someone sends an email to a listname-dash-address' do
expect(message.to).to eql(['admin@example.org'])
expect(message.subject).to eql(I18n.t('automated_message_subject'))
signed_message_parts = message.parts[0].parts
expect(signed_message_parts.first.body.to_s).to eql(I18n.t('forward_automated_message_to_admins'))
expect(signed_message_parts.first.body.to_s).to include(I18n.t('forward_automated_message_to_admins'))
expect(signed_message_parts.last.mime_type).to eql('message/rfc822')
expect(signed_message_parts.last.body.to_s).to include('From: mailer-daemon@example.org')
expect(signed_message_parts.last.body.to_s).to include(mail.message_id)
......@@ -117,7 +117,7 @@ describe 'someone sends an email to a listname-dash-address' do
expect(message.to).to eql(['admin@example.org'])
expect(message.subject).to eql(I18n.t('automated_message_subject'))
signed_message_parts = message.parts[0].parts
expect(signed_message_parts.first.body.to_s).to eql(I18n.t('forward_automated_message_to_admins'))
expect(signed_message_parts.first.body.to_s).to include(I18n.t('forward_automated_message_to_admins'))
expect(signed_message_parts.last.mime_type).to eql('message/rfc822')
expect(signed_message_parts.last.body.to_s).to include('Mailer-Daemon@schleuder.example.org')
expect(signed_message_parts.last.body.to_s).to include(mail.message_id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment