{"id":9671,"date":"2017-11-26T10:09:04","date_gmt":"2017-11-26T09:09:04","guid":{"rendered":"http:\/\/djalil.chafai.net\/blog\/?p=9671"},"modified":"2018-12-26T13:56:32","modified_gmt":"2018-12-26T12:56:32","slug":"offlineimap-for-gmail-and-outlook","status":"publish","type":"post","link":"https:\/\/djalil.chafai.net\/blog\/2017\/11\/26\/offlineimap-for-gmail-and-outlook\/","title":{"rendered":"OfflineIMAP for Gmail and Outlook"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-9274\" src=\"http:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2016\/12\/numerique371-300x218.png\" alt=\"Tunnel num\u00e9rique\" width=\"300\" height=\"218\" srcset=\"https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2016\/12\/numerique371-300x218.png 300w, https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2016\/12\/numerique371-150x109.png 150w, https:\/\/djalil.chafai.net\/blog\/wp-content\/uploads\/2016\/12\/numerique371.png 371w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Here is my <a href=\"https:\/\/en.wikipedia.org\/wiki\/OfflineIMAP\"><strong>OfflineIMAP<\/strong><\/a>\u00a0<em>~\/.offlineimaprc<\/em> for <a href=\"https:\/\/en.wikipedia.org\/wiki\/Gmail\">Gmail<\/a> (<a href=\"https:\/\/en.wikipedia.org\/wiki\/G_Suite\">G Suite<\/a>) and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microsoft_Outlook\">Outlook<\/a> (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Office_365\">Office 365<\/a>):<\/p>\n<blockquote><p>[general]<br \/>\naccounts = Gmail, Outlook<br \/>\nmaxsyncaccounts = 2<\/p>\n<p>[Account Gmail]<br \/>\nlocalrepository = LocalGmail<br \/>\nremoterepository = RemoteGmail<\/p>\n<p>[Account Outlook]<br \/>\nlocalrepository = LocalOutlook<br \/>\nremoterepository = RemoteOutlook<\/p>\n<p>[Repository LocalGmail]<br \/>\ntype = Maildir<br \/>\nlocalfolders = ~\/Mail\/Gmail_Offlineimap<\/p>\n<p>[Repository LocalOutlook]<br \/>\ntype = Maildir<br \/>\nlocalfolders = ~\/Mail\/Outlook_Offlineimap<\/p>\n<p>[Repository RemoteGmail]<br \/>\ntype = Gmail<br \/>\nssl = yes<br \/>\nsslcacertfile = \/etc\/ssl\/certs\/ca-certificates.crt<br \/>\nauth_mechanisms = LOGIN<br \/>\nremotehost = imap.gmail.com<br \/>\nremoteuser = djalil@chafai.net<br \/>\nremotepass = xxx<br \/>\nmaxconnections = 1<br \/>\nrealdelete = no<br \/>\nfolderfilter = lambda foldername: foldername in ['[Gmail]\/Tous les messages']<\/p>\n<p>[Repository RemoteOutlook]<br \/>\ntype = IMAP<br \/>\nssl = yes<br \/>\nsslcacertfile = \/etc\/ssl\/certs\/ca-certificates.crt<br \/>\nauth_mechanisms = PLAIN<br \/>\nremotehost = outlook.office365.com<br \/>\nremoteuser = dchafai@dauphine.fr<br \/>\nremotepass = xxx<br \/>\nreadonly = true<br \/>\nfolderfilter = lambda folder: folder in [ 'Sent', 'INBOX', 'Archive' ]<\/p><\/blockquote>\n<p>I use it for email backup via the following <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cron\">crontab<\/a> on my <a href=\"https:\/\/en.wikipedia.org\/wiki\/Debian\">Debian GNU\/Linux<\/a> home server:<\/p>\n<blockquote><p>2 2 * * * offlineimap -u Quiet<\/p><\/blockquote>\n<p>An alternative is to use <a href=\"https:\/\/packages.debian.org\/stable\/davmail\">Davmail<\/a> to convert <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microsoft_Exchange_Server\">EWS<\/a>\u00a0into <a href=\"https:\/\/en.wikipedia.org\/wiki\/Internet_Message_Access_Protocol\">IMAP<\/a> or <a href=\"https:\/\/en.wikipedia.org\/wiki\/Post_Office_Protocol\">POP3<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is my OfflineIMAP&nbsp;~\/.offlineimaprc for Gmail (G Suite) and Outlook (Office 365): [general] accounts = Gmail, Outlook maxsyncaccounts = 2 [Account Gmail] localrepository = LocalGmail&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/djalil.chafai.net\/blog\/2017\/11\/26\/offlineimap-for-gmail-and-outlook\/\">Continue reading<span class=\"screen-reader-text\">OfflineIMAP for Gmail and Outlook<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":210},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/posts\/9671"}],"collection":[{"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/comments?post=9671"}],"version-history":[{"count":29,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/posts\/9671\/revisions"}],"predecessor-version":[{"id":11012,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/posts\/9671\/revisions\/11012"}],"wp:attachment":[{"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/media?parent=9671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/categories?post=9671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/djalil.chafai.net\/blog\/wp-json\/wp\/v2\/tags?post=9671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}