proxmox/proxmox-notify
Lukas Wagner b03c394039 notify: smtp: forward original message instead nesting
For mails forwarded by `proxmox-mail-forward` to an SMTP target, the
original message was nested as a 'message/rfc822' message part.
Originally this approach was chosen to avoid having to rewrite
message headers.
Good email-clients, such as Thunderbird can display these inline.
Other, more limited clients will show these messages as an attached
.eml file, which is not really a good user experience.

This patch changes the approach for message forwarding to be more like
forwarding mails in a mail client. We create a new message and
add the original message body as a body. Additionally, we also copy
over all message headers that are relevant to correctly display the
original message body (e.g. Content-Type, Content-Transfer-Encoding)

Tested with a couple of different email messages (varying in
structure, body parts, encoding, etc.) against the following SMTP
relays:
  - gmail
  - outlook
  - our own webmail service

Originally reported in our community forum:
https://forum.proxmox.com/threads/proxmox-mail-forward-sends-mails-as-eml.137710/

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-01-10 12:20:41 +01:00
..
debian notify: bump version to 0.3.0-1 2023-11-17 13:36:55 +01:00
examples notify: factor out notification content into its own type 2023-11-17 08:31:36 +01:00
src notify: smtp: forward original message instead nesting 2024-01-10 12:20:41 +01:00
Cargo.toml notify: bump version to 0.3.0-1 2023-11-17 13:36:55 +01:00