cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Improving IMAP support

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Wed, 21 Nov 2012 11:25:38 +0000

Hi Jiri,

I just wanted to add my two pennies worth as I am about to start submitting
changes to IMAP myself but have been waiting for v7.28.1 to be released ;-)

> 1/ For reading, the natural way is to just improve the handling of IMAP
> URLs to achieve full (or at least sufficient) compliance with RFC 5092
> (IMAP URI Scheme). This is otherwise more or less implemented.
>
> 2/ APPENDing would require a similar interface like FETCH, but the other
> way around, uploading instead of downloading. The library already has
> uploading capabilities, shouldn't be too hard either.

I see Daniel has already commented on these and I don't think there is
anything I can add here.

> 3/ The other commands need some new design. My idea is to use
> CURLOPT_CUSTOMREQUEST, where the content would be a command

I would recommend this as the best course of action and is consistent with
some of the other protocols that (lib)curl implements.

> name string, like "LIST" or "CREATE". The URL would then contain the
> parameters of the command instead of a path to the message to fetch.

As I think Daniel has already mentioned, I would recommend we avoid this
approach if possible - It too was the way I thought of adding the "extra"
POP3 commands back at the beginning of the year but instead we discussed
using CURLOPT_QUOTE but as the parameters are a lot simpler in POP3 land we
just include them in the request so for example the DELE command uses:

curl --url pop3://mail.domain.com -X "DELE 1" -I
 
You might like to take a look at the pop3 source code as well to see how I
added the extra commands there ;-)

> A prototype with the overall design as described above seemed to come
> to life quite nicely.

Cool - we look forward to taking a look.

> Of course there was a lot of cleanup or refactoring (there are still
contextual
> and literal references to FTP in imap.c), but almost exclusively isolated
to imap.{c,h}.

Yes that was on my to do list as well - this was also the case with the smtp
/ pop3 code which I have tidied up now.

Apart from the tidy up exercise, I have some bug fixes to push and I am
hoping to add SASL authentication to IMAP in the next release as well.

I would like to try and co-ordinate our changes, if possible, and avoid
duplication of work or cause headaches for either of us ;-)

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-21