├── version
├── OutlookOkan
├── Properties
│ ├── Resources.ja-JP.Designer.cs
│ ├── Settings.settings
│ ├── Settings.cs
│ ├── AssemblyInfo.cs
│ └── Settings.Designer.cs
├── Images
│ └── Noraneko_Logo.png
├── Types
│ ├── CcOrBcc.cs
│ ├── NameAndRecipient.cs
│ ├── MailItemsRecipientAndMailAddress.cs
│ ├── InternalDomain.cs
│ ├── AutoDeleteRecipient.cs
│ ├── AttachmentProhibitedRecipients.cs
│ ├── NameAndDomains.cs
│ ├── KeywordAndRecipients.cs
│ ├── AutoCcBccAttachedFile.cs
│ ├── AttachmentAlertRecipients.cs
│ ├── DeferredDeliveryMinutes.cs
│ ├── RecipientsAndAttachmentsName.cs
│ ├── AlertKeywordOfSubjectWhenOpeningMail.cs
│ ├── AutoCcBccKeyword.cs
│ ├── Whitelist.cs
│ ├── AutoCcBccRecipient.cs
│ ├── DisplayNameAndRecipient.cs
│ ├── AlertAddress.cs
│ ├── AlertKeywordAndMessage.cs
│ ├── AlertKeywordAndMessageForSubject.cs
│ ├── AutoAddMessage.cs
│ ├── ForceAutoChangeRecipientsToBcc.cs
│ ├── ExternalDomainsWarningAndAutoChangeToBcc.cs
│ ├── Languages.cs
│ ├── CheckList.cs
│ ├── AttachmentsSetting.cs
│ ├── SecurityForReceivedMail.cs
│ └── GeneralSetting.cs
├── Views
│ ├── AboutWindow.xaml.cs
│ ├── AboutWindow.xaml
│ ├── ConfirmationWindow.xaml.cs
│ └── SettingsWindow.xaml.cs
├── ViewModels
│ ├── ViewModelBase.cs
│ ├── RelayCommand.cs
│ ├── AboutWindowViewModel.cs
│ └── ConfirmationWindowViewModel.cs
├── Helpers
│ └── NativeMethods.cs
├── Handlers
│ ├── PdfFileHandler.cs
│ ├── ZipFileHandler.cs
│ ├── CsvFileHandler.cs
│ ├── OfficeFileHandler.cs
│ └── MailHeaderHandler.cs
├── Ribbon.xml
├── ThisAddIn.Designer.xml
├── packages.config
├── Services
│ └── ResourceService.cs
├── Models
│ └── CheckNewVersion.cs
├── app.config
├── Ribbon.cs
└── ThisAddIn.Designer.cs
├── OutlookOkanTest
├── TestFiles
│ ├── PlainText.txt
│ ├── Excel.xlsx
│ ├── 暗号化なし.zip
│ ├── Excel_Password.xlsx
│ ├── 暗号化あり_12345_Test.zip
│ └── 暗号化あり_AES_12345_Test.zip
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
├── app.config
├── Types
│ ├── TestRecipient.cs
│ └── TestMailItem.cs
└── OutlookOkanTest.csproj
├── Screenshots
├── Screenshot_v2.5.0_01.png
├── Screenshot_v2.5.0_03.png
├── Screenshot_v2.6.1_02.png
├── Screenshot_v2.7.0_04.png
├── Screenshot_v2.7.0_05.png
└── en
│ ├── Screenshot_v2.5.0_01_en.png
│ ├── Screenshot_v2.5.0_03_en.png
│ ├── Screenshot_v2.6.1_02_en.png
│ ├── Screenshot_v2.7.0_04_en.png
│ └── Screenshot_v2.7.0_05_en.png
├── .gitattributes
├── SetupCustomAction
├── Properties
│ └── AssemblyInfo.cs
├── SetupCustomAction.csproj
└── CustomAction.cs
├── OutlookOkan.sln
├── README.md
├── README_en.md
├── .gitignore
└── LICENSE
/version:
--------------------------------------------------------------------------------
1 | 2.8.2
2 |
--------------------------------------------------------------------------------
/OutlookOkan/Properties/Resources.ja-JP.Designer.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/OutlookOkanTest/TestFiles/PlainText.txt:
--------------------------------------------------------------------------------
1 | あいうえお
2 | かきくけこ
3 | さしすせそ
--------------------------------------------------------------------------------
/OutlookOkan/Images/Noraneko_Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/OutlookOkan/Images/Noraneko_Logo.png
--------------------------------------------------------------------------------
/OutlookOkanTest/TestFiles/Excel.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/OutlookOkanTest/TestFiles/Excel.xlsx
--------------------------------------------------------------------------------
/OutlookOkanTest/TestFiles/暗号化なし.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/OutlookOkanTest/TestFiles/暗号化なし.zip
--------------------------------------------------------------------------------
/Screenshots/Screenshot_v2.5.0_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/Screenshot_v2.5.0_01.png
--------------------------------------------------------------------------------
/Screenshots/Screenshot_v2.5.0_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/Screenshot_v2.5.0_03.png
--------------------------------------------------------------------------------
/Screenshots/Screenshot_v2.6.1_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/Screenshot_v2.6.1_02.png
--------------------------------------------------------------------------------
/Screenshots/Screenshot_v2.7.0_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/Screenshot_v2.7.0_04.png
--------------------------------------------------------------------------------
/Screenshots/Screenshot_v2.7.0_05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/Screenshot_v2.7.0_05.png
--------------------------------------------------------------------------------
/Screenshots/en/Screenshot_v2.5.0_01_en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/en/Screenshot_v2.5.0_01_en.png
--------------------------------------------------------------------------------
/Screenshots/en/Screenshot_v2.5.0_03_en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/en/Screenshot_v2.5.0_03_en.png
--------------------------------------------------------------------------------
/Screenshots/en/Screenshot_v2.6.1_02_en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/en/Screenshot_v2.6.1_02_en.png
--------------------------------------------------------------------------------
/Screenshots/en/Screenshot_v2.7.0_04_en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/en/Screenshot_v2.7.0_04_en.png
--------------------------------------------------------------------------------
/Screenshots/en/Screenshot_v2.7.0_05_en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/Screenshots/en/Screenshot_v2.7.0_05_en.png
--------------------------------------------------------------------------------
/OutlookOkan/Types/CcOrBcc.cs:
--------------------------------------------------------------------------------
1 | namespace OutlookOkan.Types
2 | {
3 | public enum CcOrBcc
4 | {
5 | Bcc,
6 | Cc
7 | }
8 | }
--------------------------------------------------------------------------------
/OutlookOkanTest/TestFiles/Excel_Password.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/OutlookOkanTest/TestFiles/Excel_Password.xlsx
--------------------------------------------------------------------------------
/OutlookOkanTest/TestFiles/暗号化あり_12345_Test.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/OutlookOkanTest/TestFiles/暗号化あり_12345_Test.zip
--------------------------------------------------------------------------------
/OutlookOkanTest/TestFiles/暗号化あり_AES_12345_Test.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t-miyake/OutlookOkan/HEAD/OutlookOkanTest/TestFiles/暗号化あり_AES_12345_Test.zip
--------------------------------------------------------------------------------
/OutlookOkan/Types/NameAndRecipient.cs:
--------------------------------------------------------------------------------
1 | namespace OutlookOkan.Types
2 | {
3 | public sealed class NameAndRecipient
4 | {
5 | public string MailAddress { get; set; }
6 | public string NameAndMailAddress { get; set; }
7 | public string IncludedGroupAndList { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/MailItemsRecipientAndMailAddress.cs:
--------------------------------------------------------------------------------
1 | namespace OutlookOkan.Types
2 | {
3 | public sealed class MailItemsRecipientAndMailAddress
4 | {
5 | public string MailItemsRecipient { get; set; }
6 | public string MailAddress { get; set; }
7 | public int Type { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/OutlookOkanTest/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/OutlookOkan/Views/AboutWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using OutlookOkan.ViewModels;
2 | using System.Windows;
3 |
4 | namespace OutlookOkan.Views
5 | {
6 | public partial class AboutWindow : Window
7 | {
8 | public AboutWindow()
9 | {
10 | DataContext = new AboutWindowViewModel();
11 | InitializeComponent();
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/InternalDomain.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class InternalDomain
6 | {
7 | public string Domain { get; set; }
8 | }
9 |
10 | public sealed class InternalDomainMap : ClassMap
11 | {
12 | public InternalDomainMap()
13 | {
14 | _ = Map(m => m.Domain).Index(0);
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/OutlookOkan/ViewModels/ViewModelBase.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace OutlookOkan.ViewModels
4 | {
5 | public class ViewModelBase : INotifyPropertyChanged
6 | {
7 | public event PropertyChangedEventHandler PropertyChanged;
8 | protected virtual void OnPropertyChanged(string propertyName)
9 | {
10 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/AutoDeleteRecipient.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AutoDeleteRecipient
6 | {
7 | public string Recipient { get; set; }
8 | }
9 |
10 | public sealed class AutoDeleteRecipientMap : ClassMap
11 | {
12 | public AutoDeleteRecipientMap()
13 | {
14 | _ = Map(m => m.Recipient).Index(0);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/OutlookOkan/Types/AttachmentProhibitedRecipients.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AttachmentProhibitedRecipients
6 | {
7 | public string Recipient { get; set; }
8 | }
9 |
10 | public sealed class AttachmentProhibitedRecipientsMap : ClassMap
11 | {
12 | public AttachmentProhibitedRecipientsMap()
13 | {
14 | _ = Map(m => m.Recipient).Index(0);
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/NameAndDomains.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class NameAndDomains
6 | {
7 | public string Name { get; set; }
8 | public string Domain { get; set; }
9 | }
10 |
11 | public sealed class NameAndDomainsMap : ClassMap
12 | {
13 | public NameAndDomainsMap()
14 | {
15 | _ = Map(m => m.Name).Index(0);
16 | _ = Map(m => m.Domain).Index(1);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/KeywordAndRecipients.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class KeywordAndRecipients
6 | {
7 | public string Keyword { get; set; }
8 | public string Recipient { get; set; }
9 | }
10 |
11 | public sealed class KeywordAndRecipientsMap : ClassMap
12 | {
13 | public KeywordAndRecipientsMap()
14 | {
15 | _ = Map(m => m.Keyword).Index(0);
16 | _ = Map(m => m.Recipient).Index(1);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/AutoCcBccAttachedFile.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AutoCcBccAttachedFile
6 | {
7 | public CcOrBcc CcOrBcc { get; set; }
8 | public string AutoAddAddress { get; set; }
9 | }
10 |
11 | public sealed class AutoCcBccAttachedFileMap : ClassMap
12 | {
13 | public AutoCcBccAttachedFileMap()
14 | {
15 | _ = Map(m => m.CcOrBcc).Index(0);
16 | _ = Map(m => m.AutoAddAddress).Index(1);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/AttachmentAlertRecipients.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AttachmentAlertRecipients
6 | {
7 | public string Recipient { get; set; }
8 | public string Message { get; set; }
9 | }
10 |
11 | public sealed class AttachmentAlertRecipientsMap : ClassMap
12 | {
13 | public AttachmentAlertRecipientsMap()
14 | {
15 | _ = Map(m => m.Recipient).Index(0);
16 | _ = Map(m => m.Message).Index(1);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/DeferredDeliveryMinutes.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class DeferredDeliveryMinutes
6 | {
7 | public string TargetAddress { get; set; }
8 | public int DeferredMinutes { get; set; }
9 | }
10 |
11 | public sealed class DeferredDeliveryMinutesMap : ClassMap
12 | {
13 | public DeferredDeliveryMinutesMap()
14 | {
15 | _ = Map(m => m.TargetAddress).Index(0);
16 | _ = Map(m => m.DeferredMinutes).Index(1).Default(0);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/RecipientsAndAttachmentsName.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class RecipientsAndAttachmentsName
6 | {
7 | public string AttachmentsName { get; set; }
8 | public string Recipient { get; set; }
9 | }
10 |
11 | public sealed class RecipientsAndAttachmentsNameMap : ClassMap
12 | {
13 | public RecipientsAndAttachmentsNameMap()
14 | {
15 | _ = Map(m => m.AttachmentsName).Index(0);
16 | _ = Map(m => m.Recipient).Index(1);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/AlertKeywordOfSubjectWhenOpeningMail.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public class AlertKeywordOfSubjectWhenOpeningMail
6 | {
7 | public string AlertKeyword { get; set; }
8 | public string Message { get; set; }
9 | }
10 |
11 | public sealed class AlertKeywordOfSubjectWhenOpeningMailMap : ClassMap
12 | {
13 | public AlertKeywordOfSubjectWhenOpeningMailMap()
14 | {
15 | _ = Map(m => m.AlertKeyword).Index(0);
16 | _ = Map(m => m.Message).Index(1);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/AutoCcBccKeyword.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AutoCcBccKeyword
6 | {
7 | public string Keyword { get; set; }
8 | public CcOrBcc CcOrBcc { get; set; }
9 | public string AutoAddAddress { get; set; }
10 | }
11 |
12 | public sealed class AutoCcBccKeywordMap : ClassMap
13 | {
14 | public AutoCcBccKeywordMap()
15 | {
16 | _ = Map(m => m.Keyword).Index(0);
17 | _ = Map(m => m.CcOrBcc).Index(1);
18 | _ = Map(m => m.AutoAddAddress).Index(2);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/Whitelist.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class Whitelist
6 | {
7 | public string WhiteName { get; set; }
8 | public bool IsSkipConfirmation { get; set; }
9 | }
10 |
11 | public sealed class WhitelistMap : ClassMap
12 | {
13 | public WhitelistMap()
14 | {
15 | _ = Map(m => m.WhiteName).Index(0);
16 | _ = Map(m => m.IsSkipConfirmation).Index(1).TypeConverterOption.BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/AutoCcBccRecipient.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AutoCcBccRecipient
6 | {
7 | public string TargetRecipient { get; set; }
8 | public CcOrBcc CcOrBcc { get; set; }
9 | public string AutoAddAddress { get; set; }
10 | }
11 |
12 | public sealed class AutoCcBccRecipientMap : ClassMap
13 | {
14 | public AutoCcBccRecipientMap()
15 | {
16 | _ = Map(m => m.TargetRecipient).Index(0);
17 | _ = Map(m => m.CcOrBcc).Index(1);
18 | _ = Map(m => m.AutoAddAddress).Index(2);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/OutlookOkanTest/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | [assembly: AssemblyTitle("OutlookOkanTest")]
5 | [assembly: AssemblyDescription("")]
6 | [assembly: AssemblyConfiguration("")]
7 | [assembly: AssemblyCompany("Noraneko Inc.")]
8 | [assembly: AssemblyProduct("OutlookOkanTest")]
9 | [assembly: AssemblyCopyright("Copyright © Noraneko Inc. 2022")]
10 | [assembly: AssemblyTrademark("")]
11 | [assembly: AssemblyCulture("")]
12 |
13 | [assembly: ComVisible(false)]
14 |
15 | [assembly: Guid("828251eb-7a92-4559-93f8-bb5f5d8b16a7")]
16 |
17 | [assembly: AssemblyVersion("1.0.0.0")]
18 | [assembly: AssemblyFileVersion("1.0.0.0")]
19 |
--------------------------------------------------------------------------------
/OutlookOkan/Helpers/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 | using System.Windows.Forms;
4 |
5 | namespace OutlookOkan.Helpers
6 | {
7 | public sealed class NativeMethods : IWin32Window
8 | {
9 | [DllImport("user32", CharSet = CharSet.Unicode)]
10 | private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
11 |
12 | public IntPtr Handle { get; }
13 |
14 | public NativeMethods(object windowObject)
15 | {
16 | Handle = FindWindow("rctrl_renwnd32\0", windowObject.GetType().InvokeMember("Caption", System.Reflection.BindingFlags.GetProperty, null, windowObject, null).ToString());
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/DisplayNameAndRecipient.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class DisplayNameAndRecipient
6 | {
7 | public Dictionary All { get; set; } = new Dictionary();
8 | public Dictionary To { get; set; } = new Dictionary();
9 | public Dictionary Cc { get; set; } = new Dictionary();
10 | public Dictionary Bcc { get; set; } = new Dictionary();
11 | public List MailRecipientsIndex { get; set; } = new List();
12 | }
13 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/AlertAddress.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AlertAddress
6 | {
7 | public string TargetAddress { get; set; }
8 | public bool IsCanNotSend { get; set; }
9 | public string Message { get; set; }
10 | }
11 |
12 | public sealed class AlertAddressMap : ClassMap
13 | {
14 | public AlertAddressMap()
15 | {
16 | _ = Map(m => m.TargetAddress).Index(0);
17 | _ = Map(m => m.IsCanNotSend).Index(1).TypeConverterOption.BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
18 | _ = Map(m => m.Message).Index(2);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/OutlookOkan/Handlers/PdfFileHandler.cs:
--------------------------------------------------------------------------------
1 | using PdfSharp.Pdf.IO;
2 | using System;
3 | using System.IO;
4 |
5 | namespace OutlookOkan.Handlers
6 | {
7 | internal static class PdfFileHandler
8 | {
9 | internal static bool CheckPdfIsEncrypted(string filePath)
10 | {
11 | //リンクとして添付の場合、実ファイルが存在しない場合がある。
12 | if (!File.Exists(filePath)) return false;
13 |
14 | try
15 | {
16 | PdfReader.Open(filePath, PdfDocumentOpenMode.ReadOnly).Dispose();
17 | }
18 | catch (PdfReaderException)
19 | {
20 | return true;
21 | }
22 | catch (Exception)
23 | {
24 | return false;
25 | }
26 |
27 | return false;
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/AlertKeywordAndMessage.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AlertKeywordAndMessage
6 | {
7 | public string AlertKeyword { get; set; }
8 | public string Message { get; set; }
9 | public bool IsCanNotSend { get; set; }
10 | }
11 |
12 | public sealed class AlertKeywordAndMessageMap : ClassMap
13 | {
14 | public AlertKeywordAndMessageMap()
15 | {
16 | _ = Map(m => m.AlertKeyword).Index(0);
17 | _ = Map(m => m.Message).Index(1);
18 | _ = Map(m => m.IsCanNotSend).Index(2).TypeConverterOption.BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/AlertKeywordAndMessageForSubject.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AlertKeywordAndMessageForSubject
6 | {
7 | public string AlertKeyword { get; set; }
8 | public string Message { get; set; }
9 | public bool IsCanNotSend { get; set; }
10 | }
11 |
12 | public sealed class AlertKeywordAndMessageForSubjectMap : ClassMap
13 | {
14 | public AlertKeywordAndMessageForSubjectMap()
15 | {
16 | _ = Map(m => m.AlertKeyword).Index(0);
17 | _ = Map(m => m.Message).Index(1);
18 | _ = Map(m => m.IsCanNotSend).Index(2).TypeConverterOption.BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/OutlookOkan/Ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/OutlookOkan/ThisAddIn.Designer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/OutlookOkan/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 0
7 |
8 |
9 | 0
10 |
11 |
12 | 0
13 |
14 |
15 | 0
16 |
17 |
18 |
--------------------------------------------------------------------------------
/OutlookOkan/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/OutlookOkan/Types/AutoAddMessage.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AutoAddMessage
6 | {
7 | public bool IsAddToStart { get; set; }
8 | public bool IsAddToEnd { get; set; }
9 | public string MessageOfAddToStart { get; set; }
10 | public string MessageOfAddToEnd { get; set; }
11 | }
12 |
13 | public sealed class AutoAddMessageMap : ClassMap
14 | {
15 | public AutoAddMessageMap()
16 | {
17 | _ = Map(m => m.IsAddToStart).Index(0).TypeConverterOption.BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
18 | _ = Map(m => m.IsAddToEnd).Index(1).TypeConverterOption.BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
19 | _ = Map(m => m.MessageOfAddToStart).Index(2);
20 | _ = Map(m => m.MessageOfAddToEnd).Index(3);
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/OutlookOkan/Services/ResourceService.cs:
--------------------------------------------------------------------------------
1 | using OutlookOkan.Properties;
2 | using System.ComponentModel;
3 | using System.Globalization;
4 | using System.Runtime.CompilerServices;
5 |
6 | namespace OutlookOkan.Services
7 | {
8 | internal class ResourceService : INotifyPropertyChanged
9 | {
10 | // Singleton instance.
11 | public static ResourceService Instance { get; } = new ResourceService();
12 | private ResourceService() { }
13 |
14 | public Resources Resources { get; } = new Resources();
15 |
16 | public event PropertyChangedEventHandler PropertyChanged;
17 | protected virtual void RaisePropertyChanged([CallerMemberName] string propertyName = null)
18 | {
19 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
20 | }
21 |
22 | public void ChangeCulture(string name)
23 | {
24 | Resources.Culture = CultureInfo.GetCultureInfo(name);
25 | RaisePropertyChanged(nameof(Resources));
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/ForceAutoChangeRecipientsToBcc.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class ForceAutoChangeRecipientsToBcc
6 | {
7 | public bool IsForceAutoChangeRecipientsToBcc { get; set; }
8 | public string ToRecipient { get; set; }
9 | public bool IsIncludeInternalDomain { get; set; }
10 | }
11 |
12 | public sealed class ForceAutoChangeRecipientsToBccMap : ClassMap
13 | {
14 | public ForceAutoChangeRecipientsToBccMap()
15 | {
16 | _ = Map(m => m.IsForceAutoChangeRecipientsToBcc).Index(0).TypeConverterOption.BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
17 | _ = Map(m => m.ToRecipient).Index(1);
18 | _ = Map(m => m.IsIncludeInternalDomain).Index(2).TypeConverterOption.BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/OutlookOkan/ViewModels/RelayCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 |
4 | namespace OutlookOkan.ViewModels
5 | {
6 | public sealed class RelayCommand : ICommand
7 | {
8 | private readonly Action _execute;
9 | private readonly Func _canExecute;
10 |
11 | public event EventHandler CanExecuteChanged;
12 |
13 | public RelayCommand(Action execute) : this(execute, null)
14 | {
15 | }
16 |
17 | public RelayCommand(Action execute, Func canExecute)
18 | {
19 | _execute = execute ?? throw new ArgumentNullException(nameof(execute));
20 | _canExecute = canExecute;
21 | }
22 |
23 | public bool CanExecute(object parameter)
24 | {
25 | return _canExecute?.Invoke() ?? true;
26 | }
27 |
28 | public void Execute(object parameter)
29 | {
30 | _execute();
31 | }
32 |
33 | public void RaiseCanExecuteChanged()
34 | {
35 | var handler = CanExecuteChanged;
36 | handler?.Invoke(this, EventArgs.Empty);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/OutlookOkan/ViewModels/AboutWindowViewModel.cs:
--------------------------------------------------------------------------------
1 | using OutlookOkan.Models;
2 | using System.Diagnostics;
3 | using System.Windows;
4 | using System.Windows.Input;
5 |
6 | namespace OutlookOkan.ViewModels
7 | {
8 | internal sealed class AboutWindowViewModel : ViewModelBase
9 | {
10 | private readonly CheckNewVersion _checkNewVersion = new CheckNewVersion();
11 |
12 | internal AboutWindowViewModel()
13 | {
14 | CheckNewVersionButtonCommand = new RelayCommand(CheckNewVersion);
15 | }
16 |
17 | public ICommand CheckNewVersionButtonCommand { get; }
18 |
19 | private void CheckNewVersion()
20 | {
21 | if (_checkNewVersion.IsCanDownloadNewVersion())
22 | {
23 | var result = MessageBox.Show(Properties.Resources.CanGetNewVersion, Properties.Resources.AppName, MessageBoxButton.YesNo);
24 | if (result == MessageBoxResult.Yes)
25 | {
26 | _ = Process.Start("https://github.com/t-miyake/OutlookOkan/releases");
27 | }
28 | }
29 | else
30 | {
31 | _ = MessageBox.Show(Properties.Resources.YouHaveLatest, Properties.Resources.AppName, MessageBoxButton.OK);
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/OutlookOkan/Properties/Settings.cs:
--------------------------------------------------------------------------------
1 | namespace OutlookOkan.Properties
2 | {
3 | // This class allows you to handle specific events on the settings class:
4 | // The SettingChanging event is raised before a setting's value is changed.
5 | // The PropertyChanged event is raised after a setting's value is changed.
6 | // The SettingsLoaded event is raised after the setting values are loaded.
7 | // The SettingsSaving event is raised before the setting values are saved.
8 | internal sealed partial class Settings
9 | {
10 | public Settings()
11 | {
12 | // // To add event handlers for saving and changing settings, uncomment the lines below:
13 | //
14 | // this.SettingChanging += this.SettingChangingEventHandler;
15 | //
16 | // this.SettingsSaving += this.SettingsSavingEventHandler;
17 | //
18 | }
19 |
20 | private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
21 | {
22 | // Add code to handle the SettingChangingEvent event here.
23 | }
24 |
25 | private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e)
26 | {
27 | // Add code to handle the SettingsSaving event here.
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/OutlookOkanTest/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/SetupCustomAction/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("SetupCustomAction")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Noraneko Inc.")]
11 | [assembly: AssemblyProduct("SetupCustomAction")]
12 | [assembly: AssemblyCopyright("Copyright © Noraneko Inc. 2022")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("de0ddc03-116b-4e2c-af47-9f06fd99d391")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.2.0.0")]
35 | [assembly: AssemblyFileVersion("1.2.0.0")]
36 |
--------------------------------------------------------------------------------
/OutlookOkan/Types/ExternalDomainsWarningAndAutoChangeToBcc.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class ExternalDomainsWarningAndAutoChangeToBcc
6 | {
7 | public int TargetToAndCcExternalDomainsNum { get; set; } = 10;
8 | public bool IsWarningWhenLargeNumberOfExternalDomains { get; set; } = true;
9 | public bool IsProhibitedWhenLargeNumberOfExternalDomains { get; set; }
10 | public bool IsAutoChangeToBccWhenLargeNumberOfExternalDomains { get; set; }
11 | }
12 |
13 | public sealed class ExternalDomainsWarningAndAutoChangeToBccMap : ClassMap
14 | {
15 | public ExternalDomainsWarningAndAutoChangeToBccMap()
16 | {
17 | _ = Map(m => m.TargetToAndCcExternalDomainsNum).Index(0).Default(10);
18 |
19 | _ = Map(m => m.IsWarningWhenLargeNumberOfExternalDomains).Index(1).TypeConverterOption
20 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(true);
21 |
22 | _ = Map(m => m.IsProhibitedWhenLargeNumberOfExternalDomains).Index(2).TypeConverterOption
23 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
24 |
25 | _ = Map(m => m.IsAutoChangeToBccWhenLargeNumberOfExternalDomains).Index(3).TypeConverterOption
26 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/OutlookOkanTest/Types/TestRecipient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Outlook = Microsoft.Office.Interop.Outlook;
3 |
4 | namespace OutlookOkanTest.Types
5 | {
6 | public class TestRecipient : Outlook.Recipient
7 | {
8 | public void Delete()
9 | {
10 | throw new NotImplementedException();
11 | }
12 |
13 | public string FreeBusy(DateTime Start, int MinPerChar, object CompleteFormat = null)
14 | {
15 | throw new NotImplementedException();
16 | }
17 |
18 | public bool Resolve()
19 | {
20 | throw new NotImplementedException();
21 | }
22 |
23 | public Outlook.Application Application { get; }
24 | public Outlook.OlObjectClass Class { get; }
25 | public Outlook.NameSpace Session { get; }
26 | public object Parent { get; }
27 | public string Address { get; }
28 | public Outlook.AddressEntry AddressEntry { get; set; }
29 | public string AutoResponse { get; set; }
30 | public Outlook.OlDisplayType DisplayType { get; }
31 | public string EntryID { get; }
32 | public int Index { get; }
33 | public Outlook.OlResponseStatus MeetingResponseStatus { get; }
34 | public string Name { get; set; }
35 | public bool Resolved { get; }
36 | public Outlook.OlTrackingStatus TrackingStatus { get; set; }
37 | public DateTime TrackingStatusTime { get; set; }
38 | public int Type { get; set; }
39 | public Outlook.PropertyAccessor PropertyAccessor { get; }
40 | public bool Sendable { get; set; }
41 | }
42 | }
--------------------------------------------------------------------------------
/OutlookOkan/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Resources;
2 | using System.Reflection;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("OutlookOkan")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Noraneko Inc.")]
12 | [assembly: AssemblyProduct("OutlookOkan")]
13 | [assembly: AssemblyCopyright("Copyright © Noraneko Inc. 2024")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c5f60da0-7bab-46fa-ac16-d7f6924396f6")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("2.8.2.00")]
36 | [assembly: AssemblyFileVersion("2.8.2.00")]
37 | [assembly: NeutralResourcesLanguage("en-US")]
38 |
39 |
--------------------------------------------------------------------------------
/OutlookOkan/Models/CheckNewVersion.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Reflection;
4 |
5 | namespace OutlookOkan.Models
6 | {
7 | ///
8 | /// 新しいバージョンの有無を確認する。
9 | ///
10 | internal sealed class CheckNewVersion
11 | {
12 | ///
13 | /// 新バージョンのダウンロード可否を返す。
14 | ///
15 | /// 新バージョンのダウンロード可否
16 | internal bool IsCanDownloadNewVersion()
17 | {
18 | using (var client = new WebClient())
19 | {
20 | try
21 | {
22 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
23 |
24 | client.Encoding = System.Text.Encoding.UTF8;
25 | var versionFile = client.DownloadString("https://raw.githubusercontent.com/t-miyake/OutlookOkan/master/version");
26 | if (string.IsNullOrEmpty(versionFile)) return false;
27 |
28 | var fetchedVersion = int.Parse(versionFile.Replace(".", ""));
29 | return fetchedVersion > GetCurrentVersion();
30 |
31 | }
32 | catch (Exception)
33 | {
34 | return false;
35 | }
36 | }
37 | }
38 |
39 | ///
40 | /// 現在使用しているアドインのバージョンを取得する。
41 | ///
42 | /// 現在使用しているアドインのバージョン
43 | private int GetCurrentVersion()
44 | {
45 | var assemblyName = Assembly.GetExecutingAssembly().GetName();
46 | return int.Parse(assemblyName.Version.Major.ToString() + assemblyName.Version.Minor.ToString() + assemblyName.Version.Build.ToString() + assemblyName.Version.Revision.ToString());
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/OutlookOkan/Types/Languages.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class Languages
6 | {
7 | public List Language = new List();
8 |
9 | public Languages()
10 | {
11 | Language.Add(new LanguageCodeAndName { LanguageNumber = 0, LanguageName = "日本語 [Japanese]", LanguageCode = "ja-JP" });
12 | Language.Add(new LanguageCodeAndName { LanguageNumber = 1, LanguageName = "English", LanguageCode = "en-US" });
13 | Language.Add(new LanguageCodeAndName { LanguageNumber = 2, LanguageName = "简体中文 [Chinese (Simplified, China)] Beta", LanguageCode = "zh-CN" });
14 | Language.Add(new LanguageCodeAndName { LanguageNumber = 3, LanguageName = "繁體中文 [Chinese (Traditional, Taiwan)] Beta", LanguageCode = "zh-TW" });
15 | Language.Add(new LanguageCodeAndName { LanguageNumber = 4, LanguageName = "Español [Spanish] Beta", LanguageCode = "es-ES" });
16 | Language.Add(new LanguageCodeAndName { LanguageNumber = 5, LanguageName = "हिन्दी [Hindi] Beta", LanguageCode = "hi-IN" });
17 | Language.Add(new LanguageCodeAndName { LanguageNumber = 6, LanguageName = "Русский язык [Russian] Beta", LanguageCode = "ru-RU" });
18 | Language.Add(new LanguageCodeAndName { LanguageNumber = 7, LanguageName = "Deutsch [German] Beta", LanguageCode = "de-DE" });
19 | Language.Add(new LanguageCodeAndName { LanguageNumber = 8, LanguageName = "한국어 [Korean] Beta", LanguageCode = "ko-KR" });
20 | Language.Add(new LanguageCodeAndName { LanguageNumber = 9, LanguageName = "ไทย [Thai] Beta", LanguageCode = "th-TH" });
21 | }
22 | }
23 |
24 | public sealed class LanguageCodeAndName
25 | {
26 | public int LanguageNumber { get; set; }
27 | public string LanguageCode { get; set; }
28 | public string LanguageName { get; set; }
29 | }
30 | }
--------------------------------------------------------------------------------
/OutlookOkan.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.5.33516.290
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OutlookOkan", "OutlookOkan\OutlookOkan.csproj", "{B6B4F2A2-B70A-410C-8E76-1F4090CC438F}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OutlookOkanTest", "OutlookOkanTest\OutlookOkanTest.csproj", "{828251EB-7A92-4559-93F8-BB5F5D8B16A7}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SetupCustomAction", "SetupCustomAction\SetupCustomAction.csproj", "{DE0DDC03-116B-4E2C-AF47-9F06FD99D391}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Release|Any CPU = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {B6B4F2A2-B70A-410C-8E76-1F4090CC438F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {B6B4F2A2-B70A-410C-8E76-1F4090CC438F}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {B6B4F2A2-B70A-410C-8E76-1F4090CC438F}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {B6B4F2A2-B70A-410C-8E76-1F4090CC438F}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {828251EB-7A92-4559-93F8-BB5F5D8B16A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {828251EB-7A92-4559-93F8-BB5F5D8B16A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {828251EB-7A92-4559-93F8-BB5F5D8B16A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {828251EB-7A92-4559-93F8-BB5F5D8B16A7}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {DE0DDC03-116B-4E2C-AF47-9F06FD99D391}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {DE0DDC03-116B-4E2C-AF47-9F06FD99D391}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {DE0DDC03-116B-4E2C-AF47-9F06FD99D391}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {DE0DDC03-116B-4E2C-AF47-9F06FD99D391}.Release|Any CPU.Build.0 = Release|Any CPU
30 | EndGlobalSection
31 | GlobalSection(SolutionProperties) = preSolution
32 | HideSolutionNode = FALSE
33 | EndGlobalSection
34 | GlobalSection(ExtensibilityGlobals) = postSolution
35 | SolutionGuid = {32F32E6B-F48F-4324-A111-5630BC529975}
36 | EndGlobalSection
37 | EndGlobal
38 |
--------------------------------------------------------------------------------
/SetupCustomAction/SetupCustomAction.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {DE0DDC03-116B-4E2C-AF47-9F06FD99D391}
8 | Library
9 | Properties
10 | SetupCustomAction
11 | SetupCustomAction
12 | v4.6.2
13 | 512
14 | true
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | none
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | Component
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/OutlookOkan/Types/CheckList.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class CheckList
6 | {
7 | public List Alerts { get; set; } = new List();
8 | public List ToAddresses { get; set; } = new List();
9 | public List CcAddresses { get; set; } = new List();
10 | public List BccAddresses { get; set; } = new List();
11 | public List Attachments { get; set; } = new List();
12 | public string Sender { get; set; }
13 | public string SenderDomain { get; set; }
14 | public int RecipientExternalDomainNumAll { get; set; }
15 | public string Subject { get; set; }
16 | public string MailType { get; set; }
17 | public string MailBody { get; set; }
18 | public string MailHtmlBody { get; set; }
19 | public bool IsCanNotSendMail { get; set; }
20 | public string CanNotSendMailMessage { get; set; }
21 | public int DeferredMinutes { get; set; }
22 | public string TempFilePath { get; set; }
23 | }
24 |
25 | public sealed class Alert
26 | {
27 | public string AlertMessage { get; set; }
28 | public bool IsImportant { get; set; }
29 | public bool IsWhite { get; set; }
30 | public bool IsChecked { get; set; }
31 | }
32 |
33 | public sealed class Attachment
34 | {
35 | public string FileName { get; set; }
36 | public string FileType { get; set; }
37 | public string FileSize { get; set; }
38 | public string FilePath { get; set; }
39 | public string Open { get; set; }
40 | public bool IsTooBig { get; set; }
41 | public bool IsDangerous { get; set; }
42 | public bool IsEncrypted { get; set; }
43 | public bool IsCanOpen { get; set; }
44 | public bool IsNotMustOpenBeforeCheck { get; set; }
45 | public bool IsChecked { get; set; }
46 | }
47 |
48 | public sealed class Address
49 | {
50 | public string MailAddress { get; set; }
51 | public bool IsExternal { get; set; }
52 | public bool IsWhite { get; set; }
53 | public bool IsSkip { get; set; }
54 | public bool IsChecked { get; set; }
55 | }
56 | }
--------------------------------------------------------------------------------
/OutlookOkan/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 0
36 |
37 |
38 | 0
39 |
40 |
41 | 0
42 |
43 |
44 | 0
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/OutlookOkan/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace OutlookOkan.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
29 | public double ConfirmationWindowWidth {
30 | get {
31 | return ((double)(this["ConfirmationWindowWidth"]));
32 | }
33 | set {
34 | this["ConfirmationWindowWidth"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
41 | public double ConfirmationWindowHeight {
42 | get {
43 | return ((double)(this["ConfirmationWindowHeight"]));
44 | }
45 | set {
46 | this["ConfirmationWindowHeight"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
53 | public double SettingsWindowWidth {
54 | get {
55 | return ((double)(this["SettingsWindowWidth"]));
56 | }
57 | set {
58 | this["SettingsWindowWidth"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
65 | public double SettingsWindowHeight {
66 | get {
67 | return ((double)(this["SettingsWindowHeight"]));
68 | }
69 | set {
70 | this["SettingsWindowHeight"] = value;
71 | }
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/OutlookOkan/Types/AttachmentsSetting.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class AttachmentsSetting
6 | {
7 | public bool IsWarningWhenEncryptedZipIsAttached { get; set; }
8 | public bool IsProhibitedWhenEncryptedZipIsAttached { get; set; }
9 | public bool IsEnableAllAttachedFilesAreDetectEncryptedZip { get; set; }
10 | public bool IsAttachmentsProhibited { get; set; }
11 | public bool IsWarningWhenAttachedRealFile { get; set; }
12 | public bool IsEnableOpenAttachedFiles { get; set; }
13 | public string TargetAttachmentFileExtensionOfOpen { get; set; } = ".pdf,.txt,.csv,.rtf,.htm,.html,.doc,.docx,.xls,.xlm,.xlsm,.xlsx,.ppt,.pptx,.bmp,.gif,.jpg,.jpeg,.png,.tif,.pub,.vsd,.vsdx";
14 | public bool IsMustOpenBeforeCheckTheAttachedFiles { get; set; }
15 | public bool IsIgnoreMustOpenBeforeCheckTheAttachedFilesIfInternalDomain { get; set; }
16 | }
17 |
18 | public sealed class AttachmentsSettingMap : ClassMap
19 | {
20 | public AttachmentsSettingMap()
21 | {
22 | _ = Map(m => m.IsWarningWhenEncryptedZipIsAttached).Index(0).TypeConverterOption
23 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
24 |
25 | _ = Map(m => m.IsProhibitedWhenEncryptedZipIsAttached).Index(1).TypeConverterOption
26 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
27 |
28 | _ = Map(m => m.IsEnableAllAttachedFilesAreDetectEncryptedZip).Index(2).TypeConverterOption
29 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
30 |
31 | _ = Map(m => m.IsAttachmentsProhibited).Index(3).TypeConverterOption
32 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
33 |
34 | _ = Map(m => m.IsWarningWhenAttachedRealFile).Index(4).TypeConverterOption
35 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
36 |
37 | _ = Map(m => m.IsEnableOpenAttachedFiles).Index(5).TypeConverterOption
38 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
39 |
40 | _ = Map(m => m.TargetAttachmentFileExtensionOfOpen).Index(6).Default(".pdf,.txt,.csv,.rtf,.htm,.html,.doc,.docx,.xls,.xlm,.xlsm,.xlsx,.ppt,.pptx,.bmp,.gif,.jpg,.jpeg,.png,.tif,.pub,.vsd,.vsdx");
41 |
42 | _ = Map(m => m.IsMustOpenBeforeCheckTheAttachedFiles).Index(7).TypeConverterOption
43 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
44 |
45 | _ = Map(m => m.IsIgnoreMustOpenBeforeCheckTheAttachedFilesIfInternalDomain).Index(8).TypeConverterOption
46 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/SetupCustomAction/CustomAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Configuration.Install;
4 | using System.Diagnostics;
5 | using System.IO;
6 | using System.Windows;
7 |
8 | namespace SetupCustomAction
9 | {
10 | ///
11 | /// インストーラ用のカスタムアクション
12 | ///
13 | [System.ComponentModel.RunInstaller(true)]
14 | public sealed class CustomAction : Installer
15 | {
16 | ///
17 | /// インストール時のカスタムアクション
18 | ///
19 | /// savedState
20 | public override void Install(IDictionary savedState)
21 | {
22 | base.Install(savedState);
23 |
24 | //msiexec /i "OkanSetup.msi" SILENT=TRUE ALLUSERS=1 /quiet /norestart
25 | //ALLUSERS=1 で、すべてのユーザを対象にインストール
26 | if (Context.Parameters["silent"] == "TRUE") return;
27 |
28 | var outlookProcess = Process.GetProcessesByName("OUTLOOK");
29 | if (outlookProcess.Length <= 0) return;
30 |
31 | _ = MessageBox.Show("Outlookが起動しています。Outlookを終了してからインストールしてください。", "エラー", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.ServiceNotification);
32 | throw new InstallException();
33 | }
34 |
35 | ///
36 | /// アンインストール時のカスタムアクション
37 | ///
38 | /// savedState
39 | public override void Uninstall(IDictionary savedState)
40 | {
41 | base.Uninstall(savedState);
42 |
43 | try
44 | {
45 | //msiexec /x "OkanSetup.msi" DELCONF=TRUE /quiet /norestart
46 | if (Context.Parameters["delconf"] == "TRUE")
47 | {
48 | try
49 | {
50 | var directoryPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Noraneko\\OutlookOkan\\");
51 | Directory.Delete(directoryPath, true);
52 | }
53 | catch (Exception)
54 | {
55 | //Do Nothing.
56 | }
57 |
58 | return;
59 | }
60 |
61 | //msiexec /x "OkanSetup.msi" SILENT=TRUE /quiet /norestart
62 | if (Context.Parameters["silent"] == "TRUE") return;
63 |
64 | var result = MessageBox.Show("設定を削除しますか?", "設定削除の確認", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes, MessageBoxOptions.ServiceNotification);
65 | if (result == MessageBoxResult.Yes)
66 | {
67 | try
68 | {
69 | var directoryPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Noraneko\\OutlookOkan\\");
70 | Directory.Delete(directoryPath, true);
71 | }
72 | catch (Exception)
73 | {
74 | //Do Nothing.
75 | }
76 | }
77 | }
78 | catch (Exception)
79 | {
80 | //Do Nothing.
81 | }
82 | }
83 |
84 | public override void Commit(IDictionary savedState)
85 | {
86 | }
87 |
88 | public override void Rollback(IDictionary savedState)
89 | {
90 | }
91 | }
92 | }
--------------------------------------------------------------------------------
/OutlookOkan/Views/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/OutlookOkan/Handlers/ZipFileHandler.cs:
--------------------------------------------------------------------------------
1 | using ICSharpCode.SharpZipLib.Zip;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 |
6 | namespace OutlookOkan.Handlers
7 | {
8 | public sealed class ZipFileHandler
9 | {
10 | internal readonly List IncludeExtensions = new List();
11 | internal bool IsContainsShortcut;
12 |
13 | ///
14 | /// 暗号化ZIPファイル(パスワード付きZIP)か否かを判定する。
15 | ///
16 | /// 確認したいファイルのフルパス
17 | /// 暗号化ZIPか否か
18 | internal bool CheckZipIsEncryptedAndGetIncludeExtensions(string filePath)
19 | {
20 | //リンクとして添付の場合、実ファイルが存在しない場合がある。
21 | if (!File.Exists(filePath)) return false;
22 |
23 | var isEncrypted = false;
24 |
25 | try
26 | {
27 | using (var zipFile = new ZipFile(filePath))
28 | {
29 | try
30 | {
31 | foreach (ZipEntry entry in zipFile)
32 | {
33 | if (!entry.IsFile) continue;
34 |
35 | if (entry.IsCrypted)
36 | {
37 | isEncrypted = true;
38 | }
39 |
40 | var extension = Path.GetExtension(entry.Name);
41 | IncludeExtensions.Add(extension.ToLower());
42 |
43 | if (!isEncrypted)
44 | {
45 | if (IsShortcutFile(zipFile, entry))
46 | {
47 | IsContainsShortcut = true;
48 | }
49 | }
50 | }
51 | }
52 | catch (NotSupportedException)
53 | {
54 | isEncrypted = true;
55 | }
56 | catch (Exception)
57 | {
58 | //Do nothing
59 | }
60 | }
61 | }
62 | catch (Exception)
63 | {
64 | isEncrypted = false;
65 | }
66 |
67 | return isEncrypted;
68 | }
69 |
70 | private bool IsShortcutFile(ZipFile zipFile, ZipEntry entry)
71 | {
72 | try
73 | {
74 | using (var stream = zipFile.GetInputStream(entry))
75 | {
76 | var buffer = new byte[20];
77 | var bytesRead = stream.Read(buffer, 0, buffer.Length);
78 |
79 | if (bytesRead >= 20)
80 | {
81 | return buffer[0] == 0x4C && buffer[1] == 0x00 && buffer[2] == 0x00 && buffer[3] == 0x00 &&
82 | buffer[4] == 0x01 && buffer[5] == 0x14 && buffer[6] == 0x02 && buffer[7] == 0x00 &&
83 | buffer[8] == 0x00 && buffer[9] == 0x00 && buffer[10] == 0x00 && buffer[11] == 0x00 &&
84 | buffer[12] == 0xC0 && buffer[13] == 0x00 && buffer[14] == 0x00 && buffer[15] == 0x00 &&
85 | buffer[16] == 0x00 && buffer[17] == 0x00 && buffer[18] == 0x00 && buffer[19] == 0x46;
86 | }
87 |
88 | return false;
89 | }
90 | }
91 | catch (Exception)
92 | {
93 | return false;
94 | }
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | おかん for Outlook (メール誤送信防止アドイン)
2 | ========
3 |
4 | English readme is [here](https://github.com/t-miyake/OutlookOkan/blob/master/README_en.md).
5 |
6 | おかん for Outlook (Outlook Okan)は、Microsoft Office Outlook用アドインです。
7 |
8 | 誤送信を防止するため、メールの送信前に確認ウィンドウを表示します。
9 | おかんのように色々心配して確認してくれるアドインです。
10 |
11 | 機密の関わるメールにおいて、完全なオープンソースのため、安心してご利用いただけます。
12 | また、キーワードによる警告や、自動Cc/Bcc追加機能など、便利なオプション機能もあります。
13 |
14 | ダウンロードは[releases](https://github.com/t-miyake/OutlookOkan/releases)からできます。
15 | ※アドイン名を無難なものにしたバージョンも併せて配布しています。
16 |
17 | オープンソースかつ無料でご利用いただけますが、無サポート、無保証です。([ライセンス](https://github.com/t-miyake/OutlookOkan/blob/master/LICENSE))
18 | 専用のカスタマイズやサポートが必要な場合は、個別にご相談ください。
19 |
20 | 送信前の確認ウインドウ
21 | 
22 |
23 | 設定ウィンドウ(一般設定)
24 | 
25 |
26 | 設定ウィンドウ(遅延送信)
27 | 
28 |
29 | 送信禁止通知
30 | 
31 |
32 | バージョン情報
33 | 
34 |
35 | ## 対応環境
36 |
37 | - Windows 7 / 8 / 8.1 / 10 / 11
38 | - Microsoft Outlook 2013 / 2016 / 2019 / 2021 / Microsoft 365 Apps (32bit版 及び 64bit版)
39 | - .NET Framework 4.6.2 以上
40 |
41 | ## 機能一覧(概要)
42 |
43 | - メール送信前の確認など
44 | - メール送信前に確認ウインドウを表示し、全ての項目にチェックしないと送信ができない仕様
45 | - 内部(社内)ドメインへのメールなど、送信前の確認を表示しない設定も可能
46 | - 外部(社外)ドメインは赤文字で表示
47 | - 件名や送信者のアドレス、添付ファイルの一覧、メール本文を表示
48 | - 添付ファイルの添付漏れや大容量の添付ファイルを警告
49 | - 配布リストや連絡先グループを展開して、各宛先を表示 (オン/オフ可)
50 | - 宛先をドメイン別に並べ替えて表示 (オン/オフ可)
51 | - 送信元アドレスを常に自動でCcやBccに追加 (オン/オフ可)
52 |
53 | - 送信禁止機能
54 | - 指定した宛先やドメインへのメール送信を禁止
55 | - 指定したキーワードが本文に含まれるメールの送信を禁止
56 | - 指定した宛先やドメインへの添付ファイル付きメールの送信を禁止
57 | - 添付ファイル付きメールの送信を禁止 (オン/オフ可)
58 | - 連絡先に登録されていない宛先へのメール送信を禁止 (オン/オフ可)
59 | - 宛先(To/Cc)外部ドメイン数が多い場合に、メールの送信を禁止 (オン/オフ可)
60 | - 暗号化ZIPファイルが添付されいている場合に、メールの送信を禁止 (オン/オフ可)
61 | - 送信禁止に該当する場合、禁止の旨とその理由を表示
62 |
63 | - 許可リスト
64 | - 許可リストに登録したドメインやアドレスは、確認画面での項目チェックが不要に
65 |
66 | - 名称と送付先の登録と警告
67 | - メール本文中に登場する名称と、送付先のアドレスやドメインが一致しない場合、警告を表示
68 |
69 | - 警告キーワードの登録と警告
70 | - 登録したキーワードがメール本文や件名に含まれる場合、登録した警告文を表示
71 | - 常に登録した警告メッセージを表示することも可能
72 |
73 | - 警告アドレスの登録と警告
74 | - 登録したアドレスやドメインへメールを送信する際に、警告文を表示
75 | - 警告文を宛先別に設定することも可能
76 |
77 | - 宛先(To/Cc)の外部ドメイン数警告とBccへの自動変換
78 | - 宛先(To/Cc)外部ドメイン数が多い場合の、警告表示
79 | - 宛先(To/Cc)外部ドメイン数が多い場合の、宛先(To/Cc)外部アドレスのBccへの自動変換
80 | - 強制的に全ての宛先をBccに変換
81 |
82 | - 自動Cc/Bcc追加(キーワード)
83 | - 指定したキーワードがメール本文に含まれる場合、指定したアドレスを自動でCcやBccに追加
84 |
85 | - 自動Cc/Bcc追加(宛先)
86 | - 指定した宛先へのメールに、指定したアドレスを自動でCCやBccに追加
87 |
88 | - 自動Cc/Bcc追加(添付ファイル)
89 | - ファイルが添付されたメールに、指定したアドレスを自動でCcやBccに追加
90 |
91 | - 送信遅延(送信保留)
92 | - 設定した時間(分単位)だけ、メールの送信を遅延(保留)
93 | - ドメインやメールアドレス毎に、デフォルトの遅延時間を設定可能
94 |
95 | - 添付ファイル名と宛先の紐づけ
96 | - 添付ファイル名と宛先メールアドレスやドメインを紐づけ、該当しない場合、警告を表示
97 |
98 | - 添付ファイルがある場合の宛先ごとの警告
99 | - 宛先(アドレスやドメイン)ごとに、添付ファイルがある場合の警告文の設定が可能
100 |
101 | - メール本文への文言の自動追加
102 | - メール本文の文頭や末尾に、指定した文言を自動追加可能。
103 |
104 | - 簡易的な受信メールセキュリティ
105 | 受信したメールを開く際の機能
106 | - 件名に指定したキーワードが含まれている場合の警告
107 | - SPFレコードの検証に失敗した場合に警告を表示する。
108 | - DKIMレコードの検証に失敗した場合に警告を表示する。
109 | - 添付ファイルを開く前に警告する。
110 | - 暗号化ZIPファイルを開く際に警告する。
111 | - ZIP内に.lnkファイルがある場合に警告する。
112 | - ZIP内に.oneファイルがある場合に警告する。
113 | - ZIP内に.docm、xlsm、pptmファイルがある場合に警告する。
114 | - マクロが含まれた添付ファイルを開く際に警告する。
115 |
116 | - その他
117 | - 暗号化ZIPファイルが添付されている場合に警告を表示 (オン/オフ可)
118 | - 宛先の強制的なBCCへ変換
119 |
120 | - 設定のインポート/エクスポート
121 | - 設定内容をCSVファイルでインポート/エクスポート
122 | - 全設定の一括インポート/エクスポート
123 |
124 | - 多言語対応
125 | - 日本語や英語など計10言語に対応しており、言語の追加が可能な設計
126 |
127 | ## 使い方
128 |
129 | [Wiki(Manual)](https://github.com/t-miyake/OutlookOkan/wiki/Manual) に記載します。
130 |
131 | ## 既知の不具合
132 |
133 | [Wiki(Known Issues)](https://github.com/t-miyake/OutlookOkan/wiki/Known-Issues) に記載します。
134 |
135 | ## ロードマップ
136 |
137 | [Wiki(Roadmap)](https://github.com/t-miyake/OutlookOkan/wiki/Roadmap) に記載します。
138 |
--------------------------------------------------------------------------------
/OutlookOkan/Types/SecurityForReceivedMail.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper.Configuration;
2 |
3 | namespace OutlookOkan.Types
4 | {
5 | public sealed class SecurityForReceivedMail
6 | {
7 | public bool IsEnableSecurityForReceivedMail { get; set; }
8 | public bool IsEnableAlertKeywordOfSubjectWhenOpeningMailsData { get; set; }
9 | public bool IsEnableMailHeaderAnalysis { get; set; }
10 | public bool IsShowWarningWhenSpfFails { get; set; }
11 | public bool IsShowWarningWhenDkimFails { get; set; }
12 | public bool IsEnableWarningFeatureWhenOpeningAttachments { get; set; }
13 | public bool IsWarnBeforeOpeningAttachments { get; set; }
14 | public bool IsWarnBeforeOpeningEncryptedZip { get; set; }
15 | public bool IsWarnLinkFileInTheZip { get; set; }
16 | public bool IsWarnOneFileInTheZip { get; set; }
17 | public bool IsWarnOfficeFileWithMacroInTheZip { get; set; }
18 | public bool IsWarnBeforeOpeningAttachmentsThatContainMacros { get; set; }
19 | public bool IsShowWarningWhenSpoofingRisk { get; set; }
20 | public bool IsShowWarningWhenDmarcNotImplemented { get; set; }
21 | }
22 |
23 | public sealed class SecurityForReceivedMailMap : ClassMap
24 | {
25 | public SecurityForReceivedMailMap()
26 | {
27 | _ = Map(m => m.IsEnableSecurityForReceivedMail).Index(0).TypeConverterOption
28 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
29 |
30 | _ = Map(m => m.IsEnableAlertKeywordOfSubjectWhenOpeningMailsData).Index(1).TypeConverterOption
31 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
32 |
33 | _ = Map(m => m.IsEnableMailHeaderAnalysis).Index(2).TypeConverterOption
34 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
35 |
36 | _ = Map(m => m.IsShowWarningWhenSpfFails).Index(3).TypeConverterOption
37 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
38 |
39 | _ = Map(m => m.IsShowWarningWhenDkimFails).Index(4).TypeConverterOption
40 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
41 |
42 | _ = Map(m => m.IsEnableWarningFeatureWhenOpeningAttachments).Index(5).TypeConverterOption
43 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
44 |
45 | _ = Map(m => m.IsWarnBeforeOpeningAttachments).Index(6).TypeConverterOption
46 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
47 |
48 | _ = Map(m => m.IsWarnBeforeOpeningEncryptedZip).Index(7).TypeConverterOption
49 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
50 |
51 | _ = Map(m => m.IsWarnLinkFileInTheZip).Index(8).TypeConverterOption
52 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
53 |
54 | _ = Map(m => m.IsWarnOneFileInTheZip).Index(9).TypeConverterOption
55 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
56 |
57 | _ = Map(m => m.IsWarnOfficeFileWithMacroInTheZip).Index(10).TypeConverterOption
58 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
59 |
60 | _ = Map(m => m.IsWarnBeforeOpeningAttachmentsThatContainMacros).Index(11).TypeConverterOption
61 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
62 |
63 | _ = Map(m => m.IsShowWarningWhenSpoofingRisk).Index(12).TypeConverterOption
64 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
65 |
66 | _ = Map(m => m.IsShowWarningWhenDmarcNotImplemented).Index(13).TypeConverterOption
67 | .BooleanValues(true, true, "Yes", "Y").TypeConverterOption.BooleanValues(false, true, "No", "N").Default(false);
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/OutlookOkan/Handlers/CsvFileHandler.cs:
--------------------------------------------------------------------------------
1 | using CsvHelper;
2 | using CsvHelper.Configuration;
3 | using Microsoft.Win32;
4 | using OutlookOkan.Properties;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Globalization;
8 | using System.IO;
9 | using System.Linq;
10 | using System.Text;
11 | using System.Windows;
12 |
13 | namespace OutlookOkan.Handlers
14 | {
15 | internal static class CsvFileHandler
16 | {
17 | private static readonly CsvConfiguration Config = new CsvConfiguration(CultureInfo.CurrentCulture)
18 | {
19 | HasHeaderRecord = false,
20 | MissingFieldFound = null
21 | };
22 |
23 | ///
24 | /// 設定ファイル(CSV)の設置個所は下記で固定。
25 | /// C:\Users\USERNAME\AppData\Roaming\Noraneko\OutlookOkan\
26 | ///
27 | private static readonly string DirectoryPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Noraneko\\OutlookOkan\\");
28 |
29 | internal static List ReadCsv(Type classMapType, string fileName) where T : class
30 | {
31 | var fullPath = Path.Combine(DirectoryPath, fileName);
32 | if (!File.Exists(fullPath))
33 | {
34 | return new List();
35 | }
36 |
37 | using (var reader = new StreamReader(fullPath, Encoding.UTF8))
38 | using (var csv = new CsvReader(reader, Config))
39 | {
40 | csv.Context.RegisterClassMap(classMapType);
41 | return csv.GetRecords().ToList();
42 | }
43 | }
44 |
45 | internal static void AppendCsv(Type classMapType, string fileName, object record)
46 | {
47 | var fullPath = Path.Combine(DirectoryPath, fileName);
48 |
49 | if (!File.Exists(fullPath))
50 | {
51 | var records = new List