You are not logged in.

#1 2012-05-02 12:36:19

skinnyvoice
Member
From: London, UK
Registered: 2011-07-04
Posts: 18

[SOLVED] Gmail problems with offlineimap-6.5.3.1-1 & offlineimap-git

Recently I realised I was getting no mail to my gmail accounts and checking the logs for the cron job that runs offlineimap I found lots of:

CMDOUT (  Folder 'drafts'[GMAILCB-Remote] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Folder name conflicts with existing folder name. (Failure)']))

I tried reverse nametrans on the local repos, and put a folderfilter in for 'drafts' but that doesn't seem to solve the problem (though I'm not confident I was doing the right thing with the nametrans)

Downgraded from 6.5.3.1-1 to 6.5.2.1-1 and everything works again. Has anybody else got this. It is only with gmail, my other imap accounts work fine with  6.5.3.1

Last edited by skinnyvoice (2012-05-02 20:57:19)

Offline

#2 2012-05-02 14:57:50

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Gmail problems with offlineimap-6.5.3.1-1 & offlineimap-git

I didn't have exactly the same errors, but something very similar. I had to
1. Stop my offlineimap cronjob(s)
2. Make sure all the 'labels' on the gmail website were correct (I had extra labels added, I think because I hadn't implemented the reverse nametrans)
3. Deleted my .offlineimap folder (although you could just delete the directories for you gmail accounts (Account-*, Repository-*_local, Repository-*_remote). I'm not sure if this was absolutely necessary...feel free to leave out this step and see if it works, but for some reason I had to do this.
4. Added reverse nametrans to .offlineimaprc:

[Account firecat53]
localrepository = firecat53_local
remoterepository = firecat53_remote
autorefresh = 0
status_backend = sqlite

[Repository firecat53_local]
type = Maildir
localfolders = ~/mail/account1
sep = .
restoreatime = no
maxconnections = 5
nametrans = lambda folder: re.sub('spam', '[Gmail].Spam',
                           re.sub('drafts', '[Gmail].Drafts',
                           re.sub('sent', '[Gmail].Sent Mail',
                           re.sub('flagged', '[Gmail].Starred',
                           re.sub('trash', '[Gmail].Trash',
                           re.sub('important', '[Gmail].Important',
                           re.sub('archive', '[Gmail].All Mail', folder)))))))

[Repository firecat53_remote]
type = Gmail
ssl = yes
remoteuser = user1@gmail.com
remotepass = ******
realdelete = no
maxconnections = 5
nametrans = lambda folder: re.sub('.*Spam$', 'spam', 
                           re.sub('.*Drafts$', 'drafts', 
                           re.sub('.*Sent Mail$', 'sent', 
                           re.sub('.*Starred$', 'flagged', 
                           re.sub('.*Trash$', 'trash', 
                           re.sub('.*Important$', 'important', 
                           re.sub('.*All Mail$', 'archive', folder)))))))

5. Ran offlineimap manually and allowed it to rebuild it's database(s)
6. Restarted cron job

Hopefully that helps you or someone else that might have this issue (if it's even the same isue, that is smile )

Scott

Last edited by firecat53 (2012-05-02 14:59:19)

Offline

#3 2012-05-02 18:41:01

skinnyvoice
Member
From: London, UK
Registered: 2011-07-04
Posts: 18

Re: [SOLVED] Gmail problems with offlineimap-6.5.3.1-1 & offlineimap-git

firecat53 wrote:

Hopefully that helps you or someone else that might have this issue (if it's even the same isue, that is smile )

I can download the messages OK with the reverse nametrans but the labels at the gmail end don't seem to be updating, so on each subsequent sync all local emails are deleted & redownloaded.... feel like I'm going mad sad

FWIW here is the .offlineimaprc (I ended up copying yours) & using it with offlineimap-git

The labels are created at the gmail end but not populated


[Account GMAILCB]
localrepository = GMAILCB-Local
remoterepository = GMAILCB-Remote
autorefresh = 0
#status_backend = sqlite

[Repository GMAILCB-Local]
type = Maildir
localfolders = ~/Mail/GMAILCB
sep = .
restoreatime = no
maxconnections = 5
nametrans = lambda folder: re.sub('spam', '[Gmail].Spam',
                           re.sub('drafts', '[Gmail].Drafts',
                           re.sub('sent', '[Gmail].Sent Mail',
                           re.sub('flagged', '[Gmail].Starred',
                           re.sub('trash', '[Gmail].Trash',
                           re.sub('important', '[Gmail].Important',
                           re.sub('archive', '[Gmail].All Mail', folder)))))))



[Repository GMAILCB-Remote]
type = Gmail 
remoteuser = xxxxxxxxxx
remotepass = xxxxxxxxx
realdelete = no
maxconnections = 5
nametrans = lambda folder: re.sub('.*Spam$', 'spam', 
                           re.sub('.*Drafts$', 'drafts', 
                           re.sub('.*Sent Mail$', 'sent', 
                           re.sub('.*Starred$', 'flagged', 
                           re.sub('.*Trash$', 'trash', 
                           re.sub('.*Important$', 'important', 
                           re.sub('.*All Mail$', 'archive', folder)))))))

Last edited by skinnyvoice (2012-05-02 19:01:03)

Offline

#4 2012-05-02 19:11:53

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [SOLVED] Gmail problems with offlineimap-6.5.3.1-1 & offlineimap-git

1. I'm using offlineimap from community, not offlineimap-git
2. Did you delete the folders for that account in .offlineimap?
3. Why do you have the status_backend = sqlite commented out? That can help pretty substantially with speed.
4. Before you sync, make sure and go to the website and update the labels so they match what's in your local directory. Delete any extra labels like [Imap]/starred or some such. These were just an artifact of the lack of reverse nametrans. You have to go into manage labels on Gmail to see and delete these, as they aren't always visible on the main page in the left column.

Scott

Offline

#5 2012-05-02 20:55:14

skinnyvoice
Member
From: London, UK
Registered: 2011-07-04
Posts: 18

Re: [SOLVED] Gmail problems with offlineimap-6.5.3.1-1 & offlineimap-git

Thanks firecat53, I've finally managed it! Looks like I needed to setup the reverse nametrans to '[Google Mail].mailbox' rather than '[GMAIL].mailbox'. Perhaps this is because I'm in the UK. I'm grateful for your suggesting looking at the labels & checking that they match. Obvious really, but I've been staring at the screen too long. Cheers

Here is the extract from the one that works if anybody else comes across this

[Account GMAILCB]
localrepository = GMAILCB-Local
remoterepository = GMAILCB-Remote
autorefresh = 0
status_backend = sqlite

[Repository GMAILCB-Local]
type = Maildir
localfolders = ~/Mail/GMAILCB
sep = .
restoreatime = no
maxconnections = 5
nametrans = lambda folder: re.sub('spam', '[Google Mail].Spam',
                           re.sub('drafts', '[Google Mail].Drafts',
                           re.sub('sent', '[Google Mail].Sent Mail',
                           re.sub('flagged', '[Google Mail].Starred',
                           re.sub('trash', '[Google Mail].Trash',
                           re.sub('important', '[Google Mail].Important',
                           re.sub('archive', '[Google Mail].All Mail', folder)))))))

[Repository GMAILCB-Remote]
type = Gmail 
remoteuser = xxxxxxxx@gmail.com
remotepass = xxxxxxxxxxxx
realdelete = no
maxconnections = 5
nametrans = lambda folder: re.sub('.*Spam$', 'spam', 
                           re.sub('.*Drafts$', 'drafts', 
                           re.sub('.*Sent Mail$', 'sent', 
                           re.sub('.*Starred$', 'flagged', 
                           re.sub('.*Trash$', 'trash', 
                           re.sub('.*Important$', 'important', 
                           re.sub('.*All Mail$', 'archive', folder)))))))

Offline

#6 2012-05-03 01:54:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Gmail problems with offlineimap-6.5.3.1-1 & offlineimap-git

firecat53 wrote:

Hopefully that helps you or someone else that might have this issue (if it's even the same isue, that is smile )

Thanks Scott: excellent!


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB