Using hMailServer for Functional tests

Forum for things that doesn't really have anything to do with hMailServer. Such as php.ini, beer, etc etc.
Post Reply
New user
New user
Posts: 1
Joined: 2010-08-01 23:04

Using hMailServer for Functional tests

Post by fmerrow » 2010-08-02 02:21

Admittedly while I know generally what I want to accomplish, I am not sure exactly what I takes to do it.

I have a system of programs that send emails to various users based on options flag.

Testing all the option flags combinations is getting tedious and I would like to automate it, however the testing is done inside a VPN with firewalls . . . no outside contact with the Intranet, much less the Internet (though I believe ports associated with DNS lookup are open). So if I am going to send/receive emails inside this environment I need to provide the mail servers.

Additionally, I would like to do a fresh install each time the functional test is run . . . not leave a server setup inside the VPN full time.

So I need to:

1. setup and configure a server from the command line, including adding all user accounts

2. run the tests which send email and then later verify that the email was received

3. Throw it all away 10 minutes later

Is hMailServer a tool that can do this or should I look elsewhere? (If so where?)

Given hMailServer is free, what is the licensing like? Can I use it in a business setting without compromising the licensing on our company software?


Posts: 6186
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Using hMailServer for Functional tests

Post by Bill48105 » 2010-08-02 04:37

Hi Frank,
I'd imagine you should be able to do all that with hmail as the mail server.. hmail has COM support (to do MANY things from vbscript/php/etc from command line if needed) plus if you are careful you can modify the SQL database directly if needed.
Here is some info: ... om_objects ... unt_create ... ce_scripts

As far as "Throwing it all away" would deleting the Data folder (all emails are stored there) and creating a new hmail database suffice? Could always uninstall hmail & reinstall it if needed but not sure of your exact requirements. I actually have virtual machines setup with everything fresh & have undo enabled so I can easily close it & clear undo to start back at square one easily (for testing) without need to install everything again so not sure if that'd be useful to you.

As far as licensing, hmail4 was open source under GPL but hmail5 is closed source & still free. martin (the author) has announced hmail5.4 will be open again but not announced exact licensing. I was trying to find the license on this site but have been unable to but you can download the latest version & open License.rtf that is included with it if you want to read the entire text. I'd paste here but it is VERY long.
Hope that helps.
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
Posts: 18435
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: Using hMailServer for Functional tests

Post by mattg » 2010-08-02 09:03

I'd also look at virtualisation.

Get a hmailserver ready to do what you want, then virtualise it.
Copy the virtual disk, and run it. To trash just delete it. Copy again for a new run (always leaving one ready to be copied again).
Just 'cause I link to a page and say little else doesn't mean I am not being nice.

Post Reply