Installing a local mailserver

Making websites is a nice thing. One very important aspect is to test your website on your local or a special development server to see if everything works fine. On almost every website you have some kind of service that lets you get in contact with the one “behind” the website. This will be done, in most cases, by providing a contact form which sends an email the the author/creator/company behind the site. And to test your email function(s), you need a mailserver.

So you need to install such piece of software, preferably on your test machine. I did some research and found the ArGoSoft Mailserver, which is available for download in a free version (choose “Mail Server Freeware”) from the list.

I also found a pretty good tutorial in German how to install and configure the server which is the basis for my instructions below. First,download “agsmail.exe” and run the file to start the installation procedure. Pick the default installation directory and hit “Install”.

After the installation is finished, click on the ArGoSoft Mail Server Icon (in your Start Menu or on your Desktop). Confirm the upcoming error message (stating that relay will be turned off) with “OK”. In the taskbar, you will find a new icon - double-click on it. You will see the server window coming up, which should look similar to this:

ArGoSoft Mailserver Window after startup

The first thing you should do now is stop the server by hitting the red square in the taskbar and choose “Tools” > “Options”. In the “General”-tab you can check/uncheck the options “Load Server at Windows Startup” and “Automaticall Start the Server”, depending on your needs. The most important settings here are your DNS Server (you can find the ip address by executing ipconfig /all on your command line) and check “Allow Relay” which basically means that you are enabling the server to send emails out to the wide open internet space.

Now you need to create a local domain. So click on “Local Domains” and create a domain using the name of the machine the webserver is running on, e.g. “nemesis”.

Create a local domain

Now a few settings concerning security of your newly installed Mailserver. Click on “SMTP Authentication” and check “Enable SMTP Authentication”. This prevents some bad people with computers from abusing your machine for their own purposes. To make sure that you can still use the the Mailserver from localhost without SMTP Authentication, type 127.0.0.1 in the textfield below.

SMTP Authentication

Hit “OK” and you will be returned to the main server window. Now we need to create at least one user to be able to send/receive emails. Go to “Tools” > “Users” and create a new user. This user can then be used to send and receive emails that where initiated by your local test-scripts in e.g. PHP. Just for testing purposing, create a user with the name “test”, enter a password and that’s it. Leave “Forward Address”, “Return Address” and the Finger Information blank as they are not needed.

User Menu

And you are done!

Some important notes:

  • When creating a new account for this user, you need the specify the incoming and outgoing mailserver as localhost or 127.0.0.1
  • If you want to send a mail to this specific user from your scripts, use username@localdomain, e.g. test@nemesis
  • Most of the time it will not be possible to send emails from you local mailserver to some account on the internet, as most servers are secured in such a way that they deny to receive emails from a non-existing domain.

If you have some additional hints or tips, please leave a comment or get in contact.

  • 1 Comment
  • Posted in Web