Hi mgerio,
As I understand it, you want to ports that should be allowed to access Exchange Online and Lync Online service. I recommend you refer to the following links to check the ports that used in Office 365:
URLs, ports, and IP adresses used in Office 365: http://technet.microsoft.com/en-us/library/hh852445.aspx
Office 365 URLs and IP address ranges: http://technet.microsoft.com/en-us/library/hh373144.aspx
Thanks,
Anna Shi