Building MailWasher Server on windows
From MailWasher Server
Important
Please note that if you just want to use MailWasher Server on your Windows server, you should download one of the pre-built packages - only developers need to compile MailWasher Server from source.
What you'll need
To compile MailWasher Server from source you need the following four things -
- Microsoft Visual C++ .NET 2003 (or later) or Microsoft Visual Studio .NET 2003 (or later). We have recently migrated to using Microsoft Visual Studio 2008. See Windows compilers for more information about support for other compilers and versions, including possible free alternatives.
- Oracle Berkeley DB 4.6 (or later), a free download. See below for installation instructions.
- pthreads-win32, a free download; for now, we recommend the 2.8.0 version. See below for installation instructions.
- NSIS, a free download. We have migrated from the previous installer, Inno Setup, also a free download which works better with the VS 2003 solution.
- plus the source itself, which you can checkout from the SVN repository or download from the project files page.
Quick start
You should be able to build MailWasher Server straight from SVN without any problems once you've installed Berkeley DB and pthreads-win32, and converted the project files to the latest format
However, because each developer installs those two libraries in different places, the MailWasher Server project files do not specify paths to these libraries. Instead, you should add the necessary include and library paths to the global IDE settings.
Full instructions are given below.
Installing Berkeley DB
- Download Oracle Berkeley DB 4.6 (encryption is not needed), and unpack it to a suitable location. And build the project.
- In the Microsoft Development Environment (ie. the Visual Studio/Visual C++ IDE), open 'Options' (on the Tools menu) and open the 'Projects' node and then the 'VC++ Directories' node.
- Select 'Include files' from the 'Show directories for:' drop-down. Add the path to the 'build_win32' subdirectory of your Berkeley DB installation.
- Select 'Library files' from the 'Show directories for:' drop-down. Add the path to the 'build_win32\Debug_static' and 'build_win32\Release_static' subdirectories of your Berkeley DB installation. (If you don't have these directories, check that you successfully finished building Berkeley DB in step one - these directories are created during the build process.)
Installing pthreads-win32
- Download pthreads-win32. We suggest you use the provided .exe installer for the dlls, libs headers and docs, which includes the files we will need already built, but you can build from source if you prefer. (As mentioned above, we recommend version 2.8.0). Unpack pthreads-win32 to a suitable location.
- If you downloaded the raw source snapshot, follow the build instructions given in the readme file included in the snapshot.
- In the Microsoft Development Environment, open 'Options' (on the Tools menu) and open the 'Projects' node and then the 'VC++ Directories' node.
- Select 'Include files' from the 'Show directories for:' drop-down. Add the path to pthread.h - if you're using the pre-built pthreads-win32 distribution, this is the 'Pre-built\include' subdirectory of your pthreads-win32 installation; if you built pthreads-win32 from source, it's the main pthreads-win32 installation directory.
- Select 'Library files' from the 'Show directories for:' drop-down. Add the path to pthreadVC.dll - if you're using the pre-built pthreads-win32 distribution, this is the 'Pre-built\lib' subdirectory of your pthreads-win32 installation; if you built pthreads-win32 from source, it's the main pthreads-win32 installation directory.
Installing Inno Setup
No special setup is required for Inno Setup - just download it and run the installer.
Installing NSIS
No special setup is required for NSIS - just download it and run the installer.
Compiling MailWasher Server
- Check out the source from SVN, or download and extract the source archives from the project files page.
- Open the MWServer.sln solution file, found in the 'mwserver' directory you just checked out from CVS. This solution file will also build the fcl libraries that MailWasher Server requires.
- Select the appropriate configuration - 'Release' or 'Debug'.
- Click 'Build solution' from the MSDE 'Build' menu. Check that it builds all the projects successfully. If you get errors about missing #include files compiling the Exchange mail conduit, see below.
- Run NSIS and open the 'MailWasher Server.nsi' project, which is in the 'installers\win32' subdirectory of the directory you checked 'mwserver' out to. OR:
- Run Inno Setup and open the 'MailWasher Server.iss' project, which is in the 'installers\win32' subdirectory of the directory you checked 'mwserver' out to.
- In the '[Files]' section, change the path to pthreadVC.dll if necessary.
- Click 'Compile' on the 'File' menu.
You should now have an installer called MailWasherServer.exe or MWServer.exe in the 'installers\win32\Output' subdirectory of the directory you checked 'mwserver' out to.
If you get errors compiling the Exchange mail conduit
The Exchange mail conduit uses several header files that are distributed with the platform SDK (which is included in your Visual C++/Visual Studio installation) in IDL file form. You may need to convert these to .h form before you can compile the Exchange conduit.
To do this:
- Start a new command prompt by running 'Visual Studio .NET 2003 Command Prompt', which is in the 'Visual Studio .NET Tools' group in your 'Microsoft Visual Studio .NET 2003' Start menu group. (You can get the same result by starting a normal command prompt and running vcvars32.bat if you prefer.)
- Change to the 'Vc7\PlatformSDK\Include' subdirectory under your Visual Studio directory - for example, 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include'.
- Run 'midl mailmsg.idl', 'midl seo.idl', and 'midl smtpevent.idl'.
You should then have the three new header files - mailmsg.h, seo.h, and smtpevent.h - in that directory, and the Exchange conduit should now compile.
