]> git.proxmox.com Git - pmg-api.git/commit
api: quarantine: decode addresses before delivery/userlisting
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 17 Mar 2023 18:44:54 +0000 (19:44 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 23 Mar 2023 16:25:27 +0000 (17:25 +0100)
commitd616867d42e9a66b08833080018c4ce9da4bfd69
tree269efa0a2ff233a91b6d338b6982902e4c6cf7e1
parente51fe7449f5f03c5540fdb668968511f29077f9c
api: quarantine: decode addresses before delivery/userlisting

With the change of using reinject_local_mail for the quarantine
delivery the issue of not properly decoding the entries we get from
the database before delivering became apparent

The database returns utf-8 encoded strings, reinject_local_mail and
add_to_blackwhite expects perl-strings (with wide characters) and
encodes them (a second time) - this patch decodes the database strings
before passing it on.

add_to_black_white is used in a few API calls (via
read_or_modify_user_bw_list), therefore the approach of decode (from
database), and encode (for database) was chosen.

Reported-by: Dominik Csapak <d.csapak@proxomox.com>
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/API2/Quarantine.pm