Here is my OfflineIMAP ~/.offlineimaprc for Gmail (G Suite) and Outlook (Office 365):
[general]
accounts = Gmail, Outlook
maxsyncaccounts = 2[Account Gmail]
localrepository = LocalGmail
remoterepository = RemoteGmail[Account Outlook]
localrepository = LocalOutlook
remoterepository = RemoteOutlook[Repository LocalGmail]
type = Maildir
localfolders = ~/Mail/Gmail_Offlineimap[Repository LocalOutlook]
type = Maildir
localfolders = ~/Mail/Outlook_Offlineimap[Repository RemoteGmail]
type = Gmail
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
auth_mechanisms = LOGIN
remotehost = imap.gmail.com
remoteuser = djalil@chafai.net
remotepass = xxx
maxconnections = 1
realdelete = no
folderfilter = lambda foldername: foldername in [‘[Gmail]/Tous les messages’][Repository RemoteOutlook]
type = IMAP
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
auth_mechanisms = PLAIN
remotehost = outlook.office365.com
remoteuser = dchafai@dauphine.fr
remotepass = xxx
readonly = true
folderfilter = lambda folder: folder in [ ‘Sent’, ‘INBOX’, ‘Archive’ ]
I use it for email backup via the following crontab on my Debian GNU/Linux home server:
2 2 * * * offlineimap -u Quiet
An alternative is to use Davmail to convert EWS into IMAP or POP3.
Leave a Comment