aboutsummaryrefslogtreecommitdiffstats
path: root/email-backup
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-07-18 14:43:13 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-07-18 14:43:13 +0200
commit431a4c8176e7a47cfdc1506b05c7e6fca1ae65b5 (patch)
tree8707bc5929654d24f73cc031c3837888ccb2c332 /email-backup
parente309dee3b1fb58e0658a566ba0f7197458b22561 (diff)
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
Diffstat (limited to 'email-backup')
-rw-r--r--email-backup4
1 files changed, 3 insertions, 1 deletions
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 "" ];