<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/assets/rss.xsl" type="text/xsl"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
<channel>
	<title>Sacha Chua - tag - offlineimap</title>
	<atom:link href="https://sachachua.com/blog/tag/offlineimap/feed/index.xml" rel="self" type="application/rss+xml" />
	<atom:link href="https://sachachua.com/blog/tag/offlineimap" rel="alternate" type="text/html" />
	<link>https://sachachua.com/blog/tag/offlineimap/feed/index.xml</link>
	<description>Emacs, sketches, and life</description>
	<lastBuildDate>Mon, 06 Apr 2026 14:36:57 GMT</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>daily</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>11ty</generator>
  <item>
		<title>Geek: How to use offlineimap and the dovecot mail server to read your Gmail in Emacs efficiently</title>
		<link>https://sachachua.com/blog/2008/05/geek-how-to-use-offlineimap-and-the-dovecot-mail-server-to-read-your-gmail-in-emacs-efficiently/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Fri, 09 May 2008 02:07:09 GMT</pubDate>
    <category>emacs</category>
<category>geek</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=4858</guid>
		<description><![CDATA[<div class="update">2015-12-24: Updated with config changes now that I&#8217;m back to using Gnus+dovecot+offlineimap+Gmail</div>
<div class="update">2014-04-09: This post is from 2008. =) I think I used dovecot+offlineimap because Gnus and maildir weren&#8217;t getting along properly and directly connecting with IMAP to Gmail&#8217;s server was slow, but things have probably changed a fair bit since then. I eventually moved to using the Gmail web interface for most things, but I still miss my Gnus setup!</div>
<blockquote>
<ol>
</ol>
<ol>
<li>Make sure you&#8217;ve set up Postfix or some other mail server that can send mail.</li>
<li>Install dovecot (IMAP server) and offlineimap (IMAP synchronization). You can probably find binaries for your distribution.</li>
<li>Edit /etc/dovecot/conf.d/10-mail.conf and set the following:
<pre>mail_location = maildir:~/Maildir:LAYOUT=fs</pre>
</li>
<li>Use the instructions from <a href="http://unix.stackexchange.com/questions/44214/encrypt-offlineimap-password">http://unix.stackexchange.com/questions/44214/encrypt-offlineimap-password</a> to set up GPG-encrypted passwords. (optional)</li>
<li>Put the following in ~/.offlineimaprc, changing the details as needed.
<pre>[general]
accounts = SachaGmail
pythonfile = ~/bin/offlineimap-password.py

[Account SachaGmail]
localrepository = Local
remoterepository = Gmail
status_backend = sqlite

[Repository Local]
type = Maildir
localfolders = ~/Maildir

[Repository Gmail]
type = Gmail
maxconnections = 2
remoteuser = sacha@sachachua.com
realdelete = no
folderfilter = lambda foldername: foldername in ['INBOX', '[Gmail]/All Mail', '[Gmail]/Sent Mail', '[Gmail].Starred', '[Gmail].Drafts', '[Gmail].Important']
nametrans = lambda folder: re.sub('^INBOX$', '[Gmail].Inbox', folder)
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
remotepasseval = mailpasswd("gmail")
</pre>
<p>If you feel comfortable specifying your password in your ~/.offlineimaprc, you can do so by changing remotepasseval to remotepass. If so, you don&#8217;t need the pythonfile line.</p></li>
<li><kbd>chmod go-rwx ~/.offlineimaprc</kbd> for a little bit of safety.</li>
<li>Type <b>offlineimap</b> to start synchronizing.</li>
<li>While that&#8217;s synchronizing, use something like this as your ~/.gnus:
<pre>(setq gnus-select-method
      '(nnimap "Mail"
	       (nnimap-address "localhost")
	       (nnimap-stream network)
	       (nnimap-authenticator login)))

(setq user-mail-address "youremail@example.com")
(setq gnus-ignored-from-addresses "youruser")
</pre>
</li>
<li>Start Emacs. Start Gnus with M-x gnus. If you don&#8217;t see the INBOX group, press ^ (gnus-group-enter-server-mode), open nnimap:Mail, move your cursor to the INBOX, and either press RET to go into the group or press u (gnus-browse-unsubscribe-current-group) to toggle the subscription status until you&#8217;re subscribed to the group. Then it should show up on the group screen (M-x gnus).</li>
</ol>
<p>Hope that helps. Have fun!</p></blockquote>

<p>You can <a href="https://sachachua.com/blog/2008/05/geek-how-to-use-offlineimap-and-the-dovecot-mail-server-to-read-your-gmail-in-emacs-efficiently/#comment">view 6 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2008%2F05%2Fgeek-how-to-use-offlineimap-and-the-dovecot-mail-server-to-read-your-gmail-in-emacs-efficiently%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item>
	</channel>
</rss>