Microsoft Office 365 port requirements

Sr No Protocol Port Usage
       
1 TCP 443 Office 365 portal (admin and user), Outlook, OWA, SharePoint
2 TCP 25 Mail routing
3 TCP 587 SMTP relay
4 TCP 143/993 IMAP Simple Migration Tool
5 TCP 80/443 Microsoft Azure Active Directory Sync tool, mail migration tools,
6 TCP 995 POP3(S)
7 PSOM/TLS 443 Lync Online – outbound data sharing
8 STUN/TCP 443 Lync Online (outbound audio, video, and application sharing
9 STUN/UDP 3478 Lync Online (outbound audio and video sessions)
10 TCP 5223 Lync mobile client push notifications
11 UDP 20000-45000 Lync-to-phone outbound
12 RTC/UDP 50000-59000 Lync (outbound audio and video sessions)

For more information on port requirements, check Office 365 portal.