Subject: how 2 determine if mailbox can have subboxes and messages

From: tomas pospisek <[email-masked]>
Date: Fri, 21 Feb 2003 19:31:13 +0100 (CET)

mailsync's task is to synchronize two mailboxes. There are mail
repositories that support mailboxes with submailboxes *and* messages
(courier IMAP, Maildir) but most not.

Is there an eays and/or elegant way to find out whether a mailbox
may contain subboxes *and* messages at the same time?
*t

--
enduring war
        Florian Rötzer

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: tomas pospisek <[email-masked]>
Date: Mon, 24 Feb 2003 10:22:09 +0100 (CET)

> may contain subboxes *and* messages at the same time?

Since this request hasn't generated a mailstorm, here's a follow up:

is there a way to access/find/catch the "Hello" String somewhere in c-client:

	"OK Courier-IMAP ready. ..."

I could filter on that string and check the currently used driver in order
to determine whether or not the store I'm accessing has the ability to
create submailboxes _and_ messages at the same time inside mailboxes.

Comments? Am I heading in a completely wrong direction?
*t

--
                                 will kill for oil

---

From: Hein Roehrig <[email-masked]>
Date: Mon, 24 Feb 2003 10:47:41 +0100

>> may contain subboxes *and* messages at the same time?

The IMAP LIST response has name attributes \Noinferiors (mailbox
cannot have submailboxes) and \Noselect (mailbox cannot have
messages). I don't know how you get to that information from the
C-Client library.

-Hein

---

From: Mark Crispin <[email-masked]>
Date: Mon, 24 Feb 2003 09:00:43 -0800 (PST)

> 	"OK Courier-IMAP ready. ..."

The only thing that such a test would be good for would be to determine if
the server does not comply with IMAP.  Courier is very non-compliant, and
you should always use the "/loser" flag in the host specification of the
mailbox name with a Courier server to avoid problems.

> Comments? Am I heading in a completely wrong direction?

Yes, you are heading in the wrong direction.

Use the mail_list() function which returns the mailbox attributes
including noselect and noinferiors state.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.

---

From: Vadim Zeitlin <[email-masked]>
Date: Mon, 24 Feb 2003 19:54:10 +0100 (CET)

On Mon, 24 Feb 2003 09:00:43 -0800 (PST) Mark Crispin <[email-masked]> wrote:

MC> On Mon, 24 Feb 2003, tomas pospisek wrote:
MC> > Since this request hasn't generated a mailstorm, here's a follow up:
MC> > is there a way to access/find/catch the "Hello" String somewhere in c-client:
MC> >         "OK Courier-IMAP ready. ..."
MC> 
MC> The only thing that such a test would be good for would be to determine if
MC> the server does not comply with IMAP.  Courier is very non-compliant, and
MC> you should always use the "/loser" flag in the host specification of the
MC> mailbox name with a Courier server to avoid problems.

 But how can I know that the server is Courier? I don't see any way to
retrieve the server greeting from cclient, is there one (then I'd be able
to close the connection and reopen it with this flag automatically without
user internvention)? Could you please also mention briefly how is cclient
behaviour modified if this flag is given?

 Thank you,
VZ

---

From: Mark Crispin <[email-masked]>
Date: Mon, 24 Feb 2003 10:59:15 -0800 (PST)

> behaviour modified if this flag is given?

My comment was only half-serious.  There is some (albeit minimal) hope that
the author of Courier will finally decide to play ball with the rest of the
IMAP community, instead of trying to force the rest of the IMAP community to
comply with his misinterpretation of IMAP.

I recommend the use of "/loser" as a manual user setting, to be used only when
the application has problems with a particular server implementation that are
traced to implementation defects on the server.  What /loser does will change
over time; as problems are discovered more /loser workaround will be added.

I strongly recommend *AGAINST* any attempt to test for a particular server by
name; that is absolutely the wrong way to build clients.  When I become aware
of any client that tries to test for UW imapd in that way, I will see to it
that the next version of UW imapd breaks that test.

---

From: tomas pospisek <[email-masked]>
Date: Sat, 15 Mar 2003 19:31:19 +0100 (CET)

> including noselect and noinferiors state.

Very well, thanks. I'm using these now and syncing seems to work pretty
well.

However - since I'm gettin a prefix and pattern from the user that tells
me what he wants to sync - if I deterministically want to find out
whether I can or I can not create a certain hierarchy level ("directory")
I'd need to know about its parent's flags - or if that one doesn't exist
its grand parent's etc. At one point I'll cross the prefix boundary, and
since neither IMAP nor c-client guarantee, that the whole mailstore is a
rooted tree there seems not to be a deterministic way to verify whether I
can or can not create a subdir/hierarchy level except for trying and
checking for failure?

Other than that thanks a lot, I'm amazed how well c-client works.

One other thing - the docu lists MESSAGECACHE.uid as a top-level element,
but it's not - it's "private". Which also makes it inaccessible from C++
(C++ keyword conflict!).
*t

--
                                 will kill for oil

---

From: Mark Crispin <[email-masked]>
Date: Mon, 17 Mar 2003 10:14:25 -0800 (Pacific Standard Time)

> but it's not - it's "private". Which also makes it inaccessible from C++

You have to use the mail_uid() function to get the UID for a message
number.  Do not try to access the UID directly from the cache since it may
not be loaded.

-- Mark --