diff options
author | Christian Hesse <mail@eworm.de> | 2019-07-18 14:43:13 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2019-07-18 14:43:13 +0200 |
commit | 431a4c8176e7a47cfdc1506b05c7e6fca1ae65b5 (patch) | |
tree | 8707bc5929654d24f73cc031c3837888ccb2c332 /email-backup | |
parent | e309dee3b1fb58e0658a566ba0f7197458b22561 (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-backup | 4 |
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 "" ]; |