From af434abb96d94f2c6d876d0a29250316b61c3b34 Mon Sep 17 00:00:00 2001 From: ralf Date: Wed, 11 May 2022 10:36:43 +0200 Subject: [PATCH] never set a full path as filename of an attachment as it triggers rejection for some mail-servers --- api/src/Mailer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Mailer.php b/api/src/Mailer.php index 09fd1c81b3..0a505d4a28 100644 --- a/api/src/Mailer.php +++ b/api/src/Mailer.php @@ -377,7 +377,7 @@ class Mailer extends Horde_Mime_Mail $part->setContents($resource); // setting name, also sets content-disposition attachment (!), therefore we have to do it after "text/calendar; method=" handling - if ($name || !is_resource($data)) $part->setName($name ? $name : Vfs::basename($data)); + if ($name || !is_resource($data)) $part->setName(Vfs::basename($name ?: $data)); // this should not be necessary, because binary data get detected by mime-type, // but at least Cyrus complains about NUL characters