🎉👍 First of all, thank you for contributing! 👍🎉
This document contains guidelines and helpful information for contributing to the dkim-exchange project.
Table Of Contents
Notes for developers
How to include support for newer Exchange Versions
If you want to help us supporting new Exchange Versions, please follow the steps below.
For each Exchange version we need the following files within the Lib directory:
Microsoft.Exchange.Data.Common.dll
Microsoft.Exchange.Data.Common.xml
Microsoft.Exchange.Data.Transport.dll
Microsoft.Exchange.Data.Transport.xml
These can be found at C:\Program Files\Microsoft\Exchange Server\VXX\Public (where XX is the version number on your system). Alternatively, if you have the Exchange ISO, these files can be found in the \Setup\ServerRoles\Common directory of the image.
If using the ISO method, be sure to match the filenames correctly as there are many similarly named (but incorrect) files in the ISO which will break the build process.
- Create a fork of our project from your GitHub account
- Create a new branch for your changes (e.g. EX2019CU4)
- Add the above mentioned files (.dll and .xml) to your fork. Create a new directory for the corresponding Exchange version in the Lib directory.
- If you are not familiar with Visual Studio or coding in C# please stop here and just create a new pull request. Otherwise continue with the following steps.
- Now you need to change each of the following files to include the new .dll.
-
DkimSigner.sln
-
Locate the
GlobalSection(SolutionConfigurationPlatforms)section (around line 11)Locate the previous version to the one you are creating e.g. for Exchange Server 2019 CU3:
Ex2019 CU3|Any CPU = Ex2019 CU3|Any CPU.Insert a new line below (copy/paste the previous line and update the version/CU accordingly) e.g. for Exchange Server 2019 CU4:
Ex2019 CU4|Any CPU = Ex2019 CU4|Any CPU -
Locate the
GlobalSection(ProjectConfigurationPlatforms)section (around line 71)Locate the previous version to the one you are creating in in GUID
{3AF0EAB4-6135-4908-A659-5E3C974E4718}(there are two lines required) e.g. for Exchange 2019 CU3:{3AF0EAB4-6135-4908-A659-5E3C974E4718}.Ex2019 CU3|Any CPU.ActiveCfg = Ex2019 CU3|Any CPU
{3AF0EAB4-6135-4908-A659-5E3C974E4718}.Ex2019 CU3|Any CPU.Build.0 = Ex2019 CU3|Any CPUInsert two new lines below (copy/paste the previous lines and update the versions/CUs accordingly) e.g. for Exchange 2019 CU4:
{3AF0EAB4-6135-4908-A659-5E3C974E4718}.Ex2019 CU4|Any CPU.ActiveCfg = Ex2019 CU4|Any CPU
{3AF0EAB4-6135-4908-A659-5E3C974E4718}.Ex2019 CU4|Any CPU.Build.0 = Ex2019 CU4|Any CPULocate the previous version to the one you are creating in in GUID
{8AA10740-EC1C-43D9-9BB2-9DF3F82A214F}(there is just one line this time) e.g. for Exchange 2019 CU3:{8AA10740-EC1C-43D9-9BB2-9DF3F82A214F}.Ex2019 CU3|Any CPU.ActiveCfg = Release|Any CPUInsert a new line below (copy/paste the previous line and update the versions/CUs accordingly) e.g. for Exchange 2019 CU4:
{8AA10740-EC1C-43D9-9BB2-9DF3F82A214F}.Ex2019 CU4|Any CPU.ActiveCfg = Release|Any CPUSave and close
DkimSigner.sln
-
-
Src/Configuration.DkimSigner/Constants.cs
-
Locate the latest CU prior to the version of Exchange you are adding e.g. if you are adding Exchange 2019 CU4 and Exchange 2019 CU3 is already supported, then locate:
{"15.2.464.5", "Exchange 2019 CU3"}, -
Insert a new line below (copy/paste the previous line and update the versions/CUs accordingly) e.g. for Exchange 2019 CU4:
{"15.2.529.5", "Exchange 2019 CU4"}NOTE: Take care if the value you added is the last in the list, it should NOT have a comma (as per the CU4 example above). If your entry is before the last entry, it SHOULD have a comma (as per the CU3 example above).
-
Save and close
Src/Configuration.DkimSigner/Constants.cs
-
-
Src/Exchange.DkimSigner/Exchange.DkimSigner.csproj
-
Locate the
TargetFrameworkVersionsectionLocate the latest CU prior to the version of Exchange you are adding e.g. if you are adding Exchange 2019 CU4 and Exchange 2019 CU3 is already supported, then locate:
<TargetFrameworkVersion Condition="'$(Configuration)|$(Platform)' == 'Ex2019 CU3|AnyCPU'">v4.7.2</TargetFrameworkVersion>Insert a new line below (copy/paste the previous line and update the versions/CUs accordingly) e.g. for Exchange 2019 CU4:
<TargetFrameworkVersion Condition="'$(Configuration)|$(Platform)' == 'Ex2019 CU4|AnyCPU'">v4.7.2</TargetFrameworkVersion>NOTE: Ensure the correct .NET framework version is set.
-
Locate the
PropertyGroupsectionLocate the latest CU prior to the version of Exchange you are adding e.g. if you are adding Exchange 2019 CU4 and Exchange 2019 CU3 is already supported, then locate:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Ex2019 CU3|AnyCPU'"> <OutputPath>bin\Exchange 2019 CU3\</OutputPath> <DefineConstants>TRACE;EX_2019_CU3</DefineConstants> <Optimize>true</Optimize> <DebugType>pdbonly</DebugType> <PlatformTarget>AnyCPU</PlatformTarget> <ErrorReport>prompt</ErrorReport> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> </PropertyGroup>Insert a new line below (copy/paste the previous lines and update the versions/CUs accordingly) e.g. for Exchange 2019 CU4:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Ex2019 CU4|AnyCPU'"> <OutputPath>bin\Exchange 2019 CU4\</OutputPath> <DefineConstants>TRACE;EX_2019_CU4</DefineConstants> <Optimize>true</Optimize> <DebugType>pdbonly</DebugType> <PlatformTarget>AnyCPU</PlatformTarget> <ErrorReport>prompt</ErrorReport> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> </PropertyGroup> -
Locate the
ItemGroupsectionLocate the latest CU prior to the version of Exchange you are adding e.g. if you are adding Exchange 2019 CU4 and Exchange 2019 CU3 is already supported, then locate:
<Reference Include="Microsoft.Exchange.Data.Common" Condition="'$(Configuration)'=='Ex2019 CU3'"> <HintPath>..\..\Lib\Exchange 2019 CU3\Microsoft.Exchange.Data.Common.dll</HintPath> </Reference><Reference Include="Microsoft.Exchange.Data.Transport" Condition="'$(Configuration)'=='Ex2019 CU3'"> <HintPath>..\..\Lib\Exchange 2019 CU3\Microsoft.Exchange.Data.Transport.dll</HintPath> </Reference>Insert a new line below (copy/paste the previous lines and update the versions/CUs accordingly) e.g. for Exchange 2019 CU4:
<Reference Include="Microsoft.Exchange.Data.Common" Condition="'$(Configuration)'=='Ex2019 CU4'"> <HintPath>..\..\Lib\Exchange 2019 CU4\Microsoft.Exchange.Data.Common.dll</HintPath> </Reference><Reference Include="Microsoft.Exchange.Data.Transport" Condition="'$(Configuration)'=='Ex2019 CU4'"> <HintPath>..\..\Lib\Exchange 2019 CU4\Microsoft.Exchange.Data.Transport.dll</HintPath> </Reference> -
Save and close
Src/Exchange.DkimSigner/Exchange.DkimSigner.csproj
-
-
coverity.proj
-
Locate the previous version to the one you are creating e.g. for Exchange Server 2019 CU3:
<MSBuild Projects="DkimSigner.sln" Properties="Configuration=Ex2019 CU3;Platform=Any CPU" /> -
Insert a new line below (copy/paste the previous line and update the version/CU accordingly) e.g. for Exchange Server 2019 CU4:
<MSBuild Projects="DkimSigner.sln" Properties="Configuration=Ex2019 CU4;Platform=Any CPU" /> -
Save and close coverity.proj
-
-
install.ps1
-
Add the Exchange Server version/CU/build number to the changelog at the start of the file e.g. for Exchange Server 2019 CU4:
# Exchange 2019 CU4 (15.2.529.5) -
Locate the previous version to the one you are creating e.g. for Exchange Server 2019 CU3:
} elseif (($exchserver.admindisplayversion).major -eq 15 -and ($exchserver.admindisplayversion).minor -eq 2 -and ($exchserver.admindisplayversion).build -eq 464) { $EXVER="Exchange 2019 CU3" -
Insert a new line below (copy/paste the previous line and update the version/CU and build numbers accordingly) e.g. for Exchange Server 2019 CU4:
} elseif (($exchserver.admindisplayversion).major -eq 15 -and ($exchserver.admindisplayversion).minor -eq 2 -and ($exchserver.admindisplayversion).build -eq 529) { $EXVER="Exchange 2019 CU4"
NOTE: Refer to this Microsoft article for Exchange Server versions and build numbers. The "Major", "Minor" and "Build" attributes must be updated for each version of Exchange or the installer will fail.
Example:
Exchange Server 2019 CU4 has build number 15.2.529.5 which would translate to the following in the installer script:
Major version: 15
Minor version: 2
Build version: 529The final value (in this case "5") is not used.
- Save and close install.ps1
-
-
Refer to this commit for a working example: f83924a.
- Update the
Assembly Informationfor each of the two projects (Configuration.DkimSignerandExchange.DkimSigner)- Right click on the
Configuration.DkimSignerproject in Solution Explorer - Click on
Properties - Click on
Assembly Information... - Update the build numbers (
Assembly VersionandFile Version) to match the build number you are creating (check the Releases section to ensure you submit a release in line with the current version) - (Optional) Update the copyright year
- Right click on the
- Make sure that everything compiles
- Commit/push the changes to your local repository
- Create a pull request
Compiling
There are two projects in the Visual Studio Solution:
To compile the Configuration.DKIMSigner executable just go to Project menu and then Build Solution.
To compile the .dll's for the Exchange Agent, go to Project menu and then select Batch Build. Make sure all the configurations are selected, then press Build. This will automatically link the agent DLLs with the correct version of the Exchange libraries.
Creating Releases
Before starting, ensure you have set your build versions (and optionally copyright year) correctly as per step 6 of the the How to include support for newer Exchange Versions section
- Build all the .dll versions and the Configurator as described in the Compiling Section
- Commit the changed files, including resulting binary files (
Src/Exchange.DkimSigner/bin, andSrc/Configuration.DkimSigner/bin/Release) - Push all the changes
- Go to GitHub -> Releases (https://github.com/Pro/dkim-exchange/releases)
- Create a new release. As the tag use the same version you used in step 6 of the the How to include support for newer Exchange Versions section, e.g.
v3.2.0. The title should summarize the release. And as text use the change log content. Just refer to previous releases. - Create a new .zip File for the binary:
Right-click on
Src/Configuration.DkimSigner/bin/Releaseand then zip the folder. Rename the resulting .zip toConfiguration.DkimSigner.zip. Make sure that this .zip does not contain any subfolders, but all the files directly. - Add the .zip to the release
- Create the release as a pre-release. This will allow other users to test it as a beta version
- After two weeks or so just remove the pre-release flag, and it will be picked up by the configurator.exe as a new update
Debugging
If you want to debug the .dll on your Exchange Server, you need to install Visual Studio Remote Debugging on the Server.
- After the Remote Debugging Tools are installed on the Server, open Visual Studio
- Compile the .dll with Debug information
- Copy the recompiled .dll to the server
- In Visual Studio select Debug->Attach to Process
- Under 'Qualifier' input the server IP or Host Name
- Select "Show processes from all users"
- Select the process
EdgeTransport.exeand then press 'Attach' - When reached, the process should stop at the breakpoint