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
This commit is contained in:
Christian Hesse 2019-07-18 14:43:13 +02:00
parent e309dee3b1
commit 431a4c8176

View file

@ -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 "" ];