Upload of new mail via IMAP

Nicolas George via curl-users <[email protected]>
Newsgroups gmane.comp.web.curl.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.