Replying to a message with Greek selected as the interface language
was broken: SOGoMailObject+Draft.m builds the reply page class name
dynamically as SOGoMail<Language>Reply and instantiates it via
pageWithName:, but no SOGoMailGreekReply class was ever declared in
SOGoMailReply.h/.m, even though the Greek.lproj translations and the
SOGoMailGreekReply.wo template already existed on disk.
Also add SOGoMailGreekForward.wo and SOGoMailGreekReply.wo to
Mailer_RESOURCE_FILES in the GNUmakefile. Without this, neither
template gets installed into the built bundle, so Greek mail
forwarding was silently broken too, despite the SOGoMailGreekForward
class already existing in code.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Several places in the TNEF attachment decoder read a fixed number of
bytes, or index at a fixed offset, out of a MAPI property's data buffer
without checking the buffer is actually that large:
- the possibly-embedded-TNEF signature, read at offset 16 for an object
property and at offset 0 for plain file data
- the same object-attachment data, when building the actual attachment
content a few lines later: the length used there is derived from the
same unchecked offset and underflows to a huge value for a short buffer
- the classification flag, read as an 8-byte value
- the recurrence pattern, indexed up to offset 0x23 but only checked for
0x1F bytes
A short enough attachment property made these read, or in the attachment
case allocate, past the end of the buffer.
Add the missing length checks; where no further data is left to build
from, skip that part of the output instead.
generateMessageID: appended the substring following the last '@'
without sanitizing it, so a sender value such as 'Doe, John <a@b>'
produced 'Message-Id: <uuid@b>>' with a duplicated closing bracket on
calendar invitations. A nil domain also left the message-id
unterminated.
The domain part is now cut at the first address delimiter or
whitespace - a domain is a single token, and anything else would
allow header injection through generated message-ids.
Fixes#6201