Wednesday, 16 April 2014

Configuring SMTP relay for Office365 / Exchange Online

You've just migrated your mailboxes to the Office365. But what to do with copiers & printers which don't want to work with Office365 account, because they don't allow to use TLS?
Or how to send error or information events from your servers if you are using simple SMTP send?
Answer is - install SMTP server feature!
I will show you how to do this using 2012R2 server as a relay for SMTP.

First: you need to install SMTP on the server
1. Go to server manager, click Add roles and features and select SMTP Server feature. Standard installation is simple -after clicking 'Next' several times and 'Finish' in the wizard you will have SMTP server installed on your machine.
2. Go to the Server Manager again and click Tools: Internet Information Services (IIS) 6.0 Manager.

SECOND: configure SMTP server properties 3. Click on the [SMTP Virtual Server #1] and right click for properties

4. In the General tab in IP address section, select Advanced...:

Here you can configure port/ports on which your server will listen for connections
You can change it every time you will need it.
Click OK.

5. In the General tab you can limit connections to SMTP server to prevent flood of mails - for example from application which sent too much of them because of an error.
Use then "Limit number of connections to:" and put the number of connections.
I will leave this empty.

6. In the Access tab go to Authentication... Select Anonymous access only

Click OK.

7. Still in Access tab click Connection...I prefer to use "Only the list below".
Ir you are using this option, provide all IP addresses which will be using this SMTP server as a relay. Don't forget to add localhost:

8. Still in Access tab click Relay...Select hosts that will be relayed

9. In the messages tab you can configure message size, session size, number of messages per connection and number of recipients per message. You can change badmail directory too.

10. In the delivery tab you can play with retry, reply and expiration timeout intervals.
To configure delivery to Office365, go to Outbound Security..

11. In the Outbound Security window select Basic authentication and put your user name and password to the Office365 account, select TLS encryption. Click OK.

12. In the Delivery tab select Outbound connections...

13. In the Outbound connections window select 587 as a TCP port. Click OK.
You can configure here limit of outbound connections too.

14. In the Delivery tab, go to Advanced...Enter as a Smart host. Click OK

15. Click OK to accept all settings and close [SMTP Virtual Server#1] window.

THIRD: Add domain/domains that you are managing through the Office365

16. Go to the Domains section in SMTP Virtual Server - click Domains in the left pane.
In the right pane you should see only internal domain.

17. Add your domain that you are managing in Office365. Right click on the empty field in the right pane or on the Domain in the left pane and select New - Domain... 

18. Select Remote as a domain type, click Next

19. Enter domain name, click Finish

20. In the right pane you will see now new, added domain.

21. Click on this new domain in the right pane, do the right click and select Properties.

22. In the General tab select "Allow incoming mail to be relayed to this domain"

23. Still in General tab, select Outbound Security...

24. In the Outbound Security select Basic authentication, TLS encryption and fill in user name and password for Office365 account used to deliver mails in Office365. This is the same settings that was set in the step 11.

25. Click OK to leave the configuration menu.

26. It's always good to restart service after changes applied. So go to the IIS 6 Manager, right click IIS server name and select All Tasks - Restart IIS...

27. After service restart, refresh window with F5, click somewhere in the empty field, select [SMTP virtual server] and click Start

28. You can now test SMTP server and it's relaying function, for example using telnet.


  1. This comment has been removed by the author.

  2. This is a truly good site post. Not too many people would actually, the way you just did. I am really impressed that there is so much information about this subject that have been uncovered and you’ve done your best, with so much class. If wanted to know more about green smoke reviews, than by all means come in and check our stuff. Free online notepad

  3. So luck to come across your excellent blog. Your blog brings me a great deal of fun.. Good luck with the site. แทงบอล

  4. I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. sit in kayak

  5. Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work! sito web

  6. Every healthcare facility, whether small or large, has to maintain proper and consistent medical transcription. task list templates

  7. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites! USA RDP

  8. I am overwhelmed by your post with such a nice topic. Usually I visit your blogs and get updated through the information you include but today’s blog would be the most appreciable. Well done! private rdp

  9. I want to say thanks to you. I have bookmark your site for future updates.

  10. Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!.

  11. Otherwise called a single direction work, a message digest, a unique mark or a checksum, the calculation makes a fixed-length yield that can't be turned around. Keyless rod relay

  12. Awesome and interesting article. Great things you've always shared with us. Thanks. Just continue composing this kind of post. 꽁머니

  13. We have sell some products of different custom is very useful and very low price please visits this site thanks and please share this post with your friends. 토토꽁머니