I have some code[1] that bidirectionally syncs gmail labels into tags in notmuch, but it's not fast enough to be run continuously. Eventually, and I mean that with the longest possible value, I'll get around to fixing that. If you're interested in trying to fix it I can explain the issues and some ideas I had to fix it.<div>
<br></div><div>[1] <a href="http://alexbl.net/~alexbl/imapsync.py">http://alexbl.net/~alexbl/imapsync.py</a></div><div><br><br><div class="gmail_quote">On Wed, Feb 8, 2012 at 12:19 AM, Bhaskara Marthi <span dir="ltr"><<a href="mailto:bhaskara@gmail.com">bhaskara@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div class="im">On Sat, Feb 4, 2012 at 4:35 AM, Jani Nikula <span dir="ltr"><<a href="mailto:jani@nikula.org" target="_blank">jani@nikula.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Sat, 04 Feb 2012 09:15:16 +0000, David Edmondson <<a href="mailto:dme@dme.org" target="_blank">dme@dme.org</a>> wrote:<br>
> On Sat, 4 Feb 2012 03:39:23 -0500, don warner saklad <<a href="mailto:don.saklad@gmail.com" target="_blank">don.saklad@gmail.com</a>> wrote:<br>
> > a) For gmail how do you setup notmuch mail ?...<br>
> ><br>
> > b) Any workarounds?<br>
> ><br>
> > c) Any kludges?<br>
<br>
</div>I'll describe my own setup for using notmuch with gmail. I don't pretend<br>
it will work for everyone, but you might find some bits of it useful.<br>
<br>
I don't even try to sync notmuch tags and gmail labels (because I rarely<br>
use the labels or the web interface anyway), but I do get sync for<br>
"unread" and "flagged" (gmail and Android "starred"). You'll need<br>
maildir.synchronize_flags = true in your ~/.notmuch-config for this.<br></blockquote></div><div><br>I'm using a similar setup. An inconvenience with the setup is that I have various filters in gmail that filter, e.g., mailing list mails by skipping the gmail inbox and applying specific tags. As a result when I look at my gmail inbox, I don't see these (many) mailing list messages. With offlineimap+notmuch, however, since it just gets all the messages from [Gmail]/All Mail, it has no way of distinguishing between these two classes of messages, and so the notmuch new and unread message lists contain many messages that I don't want to look at. Ideally, I'd like a view in notmuch that shows the same messages as the gmail inbox. Is there a way to accomplish this?<span class="HOEnZb"><font color="#888888"><br>
- b<br><br> </font></span></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><br>
> Many people around here do that using offlineimap, which will<br>
> synchronise an IMAP server (Gmail in this instance) with various local<br>
> directories in Maildir format.<br>
<br>
</div>I use offlineimap. I run it from the notmuch pre-new hook. This means I<br>
have to run "notmuch new" to receive new mail.<br>
<br>
$ cat ~/.maildir/.notmuch/hooks/pre-new<br>
#!/bin/sh<br>
exec /usr/bin/offlineimap<br>
<br>
I only sync "All Mail" from gmail. Perhaps there would be some<br>
optimizations that could be done, but I haven't bothered yet.<br>
<br>
$ cat ~/.offlineimaprc<br>
[general]<br>
accounts = Gmail<br>
ui = Noninteractive.Basic<br>
<br>
[Account Gmail]<br>
localrepository = Local<br>
remoterepository = Remote<br>
<br>
[Repository Local]<br>
type = Maildir<br>
localfolders = ~/.maildir<br>
<br>
[Repository Remote]<br>
type = IMAP<br>
ssl = yes<br>
remotehost = <a href="http://imap.gmail.com" target="_blank">imap.gmail.com</a><br>
remoteuser = <a href="mailto:USER@gmail.com" target="_blank">USER@gmail.com</a><br>
expunge = no<br>
realdelete = no<br>
<br>
folderfilter = lambda foldername: foldername in ['[Gmail]/All Mail']<br>
nametrans = lambda foldername: re.sub('^\[Gmail\]/All Mail', 'gmail', foldername)<br>
<div><br>
> Sending mail via Gmail can be done in various ways. You can set up your<br>
> local MTA (Postfix, Exim, ...) to deliver mail via Gmail, or have Emacs<br>
> do the same directly using the smtpmail.el package.<br>
<br>
</div>Personally I use msmtp (msmtp and msmtp-mta packages in Debian based<br>
distros). The msmtp-mta sets up a sendmail-like binary that works out of<br>
the box in Emacs. Beware that it doesn't have a local queue, it works<br>
synchronously.<br>
<br>
$ cat ~/.msmtprc<br>
defaults<br>
logfile ~/.msmtp.log<br>
tls_trust_file /etc/ssl/certs/ca-certificates.crt<br>
<br>
account default<br>
host <a href="http://smtp.gmail.com" target="_blank">smtp.gmail.com</a><br>
from <a href="mailto:USER@gmail.com" target="_blank">USER@gmail.com</a><br>
tls on<br>
tls_starttls off<br>
auth on<br>
user <a href="mailto:USER@gmail.com" target="_blank">USER@gmail.com</a><br>
<br>
Finally, I use goobook to use the gmail contacts as addressbook in<br>
Emacs. See <a href="http://mid.gmane.org/87zkfuh3i0.fsf@nikula.org" target="_blank">http://mid.gmane.org/87zkfuh3i0.fsf@nikula.org</a> for that.<br>
<br>
<br>
HTH,<br>
Jani.<br>
<div><div>_______________________________________________<br>
notmuch mailing list<br>
<a href="mailto:notmuch@notmuchmail.org" target="_blank">notmuch@notmuchmail.org</a><br>
<a href="http://notmuchmail.org/mailman/listinfo/notmuch" target="_blank">http://notmuchmail.org/mailman/listinfo/notmuch</a><br>
</div></div></blockquote></div></div></div><br>
<br>_______________________________________________<br>
notmuch mailing list<br>
<a href="mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a><br>
<a href="http://notmuchmail.org/mailman/listinfo/notmuch" target="_blank">http://notmuchmail.org/mailman/listinfo/notmuch</a><br>
<br></blockquote></div><br></div>