Re: Issue 1992 in k9mail: Add support for more than one IMAP namespace

12 views
Skip to first unread message

k9m...@googlecode.com

unread,
Jul 15, 2010, 10:10:33 AM7/15/10
to k-9-noti...@googlegroups.com
Updates:
Summary: Add support for more than one IMAP namespace
Cc: cketti
Labels: -Type-Defect Type-Enhancement

Comment #2 on issue 1992 by cketti: Add support for more than one IMAP
namespace
http://code.google.com/p/k9mail/issues/detail?id=1992

As a work-around you should be able to set up an account per namespace (as
we allow to manually select which namespace to use).

k9m...@googlecode.com

unread,
Jul 15, 2010, 10:20:07 AM7/15/10
to k-9-noti...@googlegroups.com

Comment #3 on issue 1992 by shadow.xiii: Add support for more than one IMAP
namespace
http://code.google.com/p/k9mail/issues/detail?id=1992

this will not work here as those folders/namespaces have no accounts
assigned to them, but looking forward for this feature.
will be monitoring updates feed :)

k9m...@googlecode.com

unread,
Jul 19, 2010, 11:51:20 AM7/19/10
to k-9-noti...@googlegroups.com

Comment #4 on issue 1992 by jsteele...@gmail.com: Add support for more than

I agree that support for more than 1 namespace would be useful, even if, as
a first pass, subscriptions were ignored and all folders were listed.

There are some problems with the work-around mentioned in comment 2:

1) If your shared namespace is "" (as shown in comment 1), then there is
no way in K-9 mail to manually select that namespace, because K-9
interprets an empty IMAP path prefix setting as "(Automatic using NAMESPACE
if available)", which means that it gets automatically translated to the
personal namespace. There is no way to disable this automatic translation.

2) Creating separate accounts in K-9 for accessing separate namespaces is
problematic because there is no way to copy/move messages between the
namespaces. In other words, I can't move a message from my inbox (in the
personal namespace) to some folder in the shared namespace because the
folders are accessed by different accounts.

If nothing else, having an option for turn off the "Automatic using
NAMESPACE if available" feature might be useful. That would permit the use
of a blank ("") prefix, which would then give access to all IMAP folders in
all namespaces to which the user has been granted access. That seems to be
the behavior of the native android email app.

k9m...@googlecode.com

unread,
Jul 19, 2010, 2:05:11 PM7/19/10
to k-9-noti...@googlegroups.com

Comment #5 on issue 1992 by shadow.xiii: Add support for more than one IMAP
namespace
http://code.google.com/p/k9mail/issues/detail?id=1992

But still, this will be useless if it cannot try to list all folders or
there is no manual folder addition

k9m...@googlecode.com

unread,
Jul 19, 2010, 2:43:23 PM7/19/10
to k-9-noti...@googlegroups.com

Comment #6 on issue 1992 by cketti: Add support for more than one IMAP
namespace
http://code.google.com/p/k9mail/issues/detail?id=1992

@shadow.xiii: K-9 Mail has the ability to list all folders (currently
limited to the selected namespace): In the folder list press the menu
button, select "Folders" then "Display all folders". Eventually you have to
select "Refresh folders" first. See also
http://code.google.com/p/k9mail/wiki/WorkingWithClasses

k9m...@googlecode.com

unread,
Jul 19, 2010, 3:13:45 PM7/19/10
to k-9-noti...@googlegroups.com

Comment #7 on issue 1992 by shadow.xiii: Add support for more than one IMAP
namespace
http://code.google.com/p/k9mail/issues/detail?id=1992

so what we only need is to have empty ("") namespace to make it work (not
to use automatic one).
That's good and should be easy to implement.

k9m...@googlecode.com

unread,
Aug 13, 2010, 3:58:29 AM8/13/10
to k-9-noti...@googlegroups.com

Comment #8 on issue 1992 by shadow.xiii: Add support for more than one IMAP
namespace
http://code.google.com/p/k9mail/issues/detail?id=1992

any progress on it folks?

k9m...@googlecode.com

unread,
Sep 15, 2010, 10:26:03 AM9/15/10
to k-9-noti...@googlegroups.com

Comment #9 on issue 1992 by cketti: Add support for more than one IMAP
namespace
http://code.google.com/p/k9mail/issues/detail?id=1992

Issue 2330 has been merged into this issue.

k9m...@googlecode.com

unread,
Jan 24, 2011, 10:57:39 AM1/24/11
to k-9-noti...@googlegroups.com

Comment #10 on issue 1992 by shadow.xiii: Add support for more than one
IMAP namespace
http://code.google.com/p/k9mail/issues/detail?id=1992

6 months waiting here for this feature and still no luck ?

k9m...@googlecode.com

unread,
Feb 10, 2011, 4:55:48 AM2/10/11
to k-9-noti...@googlegroups.com

Comment #11 on issue 1992 by jne...@gmail.com: Add support for more than

I'm also unable to access cyrus imap shared folders because of the
inability to use an empty namespace or to detect that there are multiple
namespaces available. I have tried to put an space, a dot or a slash in the
namespace setting in order to force it to show the alternate namespaces,
but I haven't been able to see other than the personal one.

k9m...@googlecode.com

unread,
Feb 20, 2011, 5:13:48 AM2/20/11
to k-9-noti...@googlegroups.com

Comment #12 on issue 1992 by kubib...@googlemail.com: Add support for more

Have the same problem. It seems, that the foreach loop, which should take
care of the namespace don't work as it should. Don't know whats the reason
for the namespace loop is, maybe speeding up or save memory, but for the
folder problem it could be the best to delete this loop and just use an
empty namespace of "".

k9m...@googlecode.com

unread,
Mar 4, 2011, 7:36:50 AM3/4/11
to k-9-noti...@googlegroups.com

Comment #13 on issue 1992 by vkrivok...@gmail.com: Add support for more

Or at least allow unescaped \ for IMAP prefix. This works on "my" IMAP
server:

. LIST "" "\*"

But when I enter "\" (no quotes) in K9mail IMAP Prefix box, it doesn't. I
can only guess it gets escaped to \\ or something. Can attach log file on
monday if it will help.

k9m...@googlecode.com

unread,
Jul 28, 2011, 9:53:10 AM7/28/11
to k-9-noti...@googlegroups.com

Comment #14 on issue 1992 by vkrivok...@gmail.com: Add support for more
Will this finally solve our issue?

Objective: Support for multiple namespaces.
Current State: The current implementation of namespaces only handles the
personal (default) namespace of the user. If there exists a non-default
blank namespace “”, there is currently no way to select it, since if the
namespace field is empty, K-9 uses the default namespace.

Description: An authenticated user may have access to 3 separate categories
of namespaces: his personal namespace, other user’s namespaces or common,
shared namespaces.

Deliverables: Implementation of the NAMESPACE command, which returns the
listing of all namespaces that the server wishes to expose to the client.
Creation of appropriate UI to present the user with a multi-select list of
namespaces from which he can choose which ones to display/use. Also, allow
interaction between folders from different namespaces in the same manner
that interaction occurs between folders from the same namespace.

Timeline: 27th July – 8th August

https://github.com/k9mail/k-9/wiki/Implementation-of-missing-IMAP-features-and-extensions

k9m...@googlecode.com

unread,
Jul 28, 2011, 12:49:33 PM7/28/11
to k-9-noti...@googlegroups.com

k9m...@googlecode.com

unread,
Nov 28, 2011, 8:28:52 AM11/28/11
to k-9-noti...@googlegroups.com

Comment #16 on issue 1992 by erwin.ts...@gmail.com: Add support for more

well, several month later - nothing done ?

k9m...@googlecode.com

unread,
Nov 28, 2011, 8:34:54 AM11/28/11
to k-9-noti...@googlegroups.com

Comment #17 on issue 1992 by erwin.ts...@gmail.com: Add support for more

for now - no ay to use my global folders: "/ARCHIV"
i tried several things...
""
''
"*"
'*'
"/"
"/*"
"\"
"\*"

nothing working :(
very sad, i mean this should be very easy to cahnge in code - or ?
isn't it ?

k9m...@googlecode.com

unread,
Nov 28, 2011, 6:52:29 PM11/28/11
to k-9-noti...@googlegroups.com

Comment #18 on issue 1992 by erwin.ts...@gmail.com: Add support for more

i mean, therefore it would only need in code, that a single "/" would
making folderlist from "", then it would be working fine.
because if i make a public shared folder "1" and would add there my folder,
then also set the namespace to "1" then it is working fine.
so, it only needs to handle to start list command on "" (/).
maybe easy possible to recognize if there is only a "/", thens tart list
from there.
(and not always from inbox/...)
or is such trick implemented ?

k9m...@googlecode.com

unread,
Nov 28, 2011, 9:46:21 PM11/28/11
to k-9-noti...@googlegroups.com

Comment #19 on issue 1992 by cke...@gmail.com: Add support for more than

Issue 3672 has been merged into this issue.

k9m...@googlecode.com

unread,
Nov 29, 2011, 5:04:54 AM11/29/11
to k-9-noti...@googlegroups.com

Comment #20 on issue 1992 by erwin.ts...@gmail.com: Add support for more

i tested now again ...
and i saw, if i enter to namespace \ or *, then the list cmd wil be working
(without any change in code)
so, it seems to be not so easy to handle that.
so, the problem must be after list cmd or the response from LIST will not
covered correct, if the namespace is * or \ ...
hmm, i think, that we will need here a real k9-developer ...

if there are any other devels, which want to look into ..
cketti told me, that it is in ImapStore.java -> search for namespace and
getCombinedPrefix

k9m...@googlecode.com

unread,
Nov 29, 2011, 5:37:06 AM11/29/11
to k-9-noti...@googlegroups.com

Comment #21 on issue 1992 by erwin.ts...@gmail.com: Add support for more

i can see, that the code is written to handle the namespace prefix: "if
null, then ..."
so, i think, the code must be rewritten, so that it is also possible to use
a "/" or a "*" and that this means, that it must use then for prefix ""
(empty), otherwise he response of the LIST command can not handled
correctly ..
(because on line: 535.. for (ImapResponse response : responses) {
there is the response ...for/while ..
and on line: 571 ...
if (prefixLength > 0) {
// Strip prefix from the folder name
if (folder.length() >= prefixLength) {
folder = folder.substring(prefixLength);
}
if
(!decodedFolderName.equalsIgnoreCase(getCombinedPrefix() + folder)) {
includeFolder = false;
}
//so, here it will not work any more if the prefix is set to * in settings.

i will try to find a developer, who have installed the whole android
compile stuff, maybe anyone can try to fix this on this position or to add
more debug informations, that we can find out, why the folders are there
not returned as they are ...


k9m...@googlecode.com

unread,
Nov 29, 2011, 11:40:50 AM11/29/11
to k-9-noti...@googlegroups.com

Comment #22 on issue 1992 by ndwarre...@gmail.com: Add support for more

see: http://pastebin.com/ncLsJCPr
maybe someone can compile it with this extra

k9m...@googlecode.com

unread,
Nov 29, 2011, 3:04:56 PM11/29/11
to k-9-noti...@googlegroups.com

Comment #23 on issue 1992 by ndwarre...@gmail.com: Add support for more

ok, i made a dirty hack, but it is working fine.
if wanted i will upload on my server a compiled version - if somebody wants
to test - let me know..

file: ImapStore.java - line 570
int prefixLength = getCombinedPrefix().length();


if (prefixLength > 0) {
// Strip prefix from the folder name

+ // START - special case for * (means all
namespace) - maybe dirty hack from ca...@gmx.at (camel)
+ if (mPathPrefix.equals("*")) {
+ prefixLength = 0;
+ }
+ // END - special case for * (means all namespace) -
maybe dirty hack from ca...@gmx.at (camel)


if (folder.length() >= prefixLength) {
folder = folder.substring(prefixLength);
}

+ // START - special case for * (means all
namespace) - maybe dirty hack from ca...@gmx.at (camel)
+ if (mPathPrefix.equals("*")) {
+ if
(!decodedFolderName.equalsIgnoreCase(folder)) {
+ includeFolder = false;
+ }
+ } else
+ // END - special case for * (means all namespace)
- maybe dirty hack from ca...@gmx.at (camel)
if
(!decodedFolderName.equalsIgnoreCase(getCombinedPrefix() + folder)) {


k9m...@googlecode.com

unread,
Nov 29, 2011, 3:08:58 PM11/29/11
to k-9-noti...@googlegroups.com

Comment #24 on issue 1992 by ndwarre...@gmail.com: Add support for more

so, this version needs maybe to add to the namespace hint text, that * can
be used for public folders, then user will get the whole structure ..

k9m...@googlecode.com

unread,
Nov 29, 2011, 11:24:57 PM11/29/11
to k-9-noti...@googlegroups.com

Comment #25 on issue 1992 by ndwarre...@gmail.com: Add support for more

i solved it now, by doing only few changes, and recompiled ...if someone
wants to test - please contact me on ca...@gmx.at

k9m...@googlecode.com

unread,
Nov 30, 2011, 5:30:59 AM11/30/11
to k-9-noti...@googlegroups.com

Comment #26 on issue 1992 by erwin.ts...@gmail.com: Add support for more

i uploaded the file to: xda-developers
http://forum.xda-developers.com/showthread.php?p=19838895#post19838895

k9m...@googlecode.com

unread,
Dec 1, 2011, 1:26:30 AM12/1/11
to k-9-noti...@googlegroups.com
Updates:
Cc: -cke...@gmail.com

Comment #27 on issue 1992 by cke...@gmail.com: Add support for more than

The ability to use the empty path prefix was added to master. Should be
included in K-9 Mail version 4.103 once released.

k9m...@googlecode.com

unread,
Nov 6, 2014, 10:13:52 AM11/6/14
to k-9-noti...@googlegroups.com

Comment #28 on issue 1992 by edner.0...@gmail.com: Add support for more
than one IMAP namespace
https://code.google.com/p/k9mail/issues/detail?id=1992

I've installed K9 Mail v5.001 on my Android device and want to access
shared/public folders on my UW IMAP server. Unfortunately this seems not to
be possible yet or I haven't found out how it need to configured.

By default the following information is returned when the NAMESPACE command
is entered:

* NAMESPACE (("" "/")("#mhinbox" NIL)("#mh/" "/")) (("~" "/"))
(("#shared/" "/")("#ftp/" "/")("#news." ".")("#public/" "/"))

The list command shows e.g. the following output:

a LIST "#public/" "*"
* LIST (\NoSelect \HasChildren) "/" #public/
* LIST (\NoSelect \HasNoChildren) "/" #public/Archiv
* LIST (\NoInferiors \UnMarked) "/" #public/Spam-Mail
a OK LIST completed

Is there any chance to get this feature implemented?


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

k9m...@googlecode.com

unread,
Nov 12, 2014, 3:02:12 AM11/12/14
to k-9-noti...@googlegroups.com

Comment #29 on issue 1992 by ponsc...@gmail.com: Add support for more than
Have you tried an empty namespace?

k9m...@googlecode.com

unread,
Nov 13, 2014, 2:14:08 PM11/13/14
to k-9-noti...@googlegroups.com

Comment #30 on issue 1992 by edner.0...@gmail.com: Add support for more
Sure, in this case the default behavior is, to only show the first,
available namespace:

a LIST "" "*"
* LIST (\NoInferiors \UnMarked) "/" Drafts
* LIST (\NoInferiors \UnMarked) "/" Sent
* LIST (\NoInferiors \UnMarked) "/" Spam
* LIST (\NoInferiors \UnMarked) "/" Trash
* LIST (\NoInferiors) NIL INBOX
a OK LIST completed
a LOGOUT

k9m...@googlecode.com

unread,
Jul 31, 2015, 12:42:24 PM7/31/15
to k-9-noti...@googlegroups.com

Comment #31 on issue 1992 by MillerMi...@gmail.com: Add support for more
Actually This now works. I tried today and got my public IMAP folder to
list. This is what I did. I downloaded newest K-9 from Android market
right. Then setup my account as usual, and of course no public IMAP folder
(my work uses 1 to share the Work Order system notification e-mails amongst
all technicians).

Well then I went in to Account Settings>Fetch Mail>Incoming Server
Scroll down to the Auto-detect IMAP namespace and uncheck the box. Now the
text line right below becomes available for input. Tap on it. Now hit the
spacebar once on your keyboard [on-screen or otherwise just put ONLY ONE
SINGLE SPACE IN THE BOX].

Now back out and manually refresh the account if it does not do so
automaticallyt for you. Viola you should now see public folders listed.

NOTE: Now they will be by their default actual name in the mail server and
not the pretty name you may have given it for users to read [like mine goes
from sw-workorders which is inside a a folder which is inside a top folder
(I know crazy for one folder, but I did not dream this up)]. So instead of
being inside 2 other folders with this nice name it is the ACTUAL folder
name: workorders.sw-workorder-s.workorder and is seen as only 1 folder
instead of 3 nested folders.

I could personally care less about this, the big thing is I have the folder
and can sync/view my emails on my phone when I could not before YAY!

NOTIFICATIONS AND SYNCING NOTE:
Long press the public folder and set it to a first class folder [and can
even check the box stating to move it closer to the top [right below the
usual inbox, sent, spam, trash folders that are maintained at the very
top]. This also helps with syncing you can set only the 1 folder (or a
couple) as 1st class so that way only your inbox and those 1 or couple you
set as first class folders will get push and poll as well as set off any
notifications, and all the rest of your personal folders which probably
just house tons of older archived/mail can be left ignored not taking up
your devices time, battery, or resources to maintain connections for and
check the tons of folders you don't need to have checked.

THANK YOU WHOMEVER AT K-( WHO FINALLY GOT THIS ABILITY CODED IN I HAVE BEEN
WAITING A LONG TIME FOR THIS FUNCTIONALITY. You may want to have a setting
somewhere more noticable as a checkbox that say something like if you would
like to view public IMAP folders on this account check this box during
setup wizard and maybe in like General settings for the account so you
don't have to be a more advanced user and find a bit of information like
this here to get what you need out of K-9.
Reply all
Reply to author
Forward
0 new messages