[pmg-devel] [PATCH pmg-api v2 06/10] fix result verification for invalid mails

Dominik Csapak d.csapak at proxmox.com
Mon Sep 30 14:55:30 CEST 2019


in case we cannot parse the mail to produce any sensible html/text
output, we got a 'result verification error', instead show 'No Content'

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* change error message
 src/PMG/API2/Quarantine.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PMG/API2/Quarantine.pm b/src/PMG/API2/Quarantine.pm
index feae798..ec93e80 100644
--- a/src/PMG/API2/Quarantine.pm
+++ b/src/PMG/API2/Quarantine.pm
@@ -851,7 +851,7 @@ __PACKAGE__->register_method ({
 	    my $viewimages = $cfg->get('spamquar', 'viewimages');
 	    my $allowhref = $cfg->get('spamquar', 'allowhrefs');
 
-	    $res->{content} = PMG::HTMLMail::email_to_html($path, $raw, $viewimages, $allowhref);
+	    $res->{content} = PMG::HTMLMail::email_to_html($path, $raw, $viewimages, $allowhref) // 'unable to parse mail';
 
 	    # to make result verification happy
 	    $res->{file} = '';
-- 
2.20.1




More information about the pmg-devel mailing list