├── images
├── Outlook_mail.png
├── outlook_inbox_mod.png
├── vs_gcnotify_publish.png
├── vs_gcnotify_settings.png
└── GOVCERT_RGB_for_outlook.png
├── GOVCERT Outlook Addins
├── GOVCERT Outlook Addins
│ ├── Resources
│ │ ├── ResendError.txt
│ │ ├── NewResendError.txt
│ │ ├── NoSelectionError.txt
│ │ ├── OverWriteConfirm.txt
│ │ ├── NewMailBody.txt
│ │ ├── logo.png
│ │ ├── gcnotify.ico
│ │ ├── SPAMDialogText.txt
│ │ ├── GOVCERT_RGB_for_outlook_48_48.png
│ │ ├── EmailDetails.txt
│ │ ├── SuspectBody.txt
│ │ └── ErrorMail.txt
│ ├── MailDetails.vb
│ ├── MyRules.ruleset
│ ├── RibbonReadMail.xml
│ ├── RibbonNewMail.xml
│ ├── ThisAddIn.Designer.xml
│ ├── RibbonHome.xml
│ ├── PictureConverter.vb
│ ├── My Project
│ │ ├── AssemblyInfo.vb
│ │ ├── Settings.settings
│ │ ├── Settings.Designer.vb
│ │ ├── Resources.Designer.vb
│ │ └── Resources.resx
│ ├── ThisAddIn.vb
│ ├── app.config
│ ├── ThisAddIn.Designer.vb
│ ├── GOVCERT Outlook Addins.vbproj
│ └── GOVCERTOutlookRibbon.vb
└── GOVCERT Outlook Addins.sln
├── CHANGELOG.md
├── .gitignore
├── README.md
└── LICENSE
/images/Outlook_mail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GOVCERT-LU/GCNotify/HEAD/images/Outlook_mail.png
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/ResendError.txt:
--------------------------------------------------------------------------------
1 | Please click "send" to send this email.
--------------------------------------------------------------------------------
/images/outlook_inbox_mod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GOVCERT-LU/GCNotify/HEAD/images/outlook_inbox_mod.png
--------------------------------------------------------------------------------
/images/vs_gcnotify_publish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GOVCERT-LU/GCNotify/HEAD/images/vs_gcnotify_publish.png
--------------------------------------------------------------------------------
/images/vs_gcnotify_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GOVCERT-LU/GCNotify/HEAD/images/vs_gcnotify_settings.png
--------------------------------------------------------------------------------
/images/GOVCERT_RGB_for_outlook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GOVCERT-LU/GCNotify/HEAD/images/GOVCERT_RGB_for_outlook.png
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/NewResendError.txt:
--------------------------------------------------------------------------------
1 | Edit your message and then click "send" to send this email.
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/NoSelectionError.txt:
--------------------------------------------------------------------------------
1 | Please Select at least one email to send. (Make sure no special items were selected.)
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/OverWriteConfirm.txt:
--------------------------------------------------------------------------------
1 | You have entered a text in this Mail.
2 |
3 | By accepting your message will be alterd.
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/NewMailBody.txt:
--------------------------------------------------------------------------------
1 | [Please add your inquiry here]
2 |
3 | HostDetails
4 | {{HostDetails}}
5 | {{NetworkDetails}}
6 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GOVCERT-LU/GCNotify/HEAD/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/logo.png
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/gcnotify.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GOVCERT-LU/GCNotify/HEAD/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/gcnotify.ico
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/SPAMDialogText.txt:
--------------------------------------------------------------------------------
1 | The email from: {{Email}} with the subject {{Subject}} was already detected as SPAM.
2 |
3 | Do you realy want to send this email to GOVCERT?
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/GOVCERT_RGB_for_outlook_48_48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GOVCERT-LU/GCNotify/HEAD/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/GOVCERT_RGB_for_outlook_48_48.png
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/EmailDetails.txt:
--------------------------------------------------------------------------------
1 |
2 | ----------------------Email {{EmailCounter}} - DETAILS --------------------------
3 | <{{From}}> [{{Subject}}]
4 | Header Information:
5 | {{HeaderDetails}}
6 |
7 | Number Of Attachments
8 | {{AttachmentCount}}
9 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/SuspectBody.txt:
--------------------------------------------------------------------------------
1 | Dear GOVCERT,
2 |
3 | I want to forward the following emails to be analysed, as I found they look suspicious.
4 |
5 | Attachment(s):
6 | {{attachments}}
7 |
8 | HostDetails
9 | {{HostDetails}}
10 | {{NetworkDetails}}
11 |
12 | With best regards,
13 |
14 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/Resources/ErrorMail.txt:
--------------------------------------------------------------------------------
1 | An unexpected Error occured in GCNotify!
2 |
3 | Please send this email. This will help to improve GCNotify.
4 |
5 |
6 | Details
7 | -------
8 | GCNotify - {{Version}}
9 |
10 | Message
11 | -------
12 | {{Message}}
13 |
14 | Exception Details
15 | ----------
16 | {{ExceptionDetails}}
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/MailDetails.vb:
--------------------------------------------------------------------------------
1 | Public Class MailDetails
2 | Public HeaderInformations As String()
3 | Public From As String
4 | Public Subject As String
5 | Public NumberOfAttachments As Integer
6 |
7 | Public Function GetSubjectLine() As String
8 | Return "[" + Me.Subject + "] from: " + Me.From
9 | End Function
10 |
11 | End Class
12 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/MyRules.ruleset:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/RibbonReadMail.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/RibbonNewMail.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/ThisAddIn.Designer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/RibbonHome.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
13 |
14 |
15 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/PictureConverter.vb:
--------------------------------------------------------------------------------
1 | ' Source: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/aa338202(v=office.12)'
2 |
3 | Imports System.Windows.Forms
4 |
5 | 'Prevention from opening with the designer'
6 |
7 | Public Class PictureConverter
8 | Inherits AxHost
9 |
10 | Private Sub New()
11 | MyBase.New(String.Empty)
12 | End Sub
13 |
14 | Public Shared Function ImageToPictureDisp(ByVal image As System.Drawing.Image) As stdole.IPictureDisp
15 | Return CType(GetIPictureDispFromPicture(image), stdole.IPictureDisp)
16 | End Function
17 |
18 | Public Shared Function IconToPictureDisp(ByVal icon As System.Drawing.Icon) As stdole.IPictureDisp
19 | Return ImageToPictureDisp(icon.ToBitmap())
20 | End Function
21 |
22 | Public Shared Function PictureDispToImage(ByVal picture As stdole.IPictureDisp) As System.Drawing.Image
23 | Return GetPictureFromIPicture(picture)
24 | End Function
25 |
26 | End Class
27 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 | All notable changes to this project will be documented in this file.
3 |
4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6 |
7 | ## [Unreleased]
8 |
9 | ## [1.7.0] - 2019-06-14
10 |
11 | ### Added
12 |
13 | ### Changed
14 |
15 | ### Fixed
16 | - Empty subject issue
17 |
18 | ## [1.6.0] - 2019-06-01
19 |
20 | ### Added
21 | - Improved error handling
22 |
23 | ### Changed
24 | - General Clean up
25 |
26 | ### Fixed
27 |
28 | ## [1.5.0] - 2019-05-22
29 | ### Added
30 | - This CHANGELOG file
31 | - New Images for the readme
32 | - Increased the customization possibilities
33 | - New Logo
34 | - Header information will be visible in the email
35 | - New placeholders for templates
36 | - Sending to CC and BCC possible
37 |
38 | ### Changed
39 | - Addaped Readme to the new environment
40 | - Refactored code (More methods less complex logic)
41 |
42 |
43 | ### Fixed
44 | - Sending the wrong Email
45 |
46 | ## [1.4.0] - 2019-01-18
47 | - Inital Release
48 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GOVCERT Outlook Addins", "GOVCERT Outlook Addins\GOVCERT Outlook Addins.vbproj", "{2F006B14-34F3-4C4E-8D4D-4061B558553D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {2F006B14-34F3-4C4E-8D4D-4061B558553D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {2F006B14-34F3-4C4E-8D4D-4061B558553D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {2F006B14-34F3-4C4E-8D4D-4061B558553D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {2F006B14-34F3-4C4E-8D4D-4061B558553D}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {99934AFF-BF0F-4C12-8DD2-57C700D0E1C8}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pfx
2 | Govcert Outlook Addins/GovcertOutlookAddins/bin/Debug/*
3 | Govcert Outlook Addins/GovcertOutlookAddins/obj/Debug/*
4 | Govcert Outlook Addins/GovcertOutlookAddins/bin/Release/*
5 | Govcert Outlook Addins/GovcertOutlookAddins/obj/Release/*
6 | Govcert Outlook Addins/Govcert Outlook Addins Installer/Debug/*
7 | Govcert Outlook Addins/Govcert Outlook Addins Remover/bin/Debug/*
8 | Govcert Outlook Addins/Govcert Outlook Addins Remover/bin/Release/*
9 | Govcert Outlook Addins/Govcert Outlook Addins Remover/obj/Debug/*
10 | Govcert Outlook Addins/Govcert Outlook Addins Remover/obj/Release/*
11 | Govcert Outlook Addins/GovcertOutlookAddins/obj/Debug/*
12 | Govcert Outlook Addins/GovcertOutlookAddins/obj/Release/*
13 | Govcert Outlook Addins/GovcertOutlookAddins/Ribbon1.resx
14 | Govcert Outlook Addins/deploy/
15 | Govcert Outlook Addins/Govcert Outlook Addins Remover/publish/*
16 | Govcert Outlook Addins/Govcert VSTO Cert Installer/bin/*
17 | Govcert Outlook Addins/Govcert VSTO Cert Installer/obj/*
18 | Govcert Outlook Addins/Govcert Outlook Addins Nutshell/bin/Debug/*
19 | Govcert Outlook Addins/Govcert Outlook Addins Nutshell/bin/Release/*
20 | Govcert Outlook Addins/Govcert Outlook Addins Nutshell/obj/Debug/*
21 | Govcert Outlook Addins/Govcert Outlook Addins Nutshell/obj/Release/*
22 | Govcert Outlook Addins/Govcert Outlook Addins Nutshell/Form1.Designer.cs
23 | Govcert Outlook Addins/Govcert Outlook Addins Nutshell/Form1.cs
24 | Govcert Outlook Addins/.vs/*
25 |
26 |
27 | GOVCERT Outlook Addins/GOVCERT Outlook Addins/bin/*
28 | GOVCERT Outlook Addins/GOVCERT Outlook Addins/obj/*
29 | GOVCERT Outlook Addins/GOVCERT Outlook Addins/publish/*
30 |
31 | *.user
32 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 | Imports System.Security
5 |
6 | ' General Information about an assembly is controlled through the following
7 | ' set of attributes. Change these attribute values to modify the information
8 | ' associated with an assembly.
9 |
10 | ' Review the values of the assembly attributes
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | ' Setting ComVisible to false makes the types in this assembly not visible
20 | ' to COM components. If you need to access a type in this assembly from
21 | ' COM, set the ComVisible attribute to true on that type.
22 |
23 |
24 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
25 |
26 |
27 | ' Version information for an assembly consists of the following four values:
28 | '
29 | ' Major Version
30 | ' Minor Version
31 | ' Build Number
32 | ' Revision
33 | '
34 | ' You can specify all the values or you can default the Build and Revision Numbers
35 | ' by using the '*' as shown below:
36 | '
37 |
38 |
39 |
40 |
41 | Friend Module DesignTimeConstants
42 | Public Const RibbonTypeSerializer As String = "Microsoft.VisualStudio.Tools.Office.Ribbon.Serialization.RibbonTypeCodeDomSerializer, Microsoft.VisualStudio.Tools.Office.Designer, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
43 | Public Const RibbonBaseTypeSerializer As String = "System.ComponentModel.Design.Serialization.TypeCodeDomSerializer, System.Design"
44 | Public Const RibbonDesigner As String = "Microsoft.VisualStudio.Tools.Office.Ribbon.Design.RibbonDesigner, Microsoft.VisualStudio.Tools.Office.Designer, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
45 | End Module
46 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | GOVCERT.LU SOC <soc@govcert.etat.lu>
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | GOVCERT.LU SUPPORT <support@govcert.etat.lu>
16 |
17 |
18 | GOVCERT.LU Tools
19 |
20 |
21 | Reports the mail to GOVCERT.LU and requests an analysis!
22 |
23 |
24 | Report Mail
25 |
26 |
27 | Received,Return-Path,X-PMX-Spam,Authentication-Results,Received-SPF,X-Sender,User-Agent,X-Sender,X-Authenticated-Sender,From
28 |
29 |
30 | etat.lu
31 |
32 |
33 | [GC-OBT]
34 |
35 |
36 | SOC Request
37 |
38 |
39 | SPAM
40 |
41 |
42 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/ThisAddIn.vb:
--------------------------------------------------------------------------------
1 | ' Copyright (C) 2018, CERT Gouvernemental (GOVCERT.LU) '
2 | ' Author: Jean-Paul Weber '
3 |
4 | 'This file is part of GC-Notify.'
5 | ''
6 | 'GC-Notify is free software: you can redistribute it and/or modify'
7 | 'it under the terms of the GNU General Public License as published by'
8 | 'the Free Software Foundation, either version 3 of the License, or'
9 | '(at your option) any later version.'
10 | ''
11 | 'GC-Notify is distributed in the hope that it will be useful,'
12 | 'but WITHOUT ANY WARRANTY; without even the implied warranty of'
13 | 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the'
14 | 'GNU General Public License for more details.'
15 | ''
16 | 'You should have received a copy of the GNU General Public License'
17 | 'along with GC-Notify. If not, see .'
18 | '
19 |
20 |
21 | Public Class ThisAddIn
22 |
23 | Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
24 |
25 | ' Remove Keys for office 2016 '
26 | RemoveLoadingTimesKeys("16.0")
27 | ' Remove Keys for office 2013 '
28 | RemoveLoadingTimesKeys("15.0")
29 | ' Remove Keys for office 2010 '
30 | RemoveLoadingTimesKeys("14.0")
31 | ' Programmatically determine the current Outlook item '
32 | End Sub
33 |
34 | Private Sub RemoveLoadingTimesKeys(outlookVersion As String)
35 | ' Remove loading times -> Workaround '
36 | Dim outlookBase As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Office\" + outlookVersion + "\Outlook", True)
37 | ' If the key does not exit then the returned value is Nothing '
38 | If Not outlookBase Is Nothing Then
39 | Dim addinsKey As Microsoft.Win32.RegistryKey = outlookBase.OpenSubKey("Addins\Govcert Outlook Addins", True)
40 | If Not addinsKey Is Nothing Then
41 | For Each valueKey As String In addinsKey.GetValueNames
42 | addinsKey.DeleteValue(valueKey)
43 | Next
44 | addinsKey.Close()
45 | End If
46 | ' Note: Under AddInLoadTimes are also stored loading times however they don't provoke the disabling as they store only the 3 last loading times :/ '
47 | outlookBase.Close()
48 | End If
49 |
50 | End Sub
51 |
52 | Private Sub ThisAddIn_Shutdown() Handles Me.Shutdown
53 |
54 | End Sub
55 |
56 | Protected Overrides Function CreateRibbonExtensibilityObject() As Microsoft.Office.Core.IRibbonExtensibility
57 | Return New GOVCERTOutlookRibbon()
58 | End Function
59 |
60 | End Class
61 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/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 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | GOVCERT.LU SOC <soc@govcert.etat.lu>
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | GOVCERT.LU SUPPORT <support@govcert.etat.lu>
43 |
44 |
45 | GOVCERT.LU Tools
46 |
47 |
48 | Reports the mail to GOVCERT.LU and requests an analysis!
49 |
50 |
51 | Report Mail
52 |
53 |
54 | Received,Return-Path,X-PMX-Spam,Authentication-Results,Received-SPF,X-Sender,User-Agent,X-Sender,X-Authenticated-Sender,From
55 |
56 |
57 | etat.lu
58 |
59 |
60 | [GC-OBT]
61 |
62 |
63 | SOC Request
64 |
65 |
66 | SPAM
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
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 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 |
16 | _
19 | Partial Friend NotInheritable Class MySettings
20 | Inherits Global.System.Configuration.ApplicationSettingsBase
21 |
22 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
23 |
24 | #Region "My.Settings Auto-Save Functionality"
25 | #If _MyType = "WindowsForms" Then
26 | Private Shared addedHandler As Boolean
27 |
28 | Private Shared addedHandlerLockObject As New Object
29 |
30 | _
31 | Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
32 | If My.Application.SaveMySettingsOnExit Then
33 | My.Settings.Save()
34 | End If
35 | End Sub
36 | #End If
37 | #End Region
38 |
39 | Public Shared ReadOnly Property [Default]() As MySettings
40 | Get
41 |
42 | #If _MyType = "WindowsForms" Then
43 | If Not addedHandler Then
44 | SyncLock addedHandlerLockObject
45 | If Not addedHandler Then
46 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
47 | addedHandler = True
48 | End If
49 | End SyncLock
50 | End If
51 | #End If
52 | Return defaultInstance
53 | End Get
54 | End Property
55 |
56 | ")> _
59 | Public ReadOnly Property SOC_MAIL() As String
60 | Get
61 | Return CType(Me("SOC_MAIL"),String)
62 | End Get
63 | End Property
64 |
65 | _
68 | Public ReadOnly Property SOC_MAIL_CC() As String
69 | Get
70 | Return CType(Me("SOC_MAIL_CC"),String)
71 | End Get
72 | End Property
73 |
74 | _
77 | Public ReadOnly Property SOC_MAIL_BCC() As String
78 | Get
79 | Return CType(Me("SOC_MAIL_BCC"),String)
80 | End Get
81 | End Property
82 |
83 | ")> _
86 | Public ReadOnly Property SUPPORT_MAIL() As String
87 | Get
88 | Return CType(Me("SUPPORT_MAIL"),String)
89 | End Get
90 | End Property
91 |
92 | _
95 | Public ReadOnly Property GROUP_LABEL() As String
96 | Get
97 | Return CType(Me("GROUP_LABEL"),String)
98 | End Get
99 | End Property
100 |
101 | _
104 | Public ReadOnly Property SUPERTIP_LABEL() As String
105 | Get
106 | Return CType(Me("SUPERTIP_LABEL"),String)
107 | End Get
108 | End Property
109 |
110 | _
113 | Public ReadOnly Property BTN_LABEL() As String
114 | Get
115 | Return CType(Me("BTN_LABEL"),String)
116 | End Get
117 | End Property
118 |
119 | _
123 | Public ReadOnly Property INTERESTING_HEADER_FIELDS() As String
124 | Get
125 | Return CType(Me("INTERESTING_HEADER_FIELDS"),String)
126 | End Get
127 | End Property
128 |
129 | _
132 | Public ReadOnly Property EXCLUDED_HEADER_DOMAIN() As String
133 | Get
134 | Return CType(Me("EXCLUDED_HEADER_DOMAIN"),String)
135 | End Get
136 | End Property
137 |
138 | _
141 | Public ReadOnly Property SOC_MAIL_SUBJECT_TAG() As String
142 | Get
143 | Return CType(Me("SOC_MAIL_SUBJECT_TAG"),String)
144 | End Get
145 | End Property
146 |
147 | _
150 | Public ReadOnly Property SOC_NEW_MAIL_Subject() As String
151 | Get
152 | Return CType(Me("SOC_NEW_MAIL_Subject"),String)
153 | End Get
154 | End Property
155 |
156 | _
159 | Public ReadOnly Property SPAM_TAG() As String
160 | Get
161 | Return CType(Me("SPAM_TAG"),String)
162 | End Get
163 | End Property
164 | End Class
165 |
166 | Namespace My
167 |
168 | _
171 | Friend Module MySettingsProperty
172 |
173 | _
174 | Friend ReadOnly Property Settings() As Global.GOVCERT_Outlook_Addins.MySettings
175 | Get
176 | Return Global.GOVCERT_Outlook_Addins.MySettings.Default
177 | End Get
178 | End Property
179 | End Module
180 | End Namespace
181 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
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 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'This class was auto-generated by the StronglyTypedResourceBuilder
19 | 'class via a tool like ResGen or Visual Studio.
20 | 'To add or remove a member, edit your .ResX file then rerun ResGen
21 | 'with the /str option, or rebuild your VS project.
22 | '''
23 | ''' A strongly-typed resource class, for looking up localized strings, etc.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Returns the cached ResourceManager instance used by this class.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("GOVCERT_Outlook_Addins.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Overrides the current thread's CurrentUICulture property for all
51 | ''' resource lookups using this strongly typed resource class.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 |
63 | '''
64 | ''' Looks up a localized string similar to 3.0.6.0.
65 | '''
66 | Friend ReadOnly Property BTN_VERSIION() As String
67 | Get
68 | Return ResourceManager.GetString("BTN_VERSIION", resourceCulture)
69 | End Get
70 | End Property
71 |
72 | '''
73 | ''' Looks up a localized string similar to
74 | '''----------------------Email {{EmailCounter}} - DETAILS --------------------------
75 | '''<{{From}}> [{{Subject}}]
76 | '''Header Information:
77 | '''{{HeaderDetails}}
78 | '''
79 | '''Number Of Attachments
80 | '''{{AttachmentCount}}
81 | '''.
82 | '''
83 | Friend ReadOnly Property EmailDetails() As String
84 | Get
85 | Return ResourceManager.GetString("EmailDetails", resourceCulture)
86 | End Get
87 | End Property
88 |
89 | '''
90 | ''' Looks up a localized string similar to An unexpected Error occured in GCNotify!
91 | '''
92 | '''Please send this email. This will help to improve GCNotify.
93 | '''
94 | '''
95 | '''Details
96 | '''-------
97 | '''GCNotify - {{Version}}
98 | '''
99 | '''Message
100 | '''-------
101 | '''{{Message}}
102 | '''
103 | '''Exception Details
104 | '''----------
105 | '''{{ExceptionDetails}}.
106 | '''
107 | Friend ReadOnly Property ErrorMail() As String
108 | Get
109 | Return ResourceManager.GetString("ErrorMail", resourceCulture)
110 | End Get
111 | End Property
112 |
113 | '''
114 | ''' Looks up a localized resource of type System.Drawing.Bitmap.
115 | '''
116 | Friend ReadOnly Property logo() As System.Drawing.Bitmap
117 | Get
118 | Dim obj As Object = ResourceManager.GetObject("logo", resourceCulture)
119 | Return CType(obj,System.Drawing.Bitmap)
120 | End Get
121 | End Property
122 |
123 | '''
124 | ''' Looks up a localized string similar to [Please add your inquiry here]
125 | '''
126 | '''HostDetails
127 | '''{{HostDetails}}
128 | '''{{NetworkDetails}}
129 | '''.
130 | '''
131 | Friend ReadOnly Property NewMailBody() As String
132 | Get
133 | Return ResourceManager.GetString("NewMailBody", resourceCulture)
134 | End Get
135 | End Property
136 |
137 | '''
138 | ''' Looks up a localized string similar to Edit your message and then click "send" to send this email..
139 | '''
140 | Friend ReadOnly Property NewResendError() As String
141 | Get
142 | Return ResourceManager.GetString("NewResendError", resourceCulture)
143 | End Get
144 | End Property
145 |
146 | '''
147 | ''' Looks up a localized string similar to Please Select at least one email to send. (Make sure no special items were selected.).
148 | '''
149 | Friend ReadOnly Property NoSelectionError() As String
150 | Get
151 | Return ResourceManager.GetString("NoSelectionError", resourceCulture)
152 | End Get
153 | End Property
154 |
155 | '''
156 | ''' Looks up a localized string similar to You have entered a text in this Mail.
157 | '''
158 | '''By accepting your message will be alterd..
159 | '''
160 | Friend ReadOnly Property OverWriteConfirm() As String
161 | Get
162 | Return ResourceManager.GetString("OverWriteConfirm", resourceCulture)
163 | End Get
164 | End Property
165 |
166 | '''
167 | ''' Looks up a localized string similar to Please click "send" to send this email..
168 | '''
169 | Friend ReadOnly Property ResendError() As String
170 | Get
171 | Return ResourceManager.GetString("ResendError", resourceCulture)
172 | End Get
173 | End Property
174 |
175 | '''
176 | ''' Looks up a localized string similar to The email from: {{Email}} with the subject {{Subject}} was already detected as SPAM.
177 | '''
178 | '''Do you realy want to send this email to GOVCERT?.
179 | '''
180 | Friend ReadOnly Property SPAMDialogText() As String
181 | Get
182 | Return ResourceManager.GetString("SPAMDialogText", resourceCulture)
183 | End Get
184 | End Property
185 |
186 | '''
187 | ''' Looks up a localized string similar to Dear GOVCERT,
188 | '''
189 | '''I want to forward the following emails to be analysed, as I found they look suspicious.
190 | '''
191 | '''Attachment(s):
192 | '''{{attachments}}
193 | '''
194 | '''HostDetails
195 | '''{{HostDetails}}
196 | '''{{NetworkDetails}}
197 | '''
198 | '''With best regards,
199 | '''
200 | '''.
201 | '''
202 | Friend ReadOnly Property SuspectBody() As String
203 | Get
204 | Return ResourceManager.GetString("SuspectBody", resourceCulture)
205 | End Get
206 | End Property
207 | End Module
208 | End Namespace
209 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\EmailDetails.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
123 |
124 |
125 | ..\Resources\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\NewMailBody.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
129 |
130 |
131 | ..\Resources\NewResendError.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1
132 |
133 |
134 | ..\Resources\NoSelectionError.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
135 |
136 |
137 | ..\Resources\OverWriteConfirm.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
138 |
139 |
140 | ..\Resources\ResendError.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
141 |
142 |
143 | ..\Resources\SPAMDialogText.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
144 |
145 |
146 | ..\Resources\SuspectBody.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
147 |
148 |
149 | 3.0.6.0
150 | Version of the application
151 |
152 |
153 | ..\Resources\ErrorMail.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
154 |
155 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Index
4 | - [GCNotify](#outlook-add-in-gcnotify)
5 | - [Functionalities](#functionalities)
6 | - [Features](#features)
7 | - [Add-in Button Locations](#add-in-button-locations)
8 | - [Example Email](#example-email)
9 | - [Development](#development)
10 | - [Requirements](#requirements)
11 | - [Customisations](#customisations)
12 | - [Templates/Icon](#templatesicon)
13 | - [Settings](#settings)
14 | - [Building](#building)
15 | - [Distribution](#distribution)
16 | - [Contribute](#contribute)
17 | - [LICENSE](#license)
18 |
19 | # Outlook Add-in: GCNotify
20 |
21 | GCNotify is an Outlook Add-in to facilitate the forwarding of suspicious emails to an IT-security team.
22 |
23 | It creates a new email with the selected or viewed email as attachment with additional informations (e.g. SMTP Header elements). This is to ease the work of security analysts and users:
24 |
25 | * For the end user:
26 | * does not need to forward the suspicious email as attachment as a new email (this would take multiple steps).
27 | * sends it to the right IT-security team addresses
28 | * For the analysts:
29 | * no need to request the original email to be forwarded as attachment
30 | * additional preprocessed data added
31 |
32 | This ease of use for the end user will provide the IT-security team to have a greater overview of threats as user are more likely to report suspicious emails.
33 |
34 | The VSTO is works with Outlook 2013, 2016 and 2019.
35 |
36 |
37 |
38 |
39 | ## Functionalities
40 | The user has to select one or more emails from their inbox or an opened email.
41 | The Add-in creates a new email with the selected emails as attachment and adds a predefined body based on templates.
42 | The destination and subject of this new email will also be pre-filled as defined in the settings of the Add-in.
43 | The only action a user has to trigger is hit "Send".
44 |
45 | For transparency purposes the email is not sent without the users consent.
46 | This also allows the user to add additional comments and also displays what will be send to the IT-security team.
47 |
48 | ## Features
49 | * Easy to use
50 | * Sends one or multiple emails as attachment
51 | * Customisable
52 |
53 | ## Add-in Button Locations
54 | The Add-in will add icons in the following ribbons in Outlook
55 |
56 | * Home
57 | * NewMail
58 | * ReadMail
59 | * Send/Receive
60 |
61 | 
62 |
63 | ## Example Email
64 |
65 |
66 | # Development
67 | The code is written in Visual Basic
68 |
69 | ## Requirements
70 | * Visual Studio 2019 enterprise or community edition
71 |
72 | ## Customisations
73 | The following section describes how GCNotify can be adjusted to your needs without modifying the source code.
74 |
75 | ### Settings
76 | The settings section in Visual Studio allows you to adjust GCNotify.
77 | This section describes the different settings and which ones are required for the plug-in to work.
78 |
79 | 
80 |
81 | |**Name**|**Default Value**|**Description**|**Required/Optional**|
82 | |--------|-----------------|---------------|---------------------|
83 | |SOC_MAIL | soc@govcert.etat.lu | The main email address of the IT-security team. In the generated email this will be the `TO` field. |Required|
84 | |SOC_MAIL_CC | | Email address which should receive a carbon copy. If left empty ('') it will be ignored. In the generated email this will be the `CC` field. |Optional|
85 | |SOC_MAIL_BCC | | Email address which should receive a blind carbon copy. If left empty ('') it will be ignored. In the generated email this will be the `BCC` field. |Optional|
86 | |SUPPORT_MAIL | support@govcert.etat.lu | The email address to send errors to. This destination is used when an Exception is thrown. |Required|
87 | |GROUP_LABEL | GOVCERT.LU Tools | The label of the ribbon group | Required |
88 | |BTN_SUPPERTIP_LABEL | Reports the mail to GOVCERT.LU and requests an analysis | The label of the supertip, when hovering over the button | Required |
89 | |BTN_LABEL | Report Mail | The label of the button itself | Required |
90 | |INTERESTING_HEADER_FIELDS | Received,Return-Path,X-PMX-Spam,Authentication-Results,Received-SPF,X-Sender,User-Agent,X-Sender,X-Authenticated-Sender,From | The header fields of the email which should be visible in the email. **NOTE**: The values are comma separated. | Required |
91 | |SOC_MAIL_SUBJECT_TAG | [GC-OBT] | The tag used in the subject | Required |
92 | |SOC_NEW_MAIL_Subject | SOC Request | The default subject of an empty email | Required |
93 | |SPAM_TAG | SPAM | The tag used of the email system, when the mail was detected as SPAM. This tag is used to open a confirmation dialog in order to make sure the user really wants to send this email | Required |
94 |
95 | **Note:** Required means that the setting must not be empty.
96 |
97 | Alternatively they can also be changed in the *app.config* file. This is an XML file where settings are represented as follows:
98 |
99 | ```XML
100 |
101 | SPAM
102 |
103 | ```
104 |
105 | ### Templates/Icon
106 | The templates can be found in the resource section of the project or in the **Resources** folder. The text files represent the different templates.
107 |
108 | |**Filename**|**Description**|**Placeholders**|
109 | |------------|---------------|----------------|
110 | |EmailDetails.txt | Representation of the extracted information of forwarded email(s)| **{{EmailCounter}}** - Index of attached emails **{{From}}** - Email sender **{{HeaderDetails}}** - The extracted header information (Depends on **INTERESTING_HEADER_FIELDS**) **{{Subject}}** - Email subject **{{AttachmentCount}}** - Amount of attachments in the email |
111 | |ErrorMail.txt | Email body template in case of an exception| **{{Version}}** - Version of GCNotify **{{Message}}** - Exception message **{{Stacktrace}}** - Exception stack trace |
112 | |NewMailBody.txt | Email body template for a new empty email | **{{HostDetails}}** - Details of the host **{{NetworkDetails}}** - Network details fo the host|
113 | |OverWriteConfirm.txt | Message displayed if a user has opened a new email window, filled in some content and then hit the button. In order not to overwrite the information a user has already entered, the user is asked whether this information shall be overwritten or not. | |
114 | |ResendError.txt | Message displayed in case a user hits the GCNotify button in the composing window of the reporting email | |
115 | |SPAMDialogText.txt | Message displayed when an email tagged as spam is within the selection of the emails to be forwarded | **{{Email}}** - Email of the sender **{{Subject}}** - Subject of the email|
116 | |SuspectBody.txt | Email body template for a report email | **{{attachments}}** - The place where the email details should be placed within the body (see EmailDetails.txt) **{{HostDetails}}** - Details of the host **{{NetworkDetails}}** - Network details of the host|
117 |
118 | **Note:** The Icon can also be changed in a similar fashion.
119 |
120 | ## Building
121 |
122 | MSBuild should be in the PATH variable of Windows, if not it is located here:
123 |
124 | > C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin
125 |
126 | Go to the folder of the downloaded code and execute:
127 | ```
128 | > cd "GOVCERT Outlook Addins"
129 | ```
130 | And run:
131 | ```
132 | > msbuild "GOVCERT Outlook Addins.vbproj" /t:Publish /p:PublishDir="publish/" /p:Configuration=Release
133 | ```
134 | Then the compiled OneClick Solution should be now be located in:
135 |
136 | > GOVCERT Outlook Addins\publish
137 |
138 | It can also be generated via Visual Studio's internal publication functionality
139 |
140 | 
141 |
142 |
143 | ### Distribution
144 | The project should be signed; this can be configured in the properties / signing tab. If you want the plugin to outlive your certificate's validity period, you should consider setting up timestamping ("Timestamp server URL" field).
145 |
146 | The compiled solution can be distributed via the OneClick Solution or manually.
147 |
148 |
149 |
150 | # Contribute
151 |
152 | Please do contribute! Issues and pull requests are welcome.
153 |
154 |
155 | # LICENSE
156 |
157 | Copyright (C) 2018, CERT Gouvernemental (GOVCERT.LU)
158 |
159 | GC-Notify is free software: you can redistribute it and/or modify
160 | it under the terms of the GNU General Public License as published by
161 | the Free Software Foundation, either version 3 of the License, or
162 | (at your option) any later version.
163 |
164 | GC-Notify is distributed in the hope that it will be useful,
165 | but WITHOUT ANY WARRANTY; without even the implied warranty of
166 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
167 | GNU General Public License for more details.
168 |
169 | You should have received a copy of the GNU General Public License
170 | along with GC-Notify. If not, see .
171 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/ThisAddIn.Designer.vb:
--------------------------------------------------------------------------------
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 | Option Strict Off
12 | Option Explicit On
13 |
14 |
15 |
16 | '''
17 | _
19 | Partial Public NotInheritable Class ThisAddIn
20 | Inherits Microsoft.Office.Tools.Outlook.OutlookAddInBase
21 |
22 | Friend WithEvents CustomTaskPanes As Microsoft.Office.Tools.CustomTaskPaneCollection
23 |
24 | _
25 | Friend WithEvents Application As Microsoft.Office.Interop.Outlook.Application
26 |
27 | '''
28 | _
30 | Public Sub New(ByVal factory As Global.Microsoft.Office.Tools.Outlook.Factory, ByVal serviceProvider As Global.System.IServiceProvider)
31 | MyBase.New(factory, serviceProvider, "AddIn", "ThisAddIn")
32 | Globals.Factory = factory
33 | End Sub
34 |
35 | '''
36 | _
39 | Protected Overrides Sub Initialize()
40 | MyBase.Initialize()
41 | Me.Application = Me.GetHostItem(Of Microsoft.Office.Interop.Outlook.Application)(GetType(Microsoft.Office.Interop.Outlook.Application), "Application")
42 | Globals.ThisAddIn = Me
43 | Global.System.Windows.Forms.Application.EnableVisualStyles()
44 | Me.InitializeCachedData()
45 | Me.InitializeControls()
46 | Me.InitializeComponents()
47 | Me.InitializeData()
48 | End Sub
49 |
50 | '''
51 | _
54 | Protected Overrides Sub FinishInitialization()
55 | Me.OnStartup()
56 | End Sub
57 |
58 | '''
59 | _
62 | Protected Overrides Sub InitializeDataBindings()
63 | Me.BeginInitialization()
64 | Me.BindToData()
65 | Me.EndInitialization()
66 | End Sub
67 |
68 | '''
69 | _
72 | Private Sub InitializeCachedData()
73 | If (Me.DataHost Is Nothing) Then
74 | Return
75 | End If
76 | If Me.DataHost.IsCacheInitialized Then
77 | Me.DataHost.FillCachedData(Me)
78 | End If
79 | End Sub
80 |
81 | '''
82 | _
85 | Private Sub InitializeData()
86 | End Sub
87 |
88 | '''
89 | _
92 | Private Sub BindToData()
93 | End Sub
94 |
95 | '''
96 | _
98 | Private Sub StartCaching(ByVal MemberName As String)
99 | Me.DataHost.StartCaching(Me, MemberName)
100 | End Sub
101 |
102 | '''
103 | _
105 | Private Sub StopCaching(ByVal MemberName As String)
106 | Me.DataHost.StopCaching(Me, MemberName)
107 | End Sub
108 |
109 | '''
110 | _
112 | Private Function IsCached(ByVal MemberName As String) As Boolean
113 | Return Me.DataHost.IsCached(Me, MemberName)
114 | End Function
115 |
116 | '''
117 | _
120 | Private Sub BeginInitialization()
121 | Me.BeginInit()
122 | Me.CustomTaskPanes.BeginInit()
123 | End Sub
124 |
125 | '''
126 | _
129 | Private Sub EndInitialization()
130 | Me.CustomTaskPanes.EndInit()
131 | Me.EndInit()
132 | End Sub
133 |
134 | '''
135 | _
138 | Private Sub InitializeControls()
139 | Me.CustomTaskPanes = Globals.Factory.CreateCustomTaskPaneCollection(Nothing, Nothing, "CustomTaskPanes", "CustomTaskPanes", Me)
140 | End Sub
141 |
142 | '''
143 | _
146 | Private Sub InitializeComponents()
147 | End Sub
148 |
149 | '''
150 | _
152 | Private Function NeedsFill(ByVal MemberName As String) As Boolean
153 | Return Me.DataHost.NeedsFill(Me, MemberName)
154 | End Function
155 |
156 | '''
157 | _
160 | Protected Overrides Sub OnShutdown()
161 | Me.CustomTaskPanes.Dispose()
162 | MyBase.OnShutdown()
163 | End Sub
164 | End Class
165 |
166 | '''
167 | _
169 | Partial Friend NotInheritable Class Globals
170 |
171 | '''
172 | Private Sub New()
173 | MyBase.New()
174 | End Sub
175 |
176 | Private Shared _ThisAddIn As ThisAddIn
177 |
178 | Private Shared _factory As Global.Microsoft.Office.Tools.Outlook.Factory
179 |
180 | Private Shared _ThisRibbonCollection As ThisRibbonCollection
181 |
182 | Private Shared _ThisFormRegionCollection As ThisFormRegionCollection
183 |
184 | Friend Shared Property ThisAddIn() As ThisAddIn
185 | Get
186 | Return _ThisAddIn
187 | End Get
188 | Set(ByVal value As ThisAddIn)
189 | If (_ThisAddIn Is Nothing) Then
190 | _ThisAddIn = value
191 | Else
192 | Throw New System.NotSupportedException()
193 | End If
194 | End Set
195 | End Property
196 |
197 | Friend Shared Property Factory() As Global.Microsoft.Office.Tools.Outlook.Factory
198 | Get
199 | Return _factory
200 | End Get
201 | Set(ByVal value As Global.Microsoft.Office.Tools.Outlook.Factory)
202 | If (_factory Is Nothing) Then
203 | _factory = value
204 | Else
205 | Throw New System.NotSupportedException()
206 | End If
207 | End Set
208 | End Property
209 |
210 | Friend Shared ReadOnly Property Ribbons() As ThisRibbonCollection
211 | Get
212 | If (_ThisRibbonCollection Is Nothing) Then
213 | _ThisRibbonCollection = New ThisRibbonCollection(_factory.GetRibbonFactory)
214 | End If
215 | Return _ThisRibbonCollection
216 | End Get
217 | End Property
218 |
219 | Friend Shared ReadOnly Property FormRegions() As ThisFormRegionCollection
220 | Get
221 | If (_ThisFormRegionCollection Is Nothing) Then
222 | _ThisFormRegionCollection = New ThisFormRegionCollection(Globals.ThisAddIn.GetFormRegions)
223 | End If
224 | Return _ThisFormRegionCollection
225 | End Get
226 | End Property
227 | End Class
228 |
229 | '''
230 | _
232 | Partial Friend NotInheritable Class ThisRibbonCollection
233 | Inherits Microsoft.Office.Tools.Ribbon.RibbonCollectionBase
234 |
235 | '''
236 | Friend Sub New(ByVal factory As Global.Microsoft.Office.Tools.Ribbon.RibbonFactory)
237 | MyBase.New(factory)
238 | End Sub
239 |
240 | Default Friend Overloads ReadOnly Property Item(ByVal inspector As Microsoft.Office.Interop.Outlook.Inspector) As ThisRibbonCollection
241 | Get
242 | Return Me.GetRibbonContextCollection(Of ThisRibbonCollection)(inspector)
243 | End Get
244 | End Property
245 |
246 | Default Friend Overloads ReadOnly Property Item(ByVal explorer As Microsoft.Office.Interop.Outlook.Explorer) As ThisRibbonCollection
247 | Get
248 | Return Me.GetRibbonContextCollection(Of ThisRibbonCollection)(explorer)
249 | End Get
250 | End Property
251 | End Class
252 |
253 | '''
254 | _
255 | Partial Friend NotInheritable Class ThisFormRegionCollection
256 | Inherits Microsoft.Office.Tools.Outlook.FormRegionCollectionBase
257 |
258 | '''
259 | Public Sub New(ByVal list As System.Collections.Generic.IList(Of Microsoft.Office.Tools.Outlook.IFormRegion))
260 | MyBase.New(list)
261 | End Sub
262 |
263 | Default Friend Overloads ReadOnly Property Item(ByVal explorer As Microsoft.Office.Interop.Outlook.Explorer) As WindowFormRegionCollection
264 | Get
265 | Return CType(Globals.ThisAddIn.GetFormRegions(explorer, GetType(WindowFormRegionCollection)), WindowFormRegionCollection)
266 | End Get
267 | End Property
268 |
269 | Default Friend Overloads ReadOnly Property Item(ByVal inspector As Microsoft.Office.Interop.Outlook.Inspector) As WindowFormRegionCollection
270 |
271 | Get
272 | Return CType(Globals.ThisAddIn.GetFormRegions(inspector, GetType(WindowFormRegionCollection)), WindowFormRegionCollection)
273 | End Get
274 | End Property
275 | End Class
276 |
277 | '''
278 | _
279 | Partial Friend NotInheritable Class WindowFormRegionCollection
280 | Inherits Microsoft.Office.Tools.Outlook.FormRegionCollectionBase
281 |
282 | '''
283 | Public Sub New(ByVal list As System.Collections.Generic.IList(Of Microsoft.Office.Tools.Outlook.IFormRegion))
284 | MyBase.New(list)
285 | End Sub
286 | End Class
287 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/GOVCERT Outlook Addins.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
20 |
21 | {BAA0C2D2-18E2-41B9-852F-F413020CAA33};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
22 | Debug
23 | AnyCPU
24 | {2F006B14-34F3-4C4E-8D4D-4061B558553D}
25 | Library
26 | GOVCERT_Outlook_Addins
27 | GOVCERT Outlook Addins
28 | v4.6.1
29 | VSTO40
30 |
31 |
32 | False
33 | true
34 | publish\
35 |
36 | en
37 | 3.0.6.0
38 | false
39 | true
40 | 1
41 | days
42 | GOVCERT Outlook Addins
43 | CERT Gouvernemental
44 | http://www.govcert.lu
45 | GOVCERT Outlook Addins
46 | Govcert Support Tools
47 | 3
48 |
49 |
50 |
51 | False
52 | Microsoft .NET Framework 4.6.1 %28x86 and x64%29
53 | true
54 |
55 |
56 | False
57 | .NET Framework 3.5 SP1
58 | false
59 |
60 |
61 | False
62 | Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29
63 | true
64 |
65 |
66 |
67 |
71 | Outlook
72 |
73 |
74 | On
75 |
76 |
92 |
93 | $(DefineConstants)
94 | true
95 | true
96 | full
97 | true
98 | false
99 | bin\Debug\
100 | GOVCERT Outlook Addins.xml
101 | false
102 | false
103 |
104 |
105 | true
106 | false
107 | 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
108 |
109 |
125 |
126 |
127 |
128 | false
129 | false
130 | pdbonly
131 | true
132 | bin\Release\
133 | GOVCERT Outlook Addins.xml
134 | false
135 | false
136 |
137 |
138 | true
139 | 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036
140 | MyRules.ruleset
141 | AnyCPU
142 |
143 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 | False
160 |
161 |
162 | False
163 |
164 |
165 | False
166 |
167 |
168 | False
169 |
170 |
171 | False
172 |
173 |
174 |
175 |
176 | True
177 |
178 |
179 | True
180 |
181 |
182 |
183 |
184 | False
185 | true
186 |
187 |
188 | False
189 | true
190 |
191 |
192 | False
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
216 |
217 |
218 |
219 |
220 |
221 | Code
222 |
223 |
224 |
225 | ThisAddIn.vb
226 |
227 |
228 | ThisAddIn.Designer.xml
229 |
230 |
231 |
232 | VbMyResourcesResXFileCodeGenerator
233 | Resources.Designer.vb
234 | My.Resources
235 | Designer
236 |
237 |
238 | True
239 | True
240 | Resources.resx
241 |
242 |
243 | SettingsSingleFileGenerator
244 | Settings.Designer.vb
245 |
246 |
247 | True
248 | Settings.settings
249 | True
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 | Designer
283 |
284 |
285 | Designer
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 | 10.0
299 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
300 |
301 |
302 | On
303 |
304 |
305 | Binary
306 |
307 |
308 | On
309 |
310 |
311 | true
312 |
313 |
314 |
315 |
316 |
317 |
318 | B3FD89A758378C924D99BE0B9C556FF1F61294FC
319 |
320 |
321 | false
322 |
323 |
324 |
325 |
326 |
327 |
328 | http://timestamp.sectigo.com
329 |
330 |
331 | false
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
--------------------------------------------------------------------------------
/GOVCERT Outlook Addins/GOVCERT Outlook Addins/GOVCERTOutlookRibbon.vb:
--------------------------------------------------------------------------------
1 | ' Copyright (C) 2018, CERT Gouvernemental (GOVCERT.LU) '
2 | ' Author: Jean-Paul Weber '
3 |
4 | 'This file is part of GC-Notify.'
5 | ''
6 | 'GC-Notify is free software: you can redistribute it and/or modify'
7 | 'it under the terms of the GNU General Public License as published by'
8 | 'the Free Software Foundation, either version 3 of the License, or'
9 | '(at your option) any later version.'
10 | ''
11 | 'GC-Notify is distributed in the hope that it will be useful,'
12 | 'but WITHOUT ANY WARRANTY; without even the implied warranty of'
13 | 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the'
14 | 'GNU General Public License for more details.'
15 | ''
16 | 'You should have received a copy of the GNU General Public License'
17 | 'along with GC-Notify. If not, see .'
18 | '
19 |
20 | Imports System
21 | Imports System.Collections.Generic
22 | Imports System.Drawing
23 | Imports System.Net.NetworkInformation
24 | Imports System.Runtime.InteropServices
25 | Imports System.Text.RegularExpressions
26 | Imports System.Windows.Forms
27 | Imports Microsoft.Office.Core
28 | Imports Microsoft.Office.Interop
29 |
30 |
31 | Public Class GOVCERTOutlookRibbon
32 | Implements IRibbonExtensibility
33 |
34 | Private ribbon As IRibbonUI
35 | Private ipAddress As String = Nothing
36 | Private sysInformation As String = Nothing
37 |
38 | Const PS_PUBLIC_STRINGS As String = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}"
39 | Const PR_TRANSPORT_MESSAGE_HEADERS As String = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"
40 | Const EMAIL_HEADER_TAG_REGEX As String = "^(?[-A-Za-z0-9]+)(?:[ \t]*)(?([^\r\n]|\r\n[ \t]+)*)(?\r\n)"
41 | Public Sub New()
42 | ' Constructor '
43 |
44 | End Sub
45 |
46 |
47 | #Region "Mail Gathering"
48 | Private Function GetCurrentMail() As Outlook.MailItem
49 | ' Returns the current mail '
50 | Dim inspector As Outlook.Inspector = Globals.ThisAddIn.Application.ActiveInspector()
51 | If TypeOf inspector Is Outlook.Inspector Then
52 | If TypeOf inspector.CurrentItem Is Microsoft.Office.Interop.Outlook.MailItem Then
53 | Dim mail As Microsoft.Office.Interop.Outlook.MailItem = CType(inspector.CurrentItem, Microsoft.Office.Interop.Outlook.MailItem)
54 | Return mail
55 | End If
56 | End If
57 | Return Nothing
58 | End Function
59 |
60 | Private Function GetCurrentSelection() As Outlook.Selection
61 | ' Returns the current selection of mails '
62 | Dim selectedMails As Microsoft.Office.Interop.Outlook.Selection = Globals.ThisAddIn.Application.ActiveExplorer().Selection
63 | Return selectedMails
64 |
65 | End Function
66 | #End Region
67 |
68 |
69 | #Region "Mail Processing"
70 |
71 | Private Function ExtractHeaderInformation(ByVal mailItem As Outlook.MailItem) As String()
72 | ' Returns and array of header informations '
73 | Dim results As New List(Of String)
74 |
75 | Dim headerStr As String = CType(mailItem.PropertyAccessor.GetProperty(PR_TRANSPORT_MESSAGE_HEADERS), String)
76 | Dim tags() As String = My.Settings.INTERESTING_HEADER_FIELDS.Split(","c)
77 | Dim received As New List(Of String)
78 | Dim temp As String
79 | For Each m As Match In Regex.Matches(headerStr, EMAIL_HEADER_TAG_REGEX, RegexOptions.Multiline)
80 | For Each needle As String In tags
81 | If m.Value.StartsWith(needle + ":") Then
82 | temp = m.Value.Replace(System.Environment.NewLine, "").Replace(vbTab, " ").Replace(vbCrLf, "")
83 | If needle = "Received" Then
84 | received.Add(temp)
85 | Else
86 | results.Add(temp)
87 | End If
88 | Exit For
89 | End If
90 | Next
91 | Next
92 | If received.Count > 0 Then
93 | If received.Count >= 4 Then
94 | Dim i As Integer = 4
95 | Do While i > 0
96 | results.Add(received.Item(received.Count - i))
97 | i = i - 1
98 | Loop
99 | Else
100 | received.Reverse()
101 | For Each item In received
102 | results.Add(item)
103 | Next
104 | End If
105 | End If
106 |
107 | If results.Count > 0 Then
108 | Return results.ToArray()
109 | Else
110 | Return Nothing
111 | End If
112 |
113 | End Function
114 |
115 | #End Region
116 |
117 | #Region "Information Gathering"
118 | Private Function GetSystemInformation() As String
119 | If sysInformation Is Nothing Then
120 | ' Returns a line of informations about the sending machine '
121 | Me.sysInformation = "Computername:" + System.Environment.MachineName + " (" + System.Environment.OSVersion.ToString() + ")"
122 | End If
123 | Return Me.sysInformation
124 |
125 | End Function
126 |
127 | Private Function GetNetworkIP() As String
128 | ' Returns the IP and network interface Informations '
129 | If Me.ipAddress Is Nothing Then
130 | Dim result As String = ""
131 | For Each ni As NetworkInterface In NetworkInterface.GetAllNetworkInterfaces()
132 | If ni.NetworkInterfaceType = NetworkInterfaceType.Wireless80211 Or ni.NetworkInterfaceType = NetworkInterfaceType.Ethernet Then
133 | For Each ip As UnicastIPAddressInformation In ni.GetIPProperties.UnicastAddresses
134 | If ip.Address.AddressFamily = System.Net.Sockets.AddressFamily.InterNetwork Then
135 | result += ni.Name + "(" + ip.Address.ToString() + ")" + System.Environment.NewLine
136 | End If
137 | Next
138 | End If
139 | Next
140 | If result.Length > 0 Then
141 | Me.ipAddress = result
142 | Else
143 | Me.ipAddress = "Could Not be determined"
144 | End If
145 | End If
146 | Return Me.ipAddress
147 |
148 | End Function
149 |
150 | Private Function PrepareAttachment(ByRef outgoingMail As Outlook.MailItem, ByVal attachmentMail As Outlook.MailItem) As MailDetails
151 | ' Attaches the mail as attachment to the mail to be sent and returns the information gathered from the mail to attach '
152 | Dim attachMail As Boolean = True
153 | If Not (attachmentMail.Subject Is Nothing) Then
154 | If attachmentMail.Subject.Contains(My.Settings.SPAM_TAG) Then
155 | ' This means that the mail was alredy tagged as spam then the user must confirm to send it '
156 | 'This means that the mail was already tagged as spam then show the dialog for confirmation'
157 | Dim message As String = My.Resources.SPAMDialogText
158 | TemplateFiller(message, "Email", attachmentMail.SenderEmailAddress)
159 | TemplateFiller(message, "Subject", attachmentMail.Subject)
160 |
161 | Dim result As DialogResult = MessageBox.Show(message, "Email already Tagged", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
162 | If result = DialogResult.No Then
163 | attachMail = False
164 | Else
165 | ' Set forced header '
166 | ' Set X-Headers '
167 | outgoingMail.PropertyAccessor.SetProperty(PS_PUBLIC_STRINGS + "/X-GC-Notify-Force-Send", "true")
168 | End If
169 | End If
170 | End If
171 | If attachMail Then
172 | Dim retries As Integer = 5
173 | Dim valid As Boolean = False
174 |
175 | While retries > 0 And Not valid
176 | retries = retries - 1
177 | Try
178 | outgoingMail.Attachments.Add(attachmentMail, Outlook.OlAttachmentType.olByValue)
179 | valid = True
180 | Catch ex As Exception
181 | If retries = 0 Then
182 | Throw
183 | Else
184 | Threading.Thread.Sleep(100)
185 | End If
186 | End Try
187 | End While
188 | Dim result = New MailDetails()
189 | result.Subject = attachmentMail.Subject
190 | result.From = attachmentMail.SenderEmailAddress
191 | result.NumberOfAttachments = attachmentMail.Attachments.Count
192 | result.HeaderInformations = ExtractHeaderInformation(attachmentMail)
193 | Return result
194 | Else
195 | Return Nothing
196 | End If
197 | End Function
198 |
199 | Private Sub PrepareErrorMail(e As Exception)
200 | Dim email As Outlook.MailItem
201 | email = CType(Globals.ThisAddIn.Application.CreateItem(Outlook.OlItemType.olMailItem), Outlook.MailItem)
202 | email.Subject = My.Settings.SOC_NEW_MAIL_Subject + " Error Occured"
203 | email.To = My.Settings.SUPPORT_MAIL
204 | email.Body = My.Resources.ErrorMail
205 | TemplateFiller(email.Body, "Message", e.Message)
206 | TemplateFiller(email.Body, "Version", My.Resources.BTN_VERSIION)
207 | TemplateFiller(email.Body, "ExceptionDetails", e.ToString())
208 | email.Display()
209 |
210 | End Sub
211 |
212 | #End Region
213 |
214 | #Region "Mail Creation Helpers"
215 | Private Function IsEmptyMail(email As Outlook.MailItem) As Boolean
216 | ' Checks if the mail is empty '
217 | Dim counter As Integer = 0
218 | If String.IsNullOrEmpty(email.Subject) Then
219 | counter = counter + 1
220 | End If
221 | If String.IsNullOrEmpty(email.Body) Or email.Body = " " Then
222 | counter = counter + 1
223 | End If
224 | If String.IsNullOrEmpty(email.To) Then
225 | counter = counter + 1
226 | End If
227 | If String.IsNullOrEmpty(email.CC) Then
228 | counter = counter + 1
229 | End If
230 | If String.IsNullOrEmpty(email.BCC) Then
231 | counter = counter + 1
232 | End If
233 | If email.Attachments.Count = 0 Then
234 | counter = counter + 1
235 | End If
236 | Return counter = 6
237 | End Function
238 |
239 | Private Function CreateNewMail() As Outlook.MailItem
240 | ' Creates the new mail to send out '
241 | Dim email As Outlook.MailItem
242 | email = CType(Globals.ThisAddIn.Application.CreateItem(Outlook.OlItemType.olMailItem), Outlook.MailItem)
243 | PopulateNewMail(email)
244 | Return email
245 | End Function
246 |
247 | Private Sub PopulateNewMail(ByRef email As Outlook.MailItem)
248 | ' Sets the values for the new mail '
249 | email.Subject = My.Settings.SOC_MAIL_SUBJECT_TAG
250 | email.Body = My.Resources.NewMailBody
251 | email.To = My.Settings.SOC_MAIL
252 | If Not (String.IsNullOrEmpty(My.Settings.SOC_MAIL_CC)) Then
253 | email.CC = My.Settings.SOC_MAIL_CC
254 | End If
255 | If Not (String.IsNullOrEmpty(My.Settings.SOC_MAIL_BCC)) Then
256 | email.BCC = My.Settings.SOC_MAIL_BCC
257 | End If
258 | email.PropertyAccessor.SetProperty(PS_PUBLIC_STRINGS + "/X-GC-Notify-Version", My.Resources.BTN_VERSIION)
259 | End Sub
260 |
261 | Private Sub TemplateFiller(ByRef template As String, ByVal placeholder As String, ByVal value As String)
262 | ' Replaces the place holder in the template with the value converted to the correct type '
263 | Dim stringValue As String = value
264 | If stringValue Is Nothing Then
265 | stringValue = "Nothing could be found"
266 | End If
267 | template = template.Replace("{{" + placeholder + "}}", stringValue)
268 | End Sub
269 |
270 | Private Sub TemplateFiller(ByRef template As String, ByVal placeholder As String, ByVal value As String())
271 | ' Replaces the place holder in the template with the value converted to the correct type '
272 | Dim stringValue As String = Nothing
273 |
274 | If value Is Nothing Then
275 | stringValue = "Nothing could be found"
276 | Else
277 | stringValue = ""
278 | For Each item In value
279 | stringValue += item + System.Environment.NewLine
280 | Next
281 | End If
282 | template = template.Replace("{{" + placeholder + "}}", stringValue)
283 |
284 | End Sub
285 |
286 | Private Sub TemplateFiller(ByRef template As String, ByVal placeholder As String, ByVal value As Integer)
287 | ' Replaces the place holder in the template with the value converted to the correct type '
288 | Dim stringValue As String = value.ToString()
289 | template = template.Replace("{{" + placeholder + "}}", stringValue)
290 | End Sub
291 |
292 | Private Function CreateMailDetails(mailDetails As MailDetails, Optional counter As Integer = 1) As String
293 | ' Populates the Mail Details template with the details of the mailDetails '
294 | Dim detailsTemplate = My.Resources.EmailDetails
295 | TemplateFiller(detailsTemplate, "EmailCounter", counter)
296 | TemplateFiller(detailsTemplate, "From", mailDetails.From)
297 | TemplateFiller(detailsTemplate, "Subject", mailDetails.Subject)
298 | TemplateFiller(detailsTemplate, "HeaderDetails", mailDetails.HeaderInformations)
299 | TemplateFiller(detailsTemplate, "AttachmentCount", mailDetails.NumberOfAttachments)
300 | Return detailsTemplate
301 | End Function
302 | #End Region
303 |
304 | #Region "Mail Sending"
305 | Private Sub ProcessMainWindowMail()
306 | Try
307 | Dim SelectedMails As Outlook.Selection = GetCurrentSelection()
308 | Dim outGoingMail As Outlook.MailItem = CreateNewMail()
309 | Dim attachments As New List(Of MailDetails)
310 | Dim temp As MailDetails = Nothing
311 | For Each item In SelectedMails
312 | If TypeOf item Is Outlook.MailItem Then
313 | Dim email As Outlook.MailItem = CType(item, Outlook.MailItem)
314 | temp = PrepareAttachment(outGoingMail, email)
315 | If Not (temp Is Nothing) Then
316 | attachments.Add(temp)
317 | End If
318 | End If
319 |
320 | Next
321 | If attachments.Count = 0 Then
322 | MessageBox.Show(My.Resources.NoSelectionError, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)
323 | Else
324 | ' Set the correct subject '
325 | Dim subject As String
326 | If attachments.Count = 1 Then
327 | subject = My.Settings.SOC_MAIL_SUBJECT_TAG + " - " + attachments.Item(0).GetSubjectLine()
328 | Else
329 | subject = My.Settings.SOC_MAIL_SUBJECT_TAG + " - Multiple Emails"
330 | End If
331 | Dim mailDetails As String = ""
332 | Dim counter As Integer = 0
333 | For Each attachment In attachments
334 | counter += 1
335 | mailDetails += CreateMailDetails(attachment, counter)
336 | Next
337 | ' Populate Mail '
338 | outGoingMail.Subject = subject
339 | Dim body = My.Resources.SuspectBody
340 | TemplateFiller(body, "attachments", mailDetails)
341 | TemplateFiller(body, "HostDetails", GetSystemInformation())
342 | TemplateFiller(body, "NetworkDetails", GetNetworkIP())
343 | outGoingMail.Body = body
344 | outGoingMail.Display()
345 | End If
346 | Catch ex As Exception
347 | PrepareErrorMail(ex)
348 | End Try
349 |
350 | End Sub
351 |
352 | Private Sub ProcessWindowMail()
353 | Try
354 | Dim email As Outlook.MailItem = GetCurrentMail()
355 | Dim sendMail As Boolean = True
356 | ' First check if it Is not a new mail '
357 | ' If the EntryID Is empty the mail was not send nor saved, hence this is a new one '
358 | If String.IsNullOrEmpty(email.EntryID) Then
359 | ' Check however if the email was not already populated '
360 | If IsEmptyMail(email) Then
361 | sendMail = False
362 | PopulateNewMail(email)
363 | TemplateFiller(email.Body, "HostDetails", GetSystemInformation())
364 | TemplateFiller(email.Body, "NetworkDetails", GetNetworkIP())
365 |
366 | Else
367 | ' Check if it is not already a new generated mail '
368 | Try
369 | email.PropertyAccessor.GetProperty(PS_PUBLIC_STRINGS + "/X-GC-Notify-Version")
370 | MessageBox.Show(My.Resources.ResendError, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
371 | sendMail = False
372 | Catch ex As COMException
373 | ' This is then something different '
374 | Dim result As DialogResult = MessageBox.Show(My.Resources.OverWriteConfirm, "Do you want to proceed?", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
375 | If result = DialogResult.Yes Then
376 | sendMail = False
377 | PopulateNewMail(email)
378 | TemplateFiller(email.Body, "HostDetails", GetSystemInformation())
379 | TemplateFiller(email.Body, "NetworkDetails", GetNetworkIP())
380 | End If
381 | End Try
382 | End If
383 | End If
384 | If sendMail Then
385 | ' Populate the mail and send it also close the opened mail '
386 | Dim outGoingMail As Outlook.MailItem = CreateNewMail()
387 | Dim temp As MailDetails = PrepareAttachment(outGoingMail, email)
388 | Dim subject As String = My.Settings.SOC_MAIL_SUBJECT_TAG + " - " + temp.GetSubjectLine()
389 | Dim mailDetails As String = CreateMailDetails(temp)
390 | outGoingMail.Subject = subject
391 | Dim body = My.Resources.SuspectBody
392 | TemplateFiller(body, "attachments", mailDetails)
393 | TemplateFiller(body, "HostDetails", GetSystemInformation())
394 | TemplateFiller(body, "NetworkDetails", GetNetworkIP())
395 | outGoingMail.Body = body
396 | email.Close(Outlook.OlInspectorClose.olDiscard)
397 | outGoingMail.Display()
398 | End If
399 | Catch ex As Exception
400 | PrepareErrorMail(ex)
401 | End Try
402 | End Sub
403 | #End Region
404 |
405 | #Region "Ribbon Callbacks"
406 | 'Create callback methods here. For more information about adding callback methods, visit https://go.microsoft.com/fwlink/?LinkID=271226
407 | Public Sub Ribbon_Load(ByVal ribbonUI As IRibbonUI)
408 | Me.ribbon = ribbonUI
409 | End Sub
410 |
411 | Public Function GetImage(ByVal control As IRibbonControl) As Bitmap
412 | Return My.Resources.logo
413 | End Function
414 |
415 | Public Function GetButtonLabel(ByVal control As IRibbonControl) As String
416 | Return My.Settings.BTN_LABEL
417 | End Function
418 |
419 | Public Function GetSupertipLabel(ByVal control As IRibbonControl) As String
420 | Return My.Settings.SUPERTIP_LABEL + " (" + My.Resources.BTN_VERSIION + ")"
421 | End Function
422 |
423 | Public Function GetGroupLabel(ByVal control As IRibbonControl) As String
424 | Return My.Settings.GROUP_LABEL
425 | End Function
426 |
427 | Public Sub BTNclick(ByVal control As IRibbonControl)
428 | ' Decide via the ID of the control what to do and redirect to the correct method '
429 | Select Case control.Id
430 | Case "BTNMailTab"
431 | ProcessMainWindowMail()
432 | Case "BTNSendReceiveTab"
433 | ProcessMainWindowMail()
434 | Case "BTNNewMailTab"
435 | ProcessWindowMail()
436 | Case "BTNReadTab"
437 | ProcessWindowMail()
438 | Case Else
439 | ' Well tbh this cannot be the case '
440 | Throw New NotSupportedException("The given control ID " + control.Id + " is not defined")
441 | End Select
442 | End Sub
443 |
444 |
445 | #End Region
446 |
447 | #Region "Helpers"
448 |
449 | Private Shared Function GetResourceText(ByVal resourceName As String) As String
450 | Dim asm As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
451 | Dim resourceNames() As String = asm.GetManifestResourceNames()
452 | For i As Integer = 0 To resourceNames.Length - 1
453 | If String.Compare(resourceName, resourceNames(i), System.StringComparison.OrdinalIgnoreCase) = 0 Then
454 | Using resourceReader As System.IO.StreamReader = New System.IO.StreamReader(asm.GetManifestResourceStream(resourceNames(i)))
455 | If resourceReader IsNot Nothing Then
456 | Return resourceReader.ReadToEnd()
457 | End If
458 | End Using
459 | End If
460 | Next
461 | Return Nothing
462 | End Function
463 | Public Function GetCustomUI(ByVal ribbonID As String) As String Implements IRibbonExtensibility.GetCustomUI
464 | ' Function to return the correct IDs for the different tabs '
465 | Select Case ribbonID
466 | Case "Microsoft.Outlook.Explorer"
467 | Return GetResourceText("GOVCERT_Outlook_Addins.RibbonHome.xml")
468 | Case "Microsoft.Outlook.Mail.Read"
469 | Return GetResourceText("GOVCERT_Outlook_Addins.RibbonReadMail.xml")
470 | Case "Microsoft.Outlook.Mail.Compose"
471 | Return GetResourceText("GOVCERT_Outlook_Addins.RibbonNewMail.xml")
472 | Case Else
473 | Return Nothing
474 | End Select
475 | End Function
476 | #End Region
477 |
478 | End Class
479 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | GC-Notify is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | GC-Notify is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with GC-Notify. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | GC-Notify comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------