[CentOS] Monitor email for office365.com with fetchmail

Thu Feb 13 16:54:42 UTC 2020
isdtor <isdtor at gmail.com>

Jerry Geis writes:
> I am trying to use fetchmail to monitor box in office365.com.
> Its not working.
> 
> Is there a "better" way to monitor and inbox ?
> 
> I have verified all the ports are open, using 993, using ssl, using
> sslproto SSL3 etc..
> 
> Anyone done this ? Got it working.
> 
> I basically have:
> machine outlook.office365.com
> login myuser at mydomain
> password mypassword
> 
> fetchmail --ssl --sslproto SSL3 --smtpname X -u X outlook.office365.com

Yes - but I'm using a custom version of fetchmail 6.4, rebuilt from Fedora IIRC. It does SSL things a bit differently, so I built it with a static copy of the latest openssl rather than what comes with centos.

set invisible
poll outlook.office365.com protocol IMAP service 993 auth password
   user "username" password "password" folder Inbox is mylocalname here
   no idle
   no rewrite
   sslcertpath /home/mylocalname/.certs

The .certs directory contains the complete certificate chain for O365, hashed with c_rehash (three certs), so fetchmail is independent of the OS certificate store.