February 5, 2011 in Uncategorized
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:
- 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.
- Install SMTP from Windows Server Manager (details here) Configure on TCP port 26 with FQDN as the host header (i.e. “sp2010.demo.com”)
- 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.
- Create user accounts. I have email@example.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 (firstname.lastname@example.org) and has no dependency on any Active Directory user object.
- Disable AutoBan. During failed logins this could lock the user account, excessive for DEV.
- 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.
- Enable mail relay. This will allow FQDN (i.e. sp2010.demo.com) messages to reach the IIS SMTP drop folder and SharePoint.
- 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.
- Run Diagnostics. If done correctly everything shows green.
- Open SharePoint Central Admin (note: below steps are the same for 2007)
- System Settings > Configure outgoing e-mail settings
- System Settings > Configure incoming e-mail settings
- Use “automatic” settings and it will look at the IIS SMTP settings. The default values are OK here.
- For deploying a full scale production system please review these articles:
- TechNet – Plan incoming e-mail (SharePoint Foundation 2010)
- TechNet – Configure incoming e-mail (SharePoint Server 2010)
- 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.
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.