From: Jani Nikula Date: Sat, 4 Feb 2012 12:35:05 +0000 (+0200) Subject: Re: For gmail how do you setup notmuch mail ?... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=415c12c79b477652608fa08336c693e7f46fc16c;p=notmuch-archives.git Re: For gmail how do you setup notmuch mail ?... --- diff --git a/f9/c29095d1015326cabb9a5ddfc6076dceb451df b/f9/c29095d1015326cabb9a5ddfc6076dceb451df new file mode 100644 index 000000000..ee62ebc87 --- /dev/null +++ b/f9/c29095d1015326cabb9a5ddfc6076dceb451df @@ -0,0 +1,139 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 4B982431FAF + for ; Sat, 4 Feb 2012 04:35:14 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id d7bP1EjaiBbS for ; + Sat, 4 Feb 2012 04:35:12 -0800 (PST) +Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com + [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 65AA9431FAE + for ; Sat, 4 Feb 2012 04:35:12 -0800 (PST) +Received: by lahd3 with SMTP id d3so2505502lah.26 + for ; Sat, 04 Feb 2012 04:35:09 -0800 (PST) +Received: by 10.112.36.65 with SMTP id o1mr2904518lbj.32.1328358909423; + Sat, 04 Feb 2012 04:35:09 -0800 (PST) +Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi. + [84.248.80.253]) + by mx.google.com with ESMTPS id k13sm7456921lbu.16.2012.02.04.04.35.07 + (version=SSLv3 cipher=OTHER); Sat, 04 Feb 2012 04:35:08 -0800 (PST) +From: Jani Nikula +To: David Edmondson , don.saklad@gmail.com, + notmuch@notmuchmail.org +Subject: Re: For gmail how do you setup notmuch mail ?... +In-Reply-To: +References: + + +User-Agent: Notmuch/0.11+139~g4340989 (http://notmuchmail.org) Emacs/23.3.1 + (i686-pc-linux-gnu) +Date: Sat, 04 Feb 2012 14:35:05 +0200 +Message-ID: <871uqag4jq.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 04 Feb 2012 12:35:14 -0000 + +On Sat, 04 Feb 2012 09:15:16 +0000, David Edmondson wrote: +> On Sat, 4 Feb 2012 03:39:23 -0500, don warner saklad wrote: +> > a) For gmail how do you setup notmuch mail ?... +> > +> > b) Any workarounds? +> > +> > c) Any kludges? + +I'll describe my own setup for using notmuch with gmail. I don't pretend +it will work for everyone, but you might find some bits of it useful. + +I don't even try to sync notmuch tags and gmail labels (because I rarely +use the labels or the web interface anyway), but I do get sync for +"unread" and "flagged" (gmail and Android "starred"). You'll need +maildir.synchronize_flags = true in your ~/.notmuch-config for this. + +> Many people around here do that using offlineimap, which will +> synchronise an IMAP server (Gmail in this instance) with various local +> directories in Maildir format. + +I use offlineimap. I run it from the notmuch pre-new hook. This means I +have to run "notmuch new" to receive new mail. + +$ cat ~/.maildir/.notmuch/hooks/pre-new +#!/bin/sh +exec /usr/bin/offlineimap + +I only sync "All Mail" from gmail. Perhaps there would be some +optimizations that could be done, but I haven't bothered yet. + +$ cat ~/.offlineimaprc +[general] +accounts = Gmail +ui = Noninteractive.Basic + +[Account Gmail] +localrepository = Local +remoterepository = Remote + +[Repository Local] +type = Maildir +localfolders = ~/.maildir + +[Repository Remote] +type = IMAP +ssl = yes +remotehost = imap.gmail.com +remoteuser = USER@gmail.com +expunge = no +realdelete = no + +folderfilter = lambda foldername: foldername in ['[Gmail]/All Mail'] +nametrans = lambda foldername: re.sub('^\[Gmail\]/All Mail', 'gmail', foldername) + +> Sending mail via Gmail can be done in various ways. You can set up your +> local MTA (Postfix, Exim, ...) to deliver mail via Gmail, or have Emacs +> do the same directly using the smtpmail.el package. + +Personally I use msmtp (msmtp and msmtp-mta packages in Debian based +distros). The msmtp-mta sets up a sendmail-like binary that works out of +the box in Emacs. Beware that it doesn't have a local queue, it works +synchronously. + +$ cat ~/.msmtprc +defaults +logfile ~/.msmtp.log +tls_trust_file /etc/ssl/certs/ca-certificates.crt + +account default +host smtp.gmail.com +from USER@gmail.com +tls on +tls_starttls off +auth on +user USER@gmail.com + +Finally, I use goobook to use the gmail contacts as addressbook in +Emacs. See http://mid.gmane.org/87zkfuh3i0.fsf@nikula.org for that. + + +HTH, +Jani.