Discussion:
Fetch and Delete Email over IMAP/POP3 Transactionally
(too old to reply)
Sonat Süer
2018-03-23 08:10:42 UTC
Permalink
Raw Message
Hi There,

I can easily fetch email messages over IMAP and POP3 using curl. I can
also delete a message provided that I know its identifier. However
these require multiple uses of curl and hence opens multiple IMAP/POP3
sessions. The problem is that the identifier of a message may change
between sessions so there is no way to guarantee that the message I
fetched is the message I deleted.

Is there a way to send IMAP/POP3 commands after successfully fetching
the message in the same IMAP/POP3 session?

I tried using --next but as far as I can see --next starts a new
session for each step. So, for my use case, it is equivalent to using
curl multiple times.

I also found out about the --quote option. It allows one to send
commands after successfully receiving a file but it works only for FTP
and SFTP.

If there is no workaround, I would like to open a PR implementing a
version of --quote for IMAP and POP3 which will allow one to send
commands within the same IMAP/POP3 session.

Thanks,
Sonat
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https

Loading...