<p>I get the following error messages after I do the following steps:</p>

<ol>
<li>Initial sync with my gmail account works fine (e.i. the initial set-up). All messages are correctly downloaded</li>
<li>repeated sync results in the following error:</li>
</ol>

<pre><code>Establishing connection to imap.gmail.com:993
 Creating folder junk[Remote]
 ERROR: Creating folder junk on repository Remote
  Folder 'junk'[Remote] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Folder name conflicts with existing folder name. (Failure)'])
 ERROR: Folder 'junk'[Remote] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Folder name conflicts with existing folder name. (Failure)'])
 *** Finished account 'hku' in 0:02
ERROR: Exceptions occurred during the run!
ERROR: Creating folder junk on repository Remote
  Folder 'junk'[Remote] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Folder name conflicts with existing folder name. (Failure)'])

Traceback:
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/repository/Base.py", line 242, in sync_folder_structure
    src_repo.makefolder(dst_name_t)
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/repository/IMAP.py", line 434, in makefolder
    OfflineImapError.ERROR.FOLDER)

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

Traceback:
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/accounts.py", line 263, in syncrunner
    self.__sync()
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/accounts.py", line 329, in __sync
    remoterepos.sync_folder_structure(localrepos, statusrepos)
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/repository/Base.py", line 242, in sync_folder_structure
    src_repo.makefolder(dst_name_t)
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/repository/IMAP.py", line 434, in makefolder
    OfflineImapError.ERROR.FOLDER)
</code></pre>

<p>I do not know why it does not receive the information that the junk folder is already present.</p>

<p>Maybe my setup is wrong. Just do not see how:<br>
here my offlineimaprc:</p>

<pre><code>[general]
accounts = mail
# ui = quiet

[Account hku]
localrepository = Local
remoterepository = Remote

[Repository Local]
type = Maildir
localfolders = ~/.mutt/offlineimap/mail/

[Repository Remote]
#type = IMAP
type = Gmail
remoteuser = mail@mail.com
remotepass = secret
nametrans = lambda foldername: re.sub ('^\[gmail\]', 'bak',
                               re.sub ('sent_mail', 'sent',
                               re.sub ('starred', 'flagged',
                               re.sub (' ', '_', foldername.lower()))))
folderfilter = lambda foldername: foldername not in '[Gmail]/All Mail'

# Necessary as of OfflineIMAP 6.5.4
ssl= yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
</code></pre>

<p>I use offlineimap <code>6.5.7</code></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/OfflineIMAP/offlineimap/issues/256">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AKFSEEOsf_GpK3ecwLUqVK2mFoYVhv-8ks5o4Q3XgaJpZM4GIk_1.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OfflineIMAP/offlineimap/issues/256"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>