Is the ‘mail too big’ coming from Zammad or your email server? These usually come from the mail server, so I don’t think you can make these changes in Zammad. Unless I misunderstand.
I don’t see how it would randomly pick an email, so it may pick an email based on what group it’s sent to. If it’s Zammad.
When the “too big” message is sent out it uses one of theses addresses as sender.
When I edit this used address (e.g. helpdesk-group1@ => helpdesk-group1xxx@) then another(!) address i used.
This feels like “take the first element of an somehow ordered list of addresses as sender”.
This ordering seems to change if an element is edited. Or the order of this list/collection/set whatever is undefined.
In the “too big” message the “X-Envelope-From” and “Return-Path” are correct (helpesk@mydomain.de).
But the From-Header seems to have problems.
The question is: Which mail address is intentionally selected as sender by Zammad?
Problem found - maybe in file email_parser.rb: reply_mail[:from] = EmailAddress.find_by(channel: channel).email
This returns an arbitrary Mail address.
Doing the same in the console EmailAddress.find_by(channel:Channel.find(3))
returns the used “from” mail in the ovesized message.
After editing this mail address the above command returns one of the other mail addresses.
Maybe reply_mail[:from] = Setting.get('notification_sender')
would be better here?
As @MrGeneration wrote in Notification sender is not working the sender should be a groups mail address. But the code does not look like using a group specific address.
What am I missing here?
Sorry I’m not qualifying code and can’t encourage you to change code on your instance.
If you do that’s on your own danger - I don’t want to wear any guilt there.