]> git.proxmox.com Git - pmg-api.git/commit
quarantine: use reinject_local_mail to deliver quarantined mail
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 17 Mar 2023 18:44:53 +0000 (19:44 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 23 Mar 2023 16:25:27 +0000 (17:25 +0100)
commite51fe7449f5f03c5540fdb668968511f29077f9c
treeb0e5c9ff3b24efaa4d7df93778aafdc30523b8d2
parent7c9b530b034bbd64fd1047f9d8a88c735cb78ff3
quarantine: use reinject_local_mail to deliver quarantined mail

the current delivery looks quite similar to reinject_local_mail,
apart from the database handling and sending the mail-contents from a
file instead of a MIME::Entity.

reinject_mail has received a few improvments over time, which never
made it to this implementation - e.g. in:
ebd31d3e74d9417375b86766ee300be493044d39
ad1c6bcea94cbaf8d4862bcb05874b59c656c632

While reparsing the mail might seem expensive, the quarantine code
does so multiple times when users click in the quarantine GUI (see
PMG::HTMLMail, and the attachment quarantine)

The issue of MIME::Parser being lossy [0] (parsing and then printing
the entity, might not return the original mail byte-by-byte), is
already present in our code-base anyways (when the mail gets
quarantined (or sent on) it is from a parsed MIME::Entity).

[0] https://metacpan.org/pod/MIME::Tools

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by:  Dominik Csapak <d.csapak@proxmox.com>
src/PMG/Quarantine.pm