Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Folder ''[ACCOUNT] could not be created. Server responded: ('NO', ['Empty mailbox name.']) #1

Closed
shtrom opened this Issue Nov 22, 2011 · 21 comments

Comments

Projects
None yet
8 participants

shtrom commented Nov 22, 2011

After upgrading to ArchLinux's 6.4.0 package for OfflineImap, I'm getting the above error on one (out of two) of my IMAP accounts. Unfortunately, I don't know which is the IMAP server running behind either working or non working accounts...

The full ttyui output says:

$ offlineimap -u ttyui
 OfflineIMAP 6.4.0
Copyright 2002-2011 John Goerzen & contributors.
Licensed under the GNU GPL v2+ (v2 or any later version).

Account sync ACCOUNT:
 ***** Processing account ACCOUNT
Account sync OTHERACCOUNT:
 ***** Processing account OTHERACCOUNT
Account sync ACCOUNT:
 Copying folder structure from IMAP to Maildir
 Establishing connection to mail.account.net:993.
Account sync OTHERACCOUNT:
 Copying folder structure from IMAP to Maildir
 Establishing connection to imap.otheraccount.com:993.
Folder sync [OTHERACCOUNT]:
 Syncing INBOX: IMAP -> Maildir
 Syncing jennie: IMAP -> Maildir
 Syncing mytestbed: IMAP -> Maildir
 Establishing connection to imap.otheraccount.com:993.
 Syncing sail: IMAP -> Maildir
 Establishing connection to imap.otheraccount.com:993.
 Syncing tempo: IMAP -> Maildir
Account sync OTHERACCOUNT:
 ***** Finished processing account OTHERACCOUNT
Account sync ACCOUNT:
 Creating new IMAP folder '' on server ACCOUNT
 ERROR: Creating folder stratif/house on repository ACCOUNTLocal
  Folder ''[ACCOUNT] could not be created. Server responded: ('NO', ['Empty mailbox name.'])
 ERROR: Folder ''[ACCOUNT] could not be created. Server responded: ('NO', ['Empty mailbox name.'])
 ***** Finished processing account ACCOUNT

ERROR: Exceptions occurred during the run!
 ERROR: Creating folder stratif/house on repository ACCOUNTLocal
  Folder ''[ACCOUNT] could not be created. Server responded: ('NO', ['Empty mailbox name.'])
 ERROR: Folder ''[ACCOUNT] could not be created. Server responded: ('NO', ['Empty mailbox name.'])

The folder in question still exists and nothing has changed. Reverting to 6.3.4 fixes the problem.

Sighter commented Dec 13, 2011

I have this problem too, and it is happening if use the git repo

EDIT: I also have to revert back to 6.3.4 and everthing works again.

But i have to say this problem only appears with a specific hoster. (kasserver). My other mail accounts work fine.

bug commented Dec 13, 2011

Use nametrans/folderfilter on both remote and local repositories to specify which folders to sync.

shtrom commented Dec 15, 2011

I'm already using folderfilter:
folderfilter = lambda foldername: True

bug commented Dec 15, 2011

This filter doesn't work for me, I have to specify all mailboxes that offlineimap is syncing as documented in examples of the offlineimaprc (folderfilter = lambda foldername: foldername in ['INBOX', 'Sent'], ...).

shtrom commented Dec 15, 2011

It doesn't work for me with the latest version either. It however works fine with 6.3.4.

shtrom commented Dec 19, 2011

The problem is still present with 6.4.2.

I have that in my conf:
subscribedonly = yes
#folderfilter = lambda foldername: True
I tried every combination of commenting/uncommenting these, to no avail.

I also tried
folderfilter = lambda foldername: foldername == 'INBOX'
which works, but of course only gets me the content of my INBOX, and not the subfolders.

Could it be that there is a weird, non-existing folder named "" either in my local cache or listed in my subscribed IMAP folders on the server that messes me up? How could I check?

ngoonee commented Dec 20, 2011

Ironically, the problem only just started happening here (6.4.2, Arch Linux 64-bit) and is fixed when using 6.4.0...... 3 gmail accounts being synced.

Owner

spaetz commented Jan 4, 2012

Hi there:

  1. folderfilter = lambda foldername: True
    that doesn't make any sense at all, as it merely states that all accounts should be included.
  2. I need the full config file (bar sensitive data). What does the directory structure of you Maildir look like?

runiq commented Jan 6, 2012

This is my .offlineimaprc.

Error message for this exact config file:

$ offlineimap -o
ERROR: Exceptions occurred during the run!
ERROR: Creating folder  on repository googlemail-remote
  Folder ''[googlemail-remote] could not be created. Server responded: ('NO', ['[CANNOT] No folder name given. (Failure)'])
ERROR: Folder ''[googlemail-remote] could not be created. Server responded: ('NO', ['[CANNOT] No folder name given. (Failure)'])

As for directory structure:

$ ls -1 ~/.mail/gm
Entw&APw-rfe/
Gesendet/
INBOX/
Markiert/
Papierkorb/
Spam/
Wichtig/

On the server, it looks like the usual googlemail setup (i.e. every folder except for INBOX is in a subdirectory called [Google Mail]). My nametrans is just used to cut that part out. The folderfilter is supposed to stop the directory [Google Mail]/Alle Nachrichten from syncing.

Owner

spaetz commented Jan 7, 2012

On Fri, 6 Jan 2012 03:59:23 -0800, runiq reply@reply.github.com wrote:

This is my .offlineimaprc.
Thanks, helpful.

ERROR: Folder ''[googlemail-remote] could not be created. Server responded: ('NO', ['[CANNOT] No folder name given. (Failure)'])

First, why are you using sep=" " on a Maildir? I have never seen
that. "." and "/" are common options. But if you are using " ", how we
be able to distinguish folder hierarchies and folder names with spaces
in them? I can see how that can lead to many issues.

However, I have added some code on how to handle the top-level dir to
the latest release of offlineimap 6.5.0. Can you upgrade and report any
differences?

In that release you can also run "-u basic --info" to get a list of all
foldernames and how they are translated.

I believe you might have a cur|new|tmp folder hierarchy right in your
top level dir at ~/.mail/gm right? In that case, it would try map that
with the gmail root (where you cannot have any mails as far as I know).

Let me know if it works with the latest release and the output of the
--info -u basic from that one.

Sebastian

I had what looks like the exact same problem on the previous version I installed under Arch, which was 6.4.2. However, I just upgraded to 6.5.0, which is the current Arch package, and it's working fine now.

runiq commented Jan 7, 2012

I tried 6.5.0 (I'm actually cloning directly from the git repo, using the Arch Linux offlineimap-git package), and everything seems to be in working order again.

Thanks!

Still, here's the output of offlineimap -u basic --info. The folder list has a number of empty names in it, so if I may hazard a guess, it seems something is wrong with my folderfilter and/or nametrans. However, this didn't affect syncing at all, and no new funny mailbox names popped up in ~/.mail/gm. as I said, everything seems to be back in working order.

First, why are you using sep=" " on a Maildir?

I am using offlineimap together with mutt. The sep = " " line is under [mbnames], so it just tells offlineimap how to write a mutt configuration file that has all the mailbox names in it.

In this case, the file is ~/.config/mutt/muttrc.mailboxes, and the actual command to write in that file is <header><mailbox1><sep><mailbox2><sep><etc>. The " " separator is necessary to keep all mailbox names on a single line so mutt recognizes them as part of the mailboxes command.

You can see I use another separator (sep = /) in the [googlemail-local] repository which is my actual local mail directory.

I believe you might have a cur|new|tmp folder hierarchy right in your top level dir at ~/.mail/gm right?

No, not directly in ~/.mail/gm. What I posted was the actual output from ls -1 ~/.mail/gm. All the folders you see in that directory do have the characteristic cur/new/tmp hierarchy, though. This is the more "thorough" output.

In that case, it would try map that with the gmail root (where you cannot have any mails as far as I know).

I'm sorry, I didn't quite understand that… Is that part necessary even though I don't actually have a top level cur/new/tmp? If so, could you explain what you meant by that?

Owner

spaetz commented Jan 7, 2012

I am using offlineimap together with mutt. The sep = " " line is under [mbnames]

Pfeww, ok that is fine. I was worried for a while. Glad that it seems to work ok for you. 6.5.0 was somewhat hurried to fix a grave bug, so I am still pushing out bug fix/regression fix releases.

@spaetz spaetz closed this Jan 7, 2012

Owner

spaetz commented Jan 7, 2012

Aye. Thanks to Trevor King, we have a proper patch in 'next' and 'master' which will be in v6.5.1.2

shtrom commented Jan 10, 2012

Unfortunately, the problem is still present for me with git master (62b8027 built using the ArchLinux offlineimap-git in AUR).

 OfflineIMAP 6.5.2-rc1
   Licensed under the GNU GPL v2+ (v2 or any later version)
 Account sync SRV1:
  *** Processing account SRV1
  Establishing connection to mail.SRV1.net:993
  Creating new IMAP folder '.' on server SRV1
  ERROR: Creating folder  on repository SRV1
   Folder '.'[SRV1] could not be created. Server responded: ('NO', ['Empty mailbox name.'])
  ERROR: Folder '.'[SRV1] could not be created. Server responded: ('NO', ['Empty mailbox name.'])
  *** Finished account 'SRV1' in 0:04
 ERROR: Exceptions occurred during the run!
 ERROR: Creating folder  on repository SRV1
   Folder '.'[SRV1] could not be created. Server responded: ('NO', ['Empty mailbox name.'])
 ERROR: Folder '.'[SRV1] could not be created. Server responded: ('NO', ['Empty mailbox name.'])

With the following offlineimaprc.

 [general]
 accounts = SRV1, SRV2
 maxsyncaccounts = 2
 ui = blinkenlights

 [Account SRV1]
 localrepository = SRV1Local
 remoterepository = SRV1

 [Account SRV2]
 localrepository = SRV2Local
 remoterepository = SRV2


 [Repository SRV1]
 type = IMAP
 ssl = yes
 maxconnections = 3
 remotehost = mail.SRV1.net
 #remoteusereval = getcredentials(".offlineimaprc.cred", "mail.SRV1.net", "user")
 #remotepasseval = getcredentials(".offlineimaprc.cred", "mail.SRV1.net", "passwd")
 remoteuser = <+SRV1LOGIN+>
 remotepass = <+SRV1PASS+>
 subscribedonly = yes
 folderfilter = lambda foldername: True

 [Repository SRV2]
 type = IMAP
 ssl = yes
 maxconnections = 3
 remotehost = imap.SRV2.com.au
 remoteuser = <+SRV2LOGIN+>
 remotepass = <+SRV2PASS+>
 subscribedonly = yes
 folderfilter = lambda foldername: foldername in [ "INBOX", "mytestbed", "sail", "tempo"]

 [Repository SRV1Local]
 type = Maildir
 sep = /
 localfolders = ~/Mail

 [Repository SRV2Local]
 type = Maildir
 sep = /
 localfolders = ~/Mail/SRV2

Now, I have a possibly unusual setup in the sense that the SRV1Local repository
is the root of my Maildir folder, into which a SRV2 subfolder contains the
SRV2Local repository.

Some additional info.

 $ offlineimap -u basic --info
 OfflineIMAP 6.5.2-rc1
   Licensed under the GNU GPL v2+ (v2 or any later version)
 Remote repository 'SRV1': type 'IMAP'
 Host: mail.SRV1.net Port: None SSL: True
 Establishing connection to mail.SRV1.net:993
 Server supports ID extension.
 Server welcome string: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN AUTH=CRAM-MD5 AUTH=DIGEST-MD5] SRV1 SQL auth Mail ready
 Server capabilities: ('IMAP4REV1', 'LITERAL+', 'SASL-IR', 'LOGIN-REFERRALS', 'ID', 'ENABLE', 'SORT', 'SORT=DISPLAY', 'THREAD=REFERENCES', 'THREAD=REFS', 'MULTIAPPEND', 'UNSELECT', 'IDLE', 'CHILDREN', 'NAMESPACE', 'UIDPLUS', 'LIST-EXTENDED', 'I18NLEVEL=1', 'CONDSTORE', 'QRESYNC', 'ESEARCH', 'ESORT', 'SEARCHRES', 'WITHIN', 'CONTEXT=SEARCH', 'LIST-STATUS')

 Folderlist:
  Drafts
  INBOX
  Trash
  boulot
  cfp
  geek.archlinux
  geek.bugreports
  geek.networking
  geek.roots
  geek.SRV1-admin
  inria
  inria.admin
  inria.mext
  inria.mobisend
  lists.aful
  lists.detaxe
  lists.g6
  lists.nautilus6
  lists.openbsd
  spam
  stratif
  stratif.house
  stratif.releves
  studies.mines
  studies.unsw

 Local repository 'SRV1Local': type 'Maildir'
 Folderlist:
  Sent
  cfp
  geek
  geek/roots
  geek/SRV1-admin
  geek/bugreports
  geek/networking
  geek/archlinux
  Trash
  studies
  studies/mines
  studies/chalmers
  studies/utc
  studies/unsw
  Drafts
  INBOX
  INBOX/Sent
  lists/iperf
  lists/netfilter
  lists/aful
  lists/nautilus6
  lists/gruh
  lists/detaxe
  lists/dccp
  lists/ns
  lists/g6
  lists/fun
  lists/rezirc
  lists/gpsd
  lists/slackware
  lists/openbsd
  lists/openbsd/pre2009
  SRV2
  SRV2/tempo
  SRV2/sail
  SRV2/INBOX
  SRV2/mytestbed
  stratif
  stratif/house
  stratif/releves
  spam

Finally, with respect to the folderfilter = lambda foldername: True, it does
indeed not do much as it allows all subscribed-to IMAP directories to be pulled,
which is the default behaviour, but it cannot hurt. In any case, having it or
not does not change the issue.

shtrom commented Feb 22, 2012

The problem persists with 6.5.2.1. Any chance to see this bug reopened?

Hi... same error here, on Debian Sid, offlineimap = 6.5.3.1-1 (was 6.3.4 before April 19, and it worked very well).

My config seems very basic to me:

[general]
metadata = ~/.offlineimap
accounts = EO
maxsyncaccounts = 2
ui = blinkenlights
ignore-readonly = no

[Account EO]
localrepository = MaildirLocal
remoterepository = ImapEO
quick = -1
postsynchook = notmuch new

[Repository MaildirLocal]
type = Maildir
localfolders = ~/Maildir
sep = /
restoreatime = no

[Repository ImapEO]
type = IMAP
remotehost = mail.entrouvert.com
ssl = yes
remoteuser = xxx
remotepass = xxx
maxconnections = 1
holdconnectionopen = no
subscribedonly = no

The output is :

$ offlineimap -u ttyui 
OfflineIMAP 6.5.3.1
  Licensed under the GNU GPL v2+ (v2 or any later version)
Account sync EO:
 *** Processing account EO
 Establishing connection to mail.entrouvert.com:993
 Creating folder .[ImapEO]
 ERROR: Creating folder  on repository ImapEO
  Folder '.'[ImapEO] could not be created. Server responded: ('NO', ['Empty mailbox name.'])
 ERROR: Folder '.'[ImapEO] could not be created. Server responded: ('NO', ['Empty mailbox name.'])
 *** Finished account 'EO' in 0:00
ERROR: Exceptions occurred during the run!
ERROR: Creating folder  on repository ImapEO
  Folder '.'[ImapEO] could not be created. Server responded: ('NO', ['Empty mailbox name.'])
ERROR: Folder '.'[ImapEO] could not be created. Server responded: ('NO', ['Empty mailbox name.'])

shtrom commented May 7, 2012

Same problem with 6.5.3. Had to downgrade to 6.3.4 again.

Owner

spaetz commented May 8, 2012

Sorry for the long non-response. Here is the thing:

I'll take thomasnoel's simple setup as example: #1 (comment)

If you have a "top-level" folder "." e.g. your Maildir path is "~/Maildir" and you have the folders ~/Maildir/{new|cur|tmp}, then your top level folder name is essentially "/" or "." (the user visible name is even empty, so it might print as an empty line in the folder list). And it will try to create that folder on the other side, the IMAP server. But "." (if that is your path separator) is not a good folder name. IMAP servers won't allow it. So the issue is basically, how should I treat top-level maildirs?

Try to filter out the top-level maildir my filtering out e.g. folderfilter=lambda f: not '/'
and see if that helps.

@spaetz :

If you have a "top-level" folder "." e.g. your Maildir path is "~/Maildir" and you have the folders
~/Maildir/{new|cur|tmp}, then your top level folder name is essentially "/" or "."

Argh ! You're totally right, i'm so stupid... I've a 15-years-old muttrc and a strange Maildir with 3 symlinks "new -> INBOX/new", "cur -> INBOX/new" and "tmp -> INBOX/tmp" (don't ask me why, I don't even remember)... And that's why offlineimap is lost.

I added « folderfilter = lambda foldername: foldername != '' » and all is good now (Debian version, 6.5.3.1-2).

Thanks a lot ! The creation of folders on the remote host is a killer feature.

shtrom commented May 9, 2012

Damn it. Same here, I have exactly the same setup of symlinks... I added “folderfilter = lambda foldername: foldername not in ['']” to my SRV1 conf, and it works.

There is a new problem with creating folders which exist on both sides, but aren't subscribed to anymore. I'll open a new issue for that

Thomas: You want these links so that + is already your main inbox, rather than +INBOX. I myself added them recently.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment