On Thu, 12 Sep 2002, Guy Davis wrote: > I'm running into some strange behavior when I call the mail_move() > method. It seems like while other calls like mail_create() strip off > the remote part of the mail specification when sending the actual IMAP > command, the mail_move() call doesn't.
mail_copy() and mail_move() are different from all other c-client calls in that they apply to the current mailbox, but take a mailbox name argument as the destination. The mailbox name in these two calls is *NOT* a c-client mailbox name, but rather a mailbox name in the context of the currently selected stream. This has a number of subtle implications. In the case of a local selected mailbox, the destination mailbox name must be a mailbox name in the same format as the source, UNLESS the application has armed a mailproxycopy_t routine. If a mailproxycopy_t routine is armed, then c-client only verifies that the destination mailbox exists, and then has the mailproxycopy_t routine do the work. In the case of a POP3 or NNTP mailbox, mail_copy()/mail_move() calls are invalid unless the application has armed a mailprroxycopy_t routine; if so then the mailproxycopy_t routine is called to do the work. In the case of an IMAP mailbox, the entire destination mailbox name is a mailbox name on the IMAP server. If the IMAP server returns a referral *AND* a mailproxycopy_t routine is armed, the mailproxycopy_t routine is called to do the work on the name returned by the referral. > Another question I have is how to get the mail_create() to use the > default RH mailbox format (UNIX/mbox I think) rather than the mbx > format. mail_create() defaults to whatever the default format it was built with, which normally is the traditional UNIX mailbox format. If c-client was built to default to creating in mbx format, the person doing the build presumably had a reason for doing so, and you should not override it in your application. If you insist upon overriding it in your application, you can either provide the driver prototype for the traditional UNIX mailbox format as the MAILSTREAM to mail_create(), or you can prefix the name with "#driver.unix/". Note that if I get a bug report saying "I built c-client to default to mbx format, but such-and-such application still creates in traditional UNIX format even after I relunk it with the new c-client", I will probably not be very complimentary in my commentary about the application author after wasting hours of time only to find out that it's because my advice was ignored....... ;-) -- Mark -- http://staff.washington.edu/mrc Science does not emerge from voting, party politics, or public debate.
