If you're religious about Gmail like me, but your University or work is dead set on Exchange, then this post is for you. Using this implementation I have fully functional send/receive capability with gmail as a client to my Exchange server.
Big thanks to Andrew Back for this post detailing how he got a similar setup going on Linux.
What you'll need:
Big thanks to Andrew Back for this post detailing how he got a similar setup going on Linux.
What you'll need:
- A working gmail account.
- DavMail
- Java
- An "always-on" internet connection and a computer you don't mind leaving powered up 24/7. Your PC will act as a gateway for gmail to connect to Exchange - when the gateway is powered off or disconnected from the internet, you won't be able to read your email with gmail.
- Install DavMail.
- Open a terminal as an administrator and navigate to keytool.exe in the Java installation folder.
- Create a self-signed certificate using keytool. But don't just copy-paste the command they gave you: you need to set your own password.
- The self-signed key is created as davmail.p12 in the same folder. Copy it to the DavMail installation folder.
- Run DavMail. Make sure your settings look like this (they won't by default):
- Fill in your Exchange server's OWA address in the Main tab, and the password (you picked it in step 3) for the Key store password.
- You might want to uncheck "POP mark read" under the Advanced tab. "POP mark read" instructs the gmail client to mark emails as read on the Exchange server when they are downloaded and read in gmail.
- To verify everything is working, go to canyouseeme.org and make sure your local POP port in the DavMail server is visible. If it is blocked, you may be behind a firewall and will have to forward your ports.
- CanYouseeMe.org will also tell you your IP address. Write it down.
- Some kind of dynamic DNS (such as dyndns.org etc) is an excellent idea here as well. Without it, every time your IP address changes you will be unable to get your email until you reset gmail's SMTP and POP settings to match the new address.
- Log in to Gmail. Navigate to Settings -> Accounts and Import.
- Next to "Send mail as:", click on "Add another email address you own."
- Enter the email address from the Exchange server. Uncheck "Treat as an alias". (Click here for why.) Click next.
- Select the radio button "Send through xyz.com SMTP servers". Under SMTP server, enter your own IP address (you got it in Step 9) and set the port to 587. Enter your username and password normally. Check the "Secured connection using SSL" option.
- You should now be able to send email through Exchange with Gmail as your client. You might want to test it, but note that you won't be able to receive email until you complete the following steps.
- Go back to gmail settings. Under "Check mail using POP3:" hit "Add a POP3 mail account you own". The process is pretty much the same. Enter your Exchange username and password. Set POP server to your IP address (again, Step 9) and the port to 1110. Check "Always use secure connection (SSL) when retrieving mail." You probably want to check "Leave a copy of retrieved message on the server". Otherwise, gmail will automatically delete messages off the server the instant they are downloaded to your gmail account. (Then again, if your institution is forcing you to use Exchange, they're so evil they probably gave you a tiny email quota too; in that case, you might want to leave it disabled so the account on the server doesn't fill up.) Hit Add Account.
- You should now be able to receive email from Exchange through your Gmail account as long as the PC with DavMail remains online.