nametrans being ignored

Chris Dennis cgdennis at btinternet.com
Mon Mar 31 00:11:10 BST 2014


On 10/03/14 23:16, Stoo Johnston wrote:
> Hullo all.
>
> I've just upgraded to 6.5.4 and am re-writing my configuration to make
> better use of the serverside folder syncing.
>
> I have a gmail account that I'd like to sync in both directions, but
> so far the nametrans in the local account seems to be ignored. I was
> hoping someone could point out where I am going wrong.
>
> Here is the configuration for gmail:
>
> [Repository local-gmail]
> type = Maildir
> localfolders = ~/.mail/gmail
> # Translate local directory names back to Gmail format.
> nametrans = lambda folder: re.sub('inbox', 'INBOX', folder)
>
> [Repository remote-gmail]
> type = Gmail
> remoteusereval = get_account_detail('gmail', 'username')
> remotepasseval = get_account_detail('gmail', 'password')
>
> nametrans = lambda foldername: re.sub('INBOX', 'inbox',
>          re.sub('\[Google Mail\]\/Sent Mail', 'sent',
>          re.sub('\[Google Mail\]\/Important', 'important',
>          re.sub('\[Google Mail\]\/Starred', 'starred',
>          foldername))))
>
> Obviously, this is a work in progress; it's not complete yet. Here's what happens on a dry run:
>
> OfflineIMAP 6.5.4
>    Licensed under the GNU GPL v2+ (v2 or any later version)
> *** Processing account gmail
> [DRYRUN] Calling hook: /usr/bin/imapfilter -vc ~/.mail_config/imapfilter/gmail.lua
> Establishing connection to imap.gmail.com:993
> [DRYRUN] Creating folder important[local-gmail]
> [DRYRUN] Creating folder inbox[local-gmail]
> [DRYRUN] Creating folder starred[local-gmail]
> [DRYRUN] Creating folder sent[local-gmail]
> ERROR: Aborting sync, folder 'important' [acc: 'gmail']
>    getfolder() asked for a nonexisting folder 'important'.
> ERROR: Aborting sync, folder 'sent' [acc: 'gmail']
>    getfolder() asked for a nonexisting folder 'sent'.
> ERROR: Aborting sync, folder 'inbox' [acc: 'gmail']
>    getfolder() asked for a nonexisting folder 'inbox'.
> ERROR: Aborting sync, folder 'starred' [acc: 'gmail']
>    getfolder() asked for a nonexisting folder 'starred'.
> *** Finished account 'gmail' in 0:04
> ERROR: Exceptions occurred during the run!
> ERROR: Aborting sync, folder 'important' [acc: 'gmail']
>    getfolder() asked for a nonexisting folder 'important'.
> ERROR: Aborting sync, folder 'sent' [acc: 'gmail']
>    getfolder() asked for a nonexisting folder 'sent'.
> ERROR: Aborting sync, folder 'inbox' [acc: 'gmail']
>    getfolder() asked for a nonexisting folder 'inbox'.
> ERROR: Aborting sync, folder 'starred' [acc: 'gmail']
>    getfolder() asked for a nonexisting folder 'starred'.
>
> So, it's trying to create a directory called 'inbox' on the remote
> server; is that correct? I understood that the nametrans in my local
> configuration would convert 'inbox' to 'INBOX'.
>
> It would be great if someone could point out where I am being daft.
>
I'm not entirely sure, but it may be that the dry-run feature is tripping itself up: because it doesn't really create local folder 'inbox' it then fails the sync because that folder doesn't exist.

cheers

Chris





More information about the OfflineIMAP-project mailing list