curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

Upload of new mail via IMAP

From: Nicolas George via curl-users <curl-users_at_lists.haxx.se>
Date: Mon, 9 Sep 2024 17:17:44 +0200

Hi.

I need a tool to upload a new mail to a folder on an IMAP server.
Apparently, curl is almost capable of doing it with:

curl --user $login --url imaps://$server/$folder --upload-file $file

Unfortunately, the mail appears as already seen in the box. I need it to
be marked as new.

And apparently, this behavior is hard-coded:

  /* Send the APPEND command */
  result = imap_sendf(data,
                      "APPEND %s (\\Seen) {%" CURL_FORMAT_CURL_OFF_T "}",
                      mailbox, data->state.infilesize);

https://github.com/curl/curl/blob/master/lib/imap.c#L817

I can consider using a patched version of curl, a binary patch on the
Debian package to replace “(\\Seen)” with spaces works fine. But that is
not elegant.

Can I submit a feature wish to have an option to choose the presence or
absence of this “(\\Seen)” flag?


For reference, I need this for when our users go away and want to
forward their mail: an increasing number of destination will reject the
forwarded mail because it contains an unavoidable amount of spam. So
instead of forwarding it through SMTP I want to push it through IMAP.


Thanks in advance.

-- 
  Nicolas George
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2024-09-09