From 431a4c8176e7a47cfdc1506b05c7e6fca1ae65b5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 18 Jul 2019 14:43:13 +0200 Subject: email-backup: no more than one dot in file name Looks like some providers do not allow more than one dot in attachment's file name to mitigate something like `holiday.png.exe`. Let's just replace dots with underscores. Fixes #2 Reported-by: @Kampfwurst --- email-backup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/email-backup b/email-backup index 3050afc..de40520 100644 --- a/email-backup +++ b/email-backup @@ -12,6 +12,8 @@ :global BackupSendExport; :global BackupPassword; +:global CharacterReplace; + :if ($BackupSendBinary != true && \ $BackupSendExport != true) do={ :log error ("Configured to send neither backup nor config export."); @@ -19,7 +21,7 @@ } # filename based on identity -:local FileName ($Identity . "." . $Domain); +:local FileName [ $CharacterReplace ($Identity . "." . $Domain) "." "_" ]; :local BackupFile "none"; :local ConfigFile "none"; :local Attach [ :toarray "" ]; -- cgit v1.2.3-54-g00ecf