How To: FREE internal SharePoint email (IMAP/POP/SMTP) inbound and outbound

February 5, 2011 by spjeff

If you haven’t seen http://www.hmailserver.com/ please go download a copy .  To fully demo SharePoint inbound and outbound email features on a local virtual machine I needed something simple.   Without any network dependency, I am able to send and receive emails between SharePoint and users.  Below are the steps I followed to create my single server SharePoint 2010 DEV environment.  I haven’t seen any other blog post on this important topic so hope someone finds this helpful.

Here is the final topology:

image

  1. Install SharePoint (2010 or 2007, works great on both)   I recommend Brian’s http://autospinstaller.codeplex.com/ script with Todd’s CU patch slipstream for a reliable build.  I run the Dec 2010 CU patch level.
  2. Install SMTP from Windows Server Manager   (details here)   Configure on TCP port 26 with FQDN as the host header (i.e.  “sp2010.demo.com”)
    • image
    • image
    • image
  3. Install and configure hMailServer.   This is most of the work and screenshots below show the various options I changed.
    • Configure with MSSQL storage and point to the SQL instance SharePoint uses during first install.  Don’t slow the machine with an extra SQL express instance.
    • Disable POP3.   Invented for dial-in, we can do better with IMAP.
    • image
    • Create user accounts.  I have admin@demo.com here.   I did not use Windows Authentication, but just typed in the password manually.   I realize this creates a duplicate password record to update, but it seemed more reliable during IMAP connections.  I had trouble using Windows only.  This more direct (non-Windows) authentication will login with the full email address as the user name (admin@demo.com) and has no dependency on any Active Directory user object.
    • image
    • Disable AutoBan.   During failed logins this could lock the user account, excessive for DEV.
    • image
    • Set “127.0.0.1” on the TCP listener for IMAP (143) and SMTP (25).    We reserved port 26 for the IIS SMTP that hits a drop folder for SharePoint’s timer job.   Here we will use the standard port because SharePoint Central Admin’s outbound email settings page only uses port 25 and only support a hostname configuration.
    • image
    • Enable mail relay.  This will allow FQDN (i.e. sp2010.demo.com) messages to reach the IIS SMTP drop folder and SharePoint.
    • image
    • Add MX record for both domain (i.e.  “demo.com”) and FQDN (i.e. “sp2010.demo.com”).   MX records help SMTP and mail clients route correctly.
    • image
    • Run Diagnostics.   If done correctly everything shows green.
    • image
  4. Configure SharePoint email
  5. Configure mail client (Windows Live Mail)
    • Pretty easy but the trick is to get the IMAP/SMTP server name and port numbers typed correctly.   Save the password.
    • image
    • image
    • image
    • image
  6. Test scenarios 
    • Send to SharePoint library.   Configure a library to receive email, make note of the address.   Send a test message with attachments.   Wait up to 5 minutes, you should see new content in SharePoint now.
    • Receive SharePoint alert.   Subscribe to an alert.  You should see a welcome message.  Trigger the alert by uploading content.   You should see a single notification.
    • User to user.   Make a second user and send a message from that person.   You probably need to Log Out between sessions, but it proves the internal hMail user mail routing works.
  7. Enjoy and grab a cold beer!

So there you have it.   I’ve tried many techniques (2nd VM, Exchange, SMTP only) and this is the best combination I’ve found yet.  It allows fully inbound and outbound for SharePoint along with peer-to-peer email amongst users.  It also works great on SharePoint 2007.   This robust functionality allows me to demo anything SharePoint can offer with the confidence it will work flawlessly.  If you have any questions or comments please feel free to leave them below.  I always enjoy hearing from people.  Hot