Fixes #3761 - Oversized-mail sender not properly formatted.

This commit is contained in:
Rene Reimann 2026-03-13 15:37:18 +01:00
parent 8603dac0a5
commit 043d2e2ffb
2 changed files with 3 additions and 1 deletions

View file

@ -561,7 +561,8 @@ returns
end
Rails.logger.info "Send mail too large postmaster message to: #{reply_mail[:to]}"
reply_mail[:from] = EmailAddress.find_by(channel: channel).email
email_address = EmailAddress.find_by(channel: channel)
reply_mail[:from] = Channel::EmailBuild.recipient_line(email_address.name, email_address.email)
channel.deliver(reply_mail)
rescue => e
Rails.logger.error "Error during sending of postmaster oversized email auto-reply: #{e.inspect}\n#{e.backtrace}"

View file

@ -354,6 +354,7 @@ RSpec.describe Channel::Driver::Imap, integration: true, required_envs: %w[MAIL_
expect(parsed_oversized_email_reply).to include(
{
from_email: email_address.email,
from_display_name: email_address.name,
subject: '[undeliverable] Message too large',
'references' => "<#{cid}@zammad.test.com>",
'in-reply-to' => "<#{cid}@zammad.test.com>",