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 -

- 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

  1. Download Oracle Berkeley DB 4.6 (encryption is not needed), and unpack it to a suitable location. And build the project.
  2. 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.
  3. Select 'Include files' from the 'Show directories for:' drop-down. Add the path to the 'build_win32' subdirectory of your Berkeley DB installation.
  4. 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

  1. 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.
  2. If you downloaded the raw source snapshot, follow the build instructions given in the readme file included in the snapshot.
  3. In the Microsoft Development Environment, open 'Options' (on the Tools menu) and open the 'Projects' node and then the 'VC++ Directories' node.
  4. 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.
  5. 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

  1. Check out the source from SVN, or download and extract the source archives from the project files page.
  2. 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.
  3. Select the appropriate configuration - 'Release' or 'Debug'.
  4. 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.
  5. 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:
  6. 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.
  7. In the '[Files]' section, change the path to pthreadVC.dll if necessary.
  8. 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:

  1. 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.)
  2. 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'.
  3. 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.