unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* For gmail how do you setup notmuch mail ?...
@ 2012-02-04  8:39 don warner saklad
  2012-02-04  9:15 ` David Edmondson
  0 siblings, 1 reply; 8+ messages in thread
From: don warner saklad @ 2012-02-04  8:39 UTC (permalink / raw)
  To: notmuch

a) For gmail how do you setup notmuch mail ?...

b) Any workarounds?

c) Any kludges?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: For gmail how do you setup notmuch mail ?...
  2012-02-04  8:39 For gmail how do you setup notmuch mail ? don warner saklad
@ 2012-02-04  9:15 ` David Edmondson
  2012-02-04 12:35   ` Jani Nikula
  0 siblings, 1 reply; 8+ messages in thread
From: David Edmondson @ 2012-02-04  9:15 UTC (permalink / raw)
  To: don.saklad, notmuch

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

On Sat, 4 Feb 2012 03:39:23 -0500, don warner saklad <don.saklad@gmail.com> wrote:
> a) For gmail how do you setup notmuch mail ?...
> 
> b) Any workarounds?
> 
> c) Any kludges?

notmuch wants to be able to access your mail as individual files in the
filesystem. That means you need a way to get the mail from Gmail onto
your local system.

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.

You can also use fetchmail or getmail or ... to achieve similar end
results, but I think that offlineimap is more common and therefore
you're more likely to get help.

You could, of course, have Gmail forward your mail to some place that
you can run an SMTP server and notmuch.

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.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: For gmail how do you setup notmuch mail ?...
  2012-02-04  9:15 ` David Edmondson
@ 2012-02-04 12:35   ` Jani Nikula
  2012-02-08  8:19     ` Bhaskara Marthi
  0 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2012-02-04 12:35 UTC (permalink / raw)
  To: David Edmondson, don.saklad, notmuch

On Sat, 04 Feb 2012 09:15:16 +0000, David Edmondson <dme@dme.org> wrote:
> On Sat, 4 Feb 2012 03:39:23 -0500, don warner saklad <don.saklad@gmail.com> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: For gmail how do you setup notmuch mail ?...
  2012-02-04 12:35   ` Jani Nikula
@ 2012-02-08  8:19     ` Bhaskara Marthi
  2012-02-08  8:24       ` Alex Botero-Lowry
  0 siblings, 1 reply; 8+ messages in thread
From: Bhaskara Marthi @ 2012-02-08  8:19 UTC (permalink / raw)
  To: Jani Nikula; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 3504 bytes --]

On Sat, Feb 4, 2012 at 4:35 AM, Jani Nikula <jani@nikula.org> wrote:

> On Sat, 04 Feb 2012 09:15:16 +0000, David Edmondson <dme@dme.org> wrote:
> > On Sat, 4 Feb 2012 03:39:23 -0500, don warner saklad <
> don.saklad@gmail.com> 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.
>

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?
- b



>
> > 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.
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
>

[-- Attachment #2: Type: text/html, Size: 4937 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: For gmail how do you setup notmuch mail ?...
  2012-02-08  8:19     ` Bhaskara Marthi
@ 2012-02-08  8:24       ` Alex Botero-Lowry
  2012-02-08  9:15         ` Patrick Totzke
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Botero-Lowry @ 2012-02-08  8:24 UTC (permalink / raw)
  To: Bhaskara Marthi; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 4229 bytes --]

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.

[1] http://alexbl.net/~alexbl/imapsync.py


On Wed, Feb 8, 2012 at 12:19 AM, Bhaskara Marthi <bhaskara@gmail.com> wrote:

>
>
> On Sat, Feb 4, 2012 at 4:35 AM, Jani Nikula <jani@nikula.org> wrote:
>
>> On Sat, 04 Feb 2012 09:15:16 +0000, David Edmondson <dme@dme.org> wrote:
>> > On Sat, 4 Feb 2012 03:39:23 -0500, don warner saklad <
>> don.saklad@gmail.com> 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.
>>
>
> 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?
> - b
>
>
>
>>
>> > 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.
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch
>>
>
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
>
>

[-- Attachment #2: Type: text/html, Size: 6174 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: For gmail how do you setup notmuch mail ?...
  2012-02-08  8:24       ` Alex Botero-Lowry
@ 2012-02-08  9:15         ` Patrick Totzke
  2012-02-08 10:00           ` Jani Nikula
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick Totzke @ 2012-02-08  9:15 UTC (permalink / raw)
  To: Alex Botero-Lowry, Bhaskara Marthi; +Cc: notmuch

Quoting Alex Botero-Lowry (2012-02-08 08:24:51)
>    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. ... 
>    Ideally, I'd like a view in notmuch that shows the same messages as the
>    gmail inbox.  Is there a way to accomplish this?
>    - b

You could sync every subfolder *but* "All Mail" instead of just this folder:
Gmail tags are available as imap folders. You can then tune your tagging filters
to sort by folder: queries.
HTH,
/p

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: For gmail how do you setup notmuch mail ?...
  2012-02-08  9:15         ` Patrick Totzke
@ 2012-02-08 10:00           ` Jani Nikula
  2012-02-09  6:02             ` Bhaskara Marthi
  0 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2012-02-08 10:00 UTC (permalink / raw)
  To: Patrick Totzke, Alex Botero-Lowry, Bhaskara Marthi; +Cc: notmuch

On Wed, 08 Feb 2012 09:15:59 -0000, Patrick Totzke <patricktotzke@googlemail.com> wrote:
> Quoting Alex Botero-Lowry (2012-02-08 08:24:51)
> >    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. ... 
> >    Ideally, I'd like a view in notmuch that shows the same messages as the
> >    gmail inbox.  Is there a way to accomplish this?
> >    - b
> 
> You could sync every subfolder *but* "All Mail" instead of just this
> folder: Gmail tags are available as imap folders. You can then tune
> your tagging filters to sort by folder: queries.

That's a good alternative only if you have relatively few messages that
have many gmail labels assigned to them. Otherwise you end up syncing
the same messages many times through many IMAP folders (each
corresponding to one label).

My approach is basically to reproduce the gmail filters as saved
searches in emacs. The messages need not have tags. YMMV.

Jani.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: For gmail how do you setup notmuch mail ?...
  2012-02-08 10:00           ` Jani Nikula
@ 2012-02-09  6:02             ` Bhaskara Marthi
  0 siblings, 0 replies; 8+ messages in thread
From: Bhaskara Marthi @ 2012-02-09  6:02 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Patrick Totzke, notmuch

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

On Wed, Feb 8, 2012 at 2:00 AM, Jani Nikula <jani@nikula.org> wrote:

> On Wed, 08 Feb 2012 09:15:59 -0000, Patrick Totzke <
> patricktotzke@googlemail.com> wrote:
> > Quoting Alex Botero-Lowry (2012-02-08 08:24:51)
> > >    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. ...
> > >    Ideally, I'd like a view in notmuch that shows the same messages as
> the
> > >    gmail inbox.  Is there a way to accomplish this?
> > >    - b
> >
> > You could sync every subfolder *but* "All Mail" instead of just this
> > folder: Gmail tags are available as imap folders. You can then tune
> > your tagging filters to sort by folder: queries.
>
>
> That's a good alternative only if you have relatively few messages that
> have many gmail labels assigned to them. Otherwise you end up syncing
> the same messages many times through many IMAP folders (each
> corresponding to one label).
>
> Also, this requires that every message ends up with some label, which is
not true for me.


> My approach is basically to reproduce the gmail filters as saved
> searches in emacs. The messages need not have tags. YMMV.
>

Hmm ok, I suppose setting up tagging rules corresponding to gmail filters
is a one-time effort.  I think I'll go with that.
- Bhaskara


> Jani.
>

[-- Attachment #2: Type: text/html, Size: 2425 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-09  6:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-04  8:39 For gmail how do you setup notmuch mail ? don warner saklad
2012-02-04  9:15 ` David Edmondson
2012-02-04 12:35   ` Jani Nikula
2012-02-08  8:19     ` Bhaskara Marthi
2012-02-08  8:24       ` Alex Botero-Lowry
2012-02-08  9:15         ` Patrick Totzke
2012-02-08 10:00           ` Jani Nikula
2012-02-09  6:02             ` Bhaskara Marthi

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).