Monday, September 21, 2015

Set up local email server

Quick way to set up a local email server for development purpose:


  1. Download and Install hMailServer.
  2. After installation, create a test domain, "mail.local".
  3. Run notepad.exe as local admin. 
  4. Open "C:\Windows\System32\Drivers\Etc\host" file.
  5. Add new entry 127.0.0.1  mail.local. Save and close notepad.exe.
  6. Test #5 by pinging mail.local.
  7. In hMailServer console, create a new account admin@mail.local with password under the domain, "mail.local".
  8. Go to Settings --> Protocols --> SMTP.
    Click "Delivery of e-mail" tab. Enter 0 for "Number of retries".
  9. Go to Settings --> Advanced.
    Enter mail.local as the default domain.
  10. Go to Settings --> Advanced --> AutoBan.
    Disable AutoBan.
  11. Go to Settings --> Advanced --> IP Ranges.
    Remove "Internet" and keep "My Computer (127.0.0.1 ~ 127.0.0.1)".
  12. Download and Install Mozilla Thunderbird.
  13. Set up existing account with name = "admin", email = "admin@mail.local" and password from #7.
  14. Test the local email server by sending emails.
  15. Sometimes, the default SMTP port 25 is blocked even to the local PC itself due to network policy. You can change the SMTP port to something else, i.e., 125 at
    Settings --> Advanced --> TCP/IP Ports ---> 0.0.0.0 / 25 / SMTP.
    Change the TCP/IP Port to another available port here.
  16. In order to disable SMTP authentication to avoid SMTP 530 error (authentication is required), go to Settings --> Advanced --> IP Ranges --> Internet --> Require SMTP Authentication. Uncheck "Local to local e-mail addresses", "Local to external e-mail addresses", and "External to local e-mail addresses". Leave check on "External to external e-mail addresses".

No comments: