Monday, May 19, 2014

Adventures with hMailServer

Today I was asked to create a testing mail server; something that can read email from a test webapp and redirect it to another account.  This allows developers to see how a test web application send/receives mail without having all the overhead of changing the settings in the database.

 

Installing HMailServer

Get the software from out share: \\ap-nas-isln-01\Data-WGPSN-AU-Perth\EPF\BSG\Downloads\Hmail or from the official website :  http://www.hmailserver.com/index.php?page=download

Copy the install file to your server.

Run hMailServer-5.4.1-B1951.exe (or whatever version you use)

image

Click Next / Accept the licence agreement and click Next

image

Pick the default installation location (or another if needed).image

Choose “Full Installation” and Click Next

image

Choose “External database” click Next. and Next Again

image

Enter an admin password (e.g. Pa55word ) and Click Next

Click Install.

image

Enter the password again and Click OK

image

Click Next

image

Create a “New” database on first install of choose an existing one if required.  Click “Next”

image

I’m using SQL Server so I picked that and clicked Next.

image

Enter the server connection details; I used a Windows authentication account as the <DOMAIN>\<ServerName>$ account had access to the SQL Server.  Click Next and Next again… Next Again to Finish and then Close.

image

You should see the message above.

Configuring HMailServer

First thing you’ll see will be the Admin connection window.

image

Double click the “Localhost” entry.

image

Click “Add domain”

image

Enter the domain name you wish to use and click “Save”.

Expand the “Accounts” node and click “Add”

image

Add a User and Password for testing and click Save.

image

Expand the “Setting\Advanced\Auto-ban” node and uncheck Auto-ban.  (I do this because I’m running the system on the same machine as my webapps).

Click Save and then Exit.

Uninstalling HMailServer

Click Start/hMailServer/Installation/Uninstall hMailServer

Click “Yes” that you are sure you wish to remove the component.

Click OK.

Note: This will not remove the external SQL database (if you used one). Use SQL Manager to do that step.

Also I’d advise removing the folder from the server as the INI settings are left on the server, in case you every reinstall.

Connecting up your outlook account

Start Outlook

image

Choose File/Add Account and click “Manually Configure server settings” click Next.

Choose “Internet Email” and click Next

image

Enter the various details as required, being sure to select “IMAP” as the Account Type.  Also the Username should be FDN (e.g. test@domain.com) then click : “More Settings…”

image

In the “Outgoing Server” tab select “My outgoing SMTP requires Authentication and select “Use same settings ad my incoming mail server”.  Click OK

image

You should see the above if everything went well.