proxmox/proxmox-notify/src
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
..
api notify: add built-in config and 'origin' parameter 2023-11-17 08:31:36 +01:00
context notify: add built-in config and 'origin' parameter 2023-11-17 08:31:36 +01:00
endpoints notify: smtp: forward original message instead nesting 2024-01-10 12:20:41 +01:00
renderer notify: factor out notification content into its own type 2023-11-17 08:31:36 +01:00
config.rs notify: add 'smtp' endpoint 2023-11-17 08:31:36 +01:00
filter.rs notify: replace filters and groups with matcher-based system 2023-11-17 08:31:36 +01:00
group.rs notify: replace filters and groups with matcher-based system 2023-11-17 08:31:36 +01:00
lib.rs notify: add built-in config and 'origin' parameter 2023-11-17 08:31:36 +01:00
matcher.rs notify: add built-in config and 'origin' parameter 2023-11-17 08:31:36 +01:00
schema.rs notify: replace filters and groups with matcher-based system 2023-11-17 08:31:36 +01:00