offlineimap icon indicating copy to clipboard operation
offlineimap copied to clipboard

subscribedonly tries to recreate existing folder when folder is unsubscribed

Open anarcat opened this issue 7 years ago • 0 comments

General informations

  • system/distribution (with version): Debian GNU/Linux 9 "stretch" 2017-03-20
  • offlineimap version (offlineimap -V): offlineimap v7.0.12, imaplib2 v2.55 (system)
  • Python version: Python v2.7.13
  • server name or domain: my own home server
  • CLI options: offlineimap

Configuration file offlineimaprc

[general]
accounts = Anarcat
ui = ttyui
maxsyncaccounts = 3

[Account Anarcat]
localrepository = LocalAnarcat
remoterepository = RemoteAnarcat
# refresh all mailboxes every 10 minutes
autorefresh = 10
# run notmuch after refresh
postsynchook = notmuch new
# sync only mailboxes that changed, full sync every 10 quick
quick = 10
## possible optimisation: ignore mails older than a year
#maxage = 365

# local mailbox location
[Repository LocalAnarcat]
type = Maildir
localfolders = ~/Maildir/Anarcat/

# remote IMAP server
[Repository RemoteAnarcat]
type = IMAP
remoteuser = anarcat
remotehost = anarc.at
ssl = yes
# without this, the cert is not verified (!)
# note: this is fixed in 6.7.0
sslcacertfile = /etc/ssl/certs/DST_Root_CA_X3.pem
# do not sync archives
folderfilter = lambda foldername: not re.search('(Sent\.20[01][0-9]\..*)', foldername) and not re.search('(Archive.*)', foldername)
# and only subscribed folders
subscribedonly = yes
# this shouldn't be necessary, but is because of a bug in offlineimap:
# https://github.com/spaetz/offlineimap/issues/42
#createfolders = False
# don't reconnect all the time
#holdconnectionopen = yes
# get mails from INBOX immediately, doesn't trigger postsynchook
#idlefolders = ['INBOX']

pythonfile (if any)

None.

Logs, error

ERROR: Creating folder TEST on repository RemoteAnarcat
Folder 'TEST'[RemoteAnarcat] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Mailbox exists.'])
ERROR: Folder 'TEST'[RemoteAnarcat] could not be created. Server responded: ('NO', ['[ALREADYEXISTS] Mailbox exists.'])

Steps to reproduce the error

  1. configure your remote host to use subscribedonly = yes
  2. (create and) subscribe to folder TEST
  3. sync mail with offlineimap
  4. stop offlineimap
  5. unsubscribe to the TEST folder
  6. sync mail with offlineimap
  • expected result: folder would be skipped during sync (and optionnally deleted locally, presumably?)
  • actual result: offlineimap believes the folder is missing from remote, tries to create it, and fails.

Workaround: createfolders = False in the remote.

Note: this was originally reported in https://github.com/spaetz/offlineimap/issues/42.

anarcat avatar Mar 20 '17 14:03 anarcat