cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Listing and moving mails in IMAP Inbox

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Tue, 10 Dec 2013 20:17:07 +0000

On Tue, 10 Dec 2013, No One wrote:

> Thank you, I just assumed that I had the newest
> version.. Now, with 7.33 everything works as
> expected.

You're welcome.

> So, after copying the mail and adding a deleted flag
> one has to expunge the mail. Using
>
> --url 'imaps://mailserver.com:993/INBOX' -X 'EXPUNGE'

Yep - that sounds right.

> to expunge _all_ mails works fine but I just want to
> expunge a selected mail, so I tried
>
> --url 'imaps://mailserver.com:993/INBOX' -X
> 'UID EXPUNGE 1'
>
> but this command doesn't seem to work even though
> with the verbose flag (-v) it tells me:
>
> > > A004 UID EXPUNGE 1
> > < A004 OK Expunge completed.
>
> The email still appears with the deleted flag. Can someone
> confirm this behaviour?
>
> Maybe this is caused by my mail server or something else.

Mmmm... This may be a known limitation with curl.

I assume you are performing three separate calls and as such each call will
connect, authenticate, perform the transfer, logout and disconnect. The
problem is that your email server requires the EXPUNGE before the LOGOUT and
disconnect - otherwise it will roll back the transaction that requires
wither the EXPUNGE or CLOSE command. At least that's my understanding ;-)

We need to implement either A) Post transfer commands (like FTP does) in the
IMAP module or B) Add generic support for transfer specific options in the
curl command line utility.

If you take a look at Test 816 in the curl source code you will see that it
is currently disabled until we implement this feature - as the Test Suite
uses curl itself.

The only work around, at present, is to perform three transfers and to reuse
the same connection for all three by coding up a solution that talks
directly to libcurl yourself.
 
Assuming I get time over Christmas, one or both of these features *should*
be added in v7.35.0 as 1) I have been wanting to do this since the summer to
get Tests 815 and 816 running and 2) Solution B was recently talked about on
this list - However, if we assume everything goes to plan (as we release
every two months) that version won't be released until February time. Sorry!

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-12-10