From 74de8b4fcc0cf4fd53421599ffa6ebee16c6add0 Mon Sep 17 00:00:00 2001 From: Nexxxeh <57377426+Nexxxeh@users.noreply.github.com> Date: Mon, 27 Mar 2023 03:51:25 +0100 Subject: [PATCH] Update Downloader.cs Expand Message-ID Regex to include pipes and double quotes. This was to address an bug where message IDs had a pipe char in, Downloader then failed when trying to create a file with a pipe in the name. I think the ideal approach would be similar to the "illegalChars" one or one based around encoding URL-style, but I couldn't get that to work quickly and this solved the immediate problem. Not sure if the double quote is of practical value but included for completeness. --- Securcube.ImapDownloader/Data/Downloader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Securcube.ImapDownloader/Data/Downloader.cs b/Securcube.ImapDownloader/Data/Downloader.cs index 1d2bea8..5f0483e 100644 --- a/Securcube.ImapDownloader/Data/Downloader.cs +++ b/Securcube.ImapDownloader/Data/Downloader.cs @@ -348,7 +348,7 @@ private static long DownloadMails(DataContext dc, PcapCapture pcap) totalMessagesDownloaded++; folder.DownloadedItems++; - messageIdSafeName = System.Text.RegularExpressions.Regex.Replace(msg.Headers["Message-ID"] + "", "[<>\\/:]", ""); + messageIdSafeName = System.Text.RegularExpressions.Regex.Replace(msg.Headers["Message-ID"] + "", "[|\"<>\\/:]", ""); string msgPrefix = item.UniqueId + "";