Re: using offlineimap, notmuch and emacs etc....

2017-01-07 Thread Michael Fothergill
Dear Folks,



On 7 January 2017 at 16:22, Liam O'Toole  wrote:

> On 2017-01-07, Michael Fothergill  wrote:
> > --001a1145bd88af6ab6054580e973
> > Content-Type: text/plain; charset=UTF-8
> >
> > Dear Folks,
> >
> > I have installed the utility offlineimap which is somewhat new to me.
> >
> > I found a web site that explained how to use it in combination with emacs
> > and notmuch for organising your email etc. if you have a gmail account
> > which I do
> >
> > The site kindly listed a short script that you could use with a gmail
> > account.
> >
> > I used it to produce something that would work for me (I hoped).
> >
> > Here it is:
> >
> > mikef@rhinoceros:~$ more ~/.offlineimaprc
> > [general]
> > accounts = mikefGmail
> >
> > [Account mikefGmail]
> > localrepository = Local
> > remoterepository = MichaelFothergillGmail
> >
> > [Repository Local]
> > type = Maildir
> > localfolders = ~/Mail
> >
> > [Repository MichaelFothergillGmail]
> > type = Gmail
> > maxconnections=1
> > remoteuser = michael.fotherg...@gmail.com
> > realdelete=no
> > folderfilter = lambda foldername:foldername in ['[Google Mail]/All
> > Mail', '[Google Mail]/Sent Mail']
> > nametrans = lambda foldername:  re.sub('^\[Google Mail\]/All Mail$',
> 'all',
> > re.sub('^\[Google Mail\]/Sent Mail$', 'sent',foldername))
> > sslcacertfile = /etc/ssl/certs/ca-certificates.crt
> > remotepass = *
> >
> > I logged into Gmail and set the imap option on.
> >
> > I also went to the section on adding app passwords and entered
> offlineimap
> > as the app and got it to produce a password for it which I entered in the
> > remotepass line above.
> >
> > I then ran the offlineimap command:
> >
> >
> > mikef@rhinoceros:~$ offlineimap
> >  OfflineIMAP 6.3.4
> > Copyright 2002-2011 John Goerzen & contributors.
> > Licensed under the GNU GPL v2+ (v2 or any later version).
> >
> > Account sync mikefGmail:
> >  * Processing account mikefGmail
> >  Copying folder structure from Gmail to Maildir
> >  Establishing connection to imap.gmail.com:993.
> >  * Finished processing account mikefGmail
> >
> > I then thought that might be working ie downloading copies of emails from
> > my gmail account on to my PC here.
> >
> > In /home/mikef directory I have a Mail folder and now a .offlineimap
> > directory (there are other files and directories not listed here):
> >
> >
> > drwx--  2 mikef mikef  4096 Jan  5 13:02 Mail
> > drwx--  4 mikef mikef  4096 Feb  8  2016 .mozilla
> > drwxr-xr-x  2 mikef mikef  4096 Feb  8  2016 Music
> > drwx--  5 mikef mikef  4096 Jan  7 11:54 .offlineimap
> >
> > The .offlineimap directory contains the following directories
> >
> > root@rhinoceros:/home/mikef/.offlineimap# ls
> >
> > Account-mikefGmail  lock  pid  Repository-Local
> >  Repository-MichaelFothergillGmail
> >
> > If you move into these directories there further ones underneath.
> >
> > The /home/mikef/Mail directory is empty..
> >
> > My question is this:
> >
> > If the email download process was actually occurring  where would the
> file
> > created with them in it be located?
> >
> > I thought it would sit in the /home/mikef/Mail directory but it does not
> > seem to be there.
> >
> > Suggestions on this are welcome.
> >
> > Regards
> >
> > Michael Fothergill
>
> Below is a minimal, working .offlineimaprc file for offlineimap 6.3.4 in
> jessie.
> I suggest you start with this and then tune it to suit your needs.
>
>
> # Adapted from /usr/share/doc/offlineimap/examples/offlineimap.conf.
> minimal
>
> [general]
> accounts = Gmail
>
> [Account Gmail]
> localrepository = LocalGmail
> remoterepository = RemoteGmail
>
> [Repository LocalGmail]
> type = Maildir
> localfolders = ~/Mail/gmail
>
> [Repository RemoteGmail]
> type = Gmail
> remotehost = imap.gmail.com
> ssl = yes
> remoteuser = *
> remotepass = *
>

​I tried this one and it worked!

Many thanks to Mr O'Toole

Regds

Michael Fothergill​


Re: using offlineimap, notmuch and emacs etc....

2017-01-07 Thread Liam O'Toole
On 2017-01-07, Michael Fothergill  wrote:
> --001a1145bd88af6ab6054580e973
> Content-Type: text/plain; charset=UTF-8
>
> Dear Folks,
>
> I have installed the utility offlineimap which is somewhat new to me.
>
> I found a web site that explained how to use it in combination with emacs
> and notmuch for organising your email etc. if you have a gmail account
> which I do
>
> The site kindly listed a short script that you could use with a gmail
> account.
>
> I used it to produce something that would work for me (I hoped).
>
> Here it is:
>
> mikef@rhinoceros:~$ more ~/.offlineimaprc
> [general]
> accounts = mikefGmail
>
> [Account mikefGmail]
> localrepository = Local
> remoterepository = MichaelFothergillGmail
>
> [Repository Local]
> type = Maildir
> localfolders = ~/Mail
>
> [Repository MichaelFothergillGmail]
> type = Gmail
> maxconnections=1
> remoteuser = michael.fotherg...@gmail.com
> realdelete=no
> folderfilter = lambda foldername:foldername in ['[Google Mail]/All
> Mail', '[Google Mail]/Sent Mail']
> nametrans = lambda foldername:  re.sub('^\[Google Mail\]/All Mail$', 'all',
> re.sub('^\[Google Mail\]/Sent Mail$', 'sent',foldername))
> sslcacertfile = /etc/ssl/certs/ca-certificates.crt
> remotepass = *
>
> I logged into Gmail and set the imap option on.
>
> I also went to the section on adding app passwords and entered offlineimap
> as the app and got it to produce a password for it which I entered in the
> remotepass line above.
>
> I then ran the offlineimap command:
>
>
> mikef@rhinoceros:~$ offlineimap
>  OfflineIMAP 6.3.4
> Copyright 2002-2011 John Goerzen & contributors.
> Licensed under the GNU GPL v2+ (v2 or any later version).
>
> Account sync mikefGmail:
>  * Processing account mikefGmail
>  Copying folder structure from Gmail to Maildir
>  Establishing connection to imap.gmail.com:993.
>  * Finished processing account mikefGmail
>
> I then thought that might be working ie downloading copies of emails from
> my gmail account on to my PC here.
>
> In /home/mikef directory I have a Mail folder and now a .offlineimap
> directory (there are other files and directories not listed here):
>
>
> drwx--  2 mikef mikef  4096 Jan  5 13:02 Mail
> drwx--  4 mikef mikef  4096 Feb  8  2016 .mozilla
> drwxr-xr-x  2 mikef mikef  4096 Feb  8  2016 Music
> drwx--  5 mikef mikef  4096 Jan  7 11:54 .offlineimap
>
> The .offlineimap directory contains the following directories
>
> root@rhinoceros:/home/mikef/.offlineimap# ls
>
> Account-mikefGmail  lock  pid  Repository-Local
>  Repository-MichaelFothergillGmail
>
> If you move into these directories there further ones underneath.
>
> The /home/mikef/Mail directory is empty..
>
> My question is this:
>
> If the email download process was actually occurring  where would the file
> created with them in it be located?
>
> I thought it would sit in the /home/mikef/Mail directory but it does not
> seem to be there.
>
> Suggestions on this are welcome.
>
> Regards
>
> Michael Fothergill

Below is a minimal, working .offlineimaprc file for offlineimap 6.3.4 in jessie.
I suggest you start with this and then tune it to suit your needs.


# Adapted from /usr/share/doc/offlineimap/examples/offlineimap.conf.minimal

[general]
accounts = Gmail

[Account Gmail]
localrepository = LocalGmail
remoterepository = RemoteGmail

[Repository LocalGmail]
type = Maildir
localfolders = ~/Mail/gmail

[Repository RemoteGmail]
type = Gmail
remotehost = imap.gmail.com
ssl = yes
remoteuser = *
remotepass = *



Re: using offlineimap, notmuch and emacs etc....

2017-01-07 Thread Mattia Oss
On Sat, Jan 07, 2017 at 02:53:53PM +, Michael Fothergill wrote:
> mikef@rhinoceros:~$ offlineimap
>  OfflineIMAP 6.3.4
Oh my... I'm really sorry, I thought you were using Sid as I do.
Forget what I wrote. I'm using offlineimap 7.0.12, that's why the option
GmailMaildir is not recognized by your offlineimap.

I'm sorry but you have to wait someone else to help you, maybe with the
same version.

Bye,
Mattia



Re: using offlineimap, notmuch and emacs etc....

2017-01-07 Thread Michael Fothergill
On 7 January 2017 at 14:15, Mattia Oss  wrote:

> On Sat, Jan 07, 2017 at 01:14:21PM +, Michael Fothergill wrote:
>
> I'm also trying to configure offlineimap and mutt, so I'll try to
> help.
>
> > I found a web site that explained how to use it in combination with emacs
> Always compare more sources as offlineimap is changed a lot recently.
>
> > [Repository Local]
> > type = Maildir
> use type = GmailMaildir here.
>
> > [Repository MichaelFothergillGmail]
> > type = Gmail
> > maxconnections=1
> > remoteuser = michael.fotherg...@gmail.com
> > realdelete=no
> > folderfilter = lambda foldername:foldername in ['[Google Mail]/All
> > Mail', '[Google Mail]/Sent Mail']
> > nametrans = lambda foldername:  re.sub('^\[Google Mail\]/All Mail$',
> 'all',
> > re.sub('^\[Google Mail\]/Sent Mail$', 'sent',foldername))
>
> You have to use nametrans both in the local and remote repository.
> Look at this howto:
> http://stevelosh.com/blog/2012/10/the-homely-mutt/
> But you can do this later. I'd rather just disable this option for the
> moment.
>
> > mikef@rhinoceros:~$ offlineimap
> Try:
> $ offlineimap --info
>
> and post the output.
>

​Many thanks for your input here.​

​I tried running offlineimap --info but it did not recognise this command.
I ran offlineimap -help and there was a debug option which I tried running:

​mikef@rhinoceros:~$ offlineimap -d
Usage: offlineimap [options]

offlineimap: error: -d option requires an argument
mikef@rhinoceros:~$ offlineimap -d type1
 OfflineIMAP 6.3.4
Copyright 2002-2011 John Goerzen & contributors.
Licensed under the GNU GPL v2+ (v2 or any later version).

 Debug mode: Forcing to singlethreaded.
 WARNING: Invalid debug type: type1
 Now debugging for : Other offlineimap related sync messages
Account sync mikefGmail:
 * Processing account mikefGmail
 Copying folder structure from Gmail to Maildir
 Establishing connection to imap.gmail.com:993.
 * Finished processing account mikefGmail

​It says that it copied the folder structure from Gmail to Maildir but the
folder is still empty.

​
mikef@rhinoceros:~$ offlineimap
 OfflineIMAP 6.3.4
Copyright 2002-2011 John Goerzen & contributors.
Licensed under the GNU GPL v2+ (v2 or any later version).

​I edited the config file and changed local type = Maildir to type =
GmailMaildir.

When I ran it then it crashed :

Exception: 'GmailMaildir' repository not supported for local repositories.
  ​
​It does not recognise the term GmailMaildir apparently.

​Any other suggestions you have are most welcome.

Regards

MF


Re: using offlineimap, notmuch and emacs etc....

2017-01-07 Thread Mattia Oss
On Sat, Jan 07, 2017 at 01:14:21PM +, Michael Fothergill wrote:

I'm also trying to configure offlineimap and mutt, so I'll try to
help.

> I found a web site that explained how to use it in combination with emacs
Always compare more sources as offlineimap is changed a lot recently.

> [Repository Local]
> type = Maildir
use type = GmailMaildir here.

> [Repository MichaelFothergillGmail]
> type = Gmail
> maxconnections=1
> remoteuser = michael.fotherg...@gmail.com
> realdelete=no
> folderfilter = lambda foldername:foldername in ['[Google Mail]/All
> Mail', '[Google Mail]/Sent Mail']
> nametrans = lambda foldername:  re.sub('^\[Google Mail\]/All Mail$', 'all',
> re.sub('^\[Google Mail\]/Sent Mail$', 'sent',foldername))

You have to use nametrans both in the local and remote repository.
Look at this howto:
http://stevelosh.com/blog/2012/10/the-homely-mutt/
But you can do this later. I'd rather just disable this option for the
moment.

> mikef@rhinoceros:~$ offlineimap
Try:
$ offlineimap --info

and post the output.



using offlineimap, notmuch and emacs etc....

2017-01-07 Thread Michael Fothergill
Dear Folks,

I have installed the utility offlineimap which is somewhat new to me.

I found a web site that explained how to use it in combination with emacs
and notmuch for organising your email etc. if you have a gmail account
which I do

The site kindly listed a short script that you could use with a gmail
account.

I used it to produce something that would work for me (I hoped).

Here it is:

mikef@rhinoceros:~$ more ~/.offlineimaprc
[general]
accounts = mikefGmail

[Account mikefGmail]
localrepository = Local
remoterepository = MichaelFothergillGmail

[Repository Local]
type = Maildir
localfolders = ~/Mail

[Repository MichaelFothergillGmail]
type = Gmail
maxconnections=1
remoteuser = michael.fotherg...@gmail.com
realdelete=no
folderfilter = lambda foldername:foldername in ['[Google Mail]/All
Mail', '[Google Mail]/Sent Mail']
nametrans = lambda foldername:  re.sub('^\[Google Mail\]/All Mail$', 'all',
re.sub('^\[Google Mail\]/Sent Mail$', 'sent',foldername))
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
remotepass = *

I logged into Gmail and set the imap option on.

I also went to the section on adding app passwords and entered offlineimap
as the app and got it to produce a password for it which I entered in the
remotepass line above.

I then ran the offlineimap command:


mikef@rhinoceros:~$ offlineimap
 OfflineIMAP 6.3.4
Copyright 2002-2011 John Goerzen & contributors.
Licensed under the GNU GPL v2+ (v2 or any later version).

Account sync mikefGmail:
 * Processing account mikefGmail
 Copying folder structure from Gmail to Maildir
 Establishing connection to imap.gmail.com:993.
 * Finished processing account mikefGmail

I then thought that might be working ie downloading copies of emails from
my gmail account on to my PC here.

In /home/mikef directory I have a Mail folder and now a .offlineimap
directory (there are other files and directories not listed here):


drwx--  2 mikef mikef  4096 Jan  5 13:02 Mail
drwx--  4 mikef mikef  4096 Feb  8  2016 .mozilla
drwxr-xr-x  2 mikef mikef  4096 Feb  8  2016 Music
drwx--  5 mikef mikef  4096 Jan  7 11:54 .offlineimap

The .offlineimap directory contains the following directories

root@rhinoceros:/home/mikef/.offlineimap# ls

Account-mikefGmail  lock  pid  Repository-Local
 Repository-MichaelFothergillGmail

If you move into these directories there further ones underneath.

The /home/mikef/Mail directory is empty..

My question is this:

If the email download process was actually occurring  where would the file
created with them in it be located?

I thought it would sit in the /home/mikef/Mail directory but it does not
seem to be there.

Suggestions on this are welcome.

Regards

Michael Fothergill