From: "Wolfgang Faust" <contrib-git@wolfgangfaust.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org, "Aditya Garg" <gargaditya08@live.com>
Subject: Re: [PATCH] imap-send: add --draft to set IMAP \Draft flag
Date: Tue, 01 Sep 2026 21:28:55 -0700 [thread overview]
Message-ID: <31d24dc3-3ef6-41cb-acbd-4cb4fb0d2338@app.fastmail.com> (raw)
In-Reply-To: <xmqq8q5kl4gq.fsf@gitster.g>
On Tue, Sep 1, 2026, at 8:25 PM, Junio C Hamano wrote:
> "Wolfgang Faust" <contrib-git@wolfgangfaust.com> writes:
>
>> The documented purpose of imap-send is to upload draft emails for sending
>> later, but it did not have any way to mark the messages as \Draft, so some
>> email clients presented the result as an un-editable, un-sendable email
>> even if it happened to be in a "Drafts" folder.
>
> I agree that defaulting to '--no-draft' is a sensible design choice
> to avoid breaking clients that have been working fine.
Definite agree; I elaborate further below.
> It would be helpful to know if e-mail clients that send messages
> from the Drafts folder without the '\Draft' flag would misbehave if
> they encounter messages marked as such.
Not sure how to find this out without doing a complete survey of every
possible email client, but I think it's unlikely to be a major issue:
any such client would already be incompatible with other standards-
compliant clients using the same IMAP account. However:
> Knowing this would help us
> decide whether to flip the default to '--draft', while keeping
> '--no-draft' as an escape hatch nobody is expected to use.
I think the default should probably be --no-draft anyway.
First, imap-send is also used for cases like `git send-email
--imap-sent-folder`, which would need to be taught *not* to mark the
email as a draft, as in this case it has already been sent and should
not be editable. We can change `send-email` to set that flag but this
does not help any external tooling that might be relying on this
behavior.
Second, as `--draft` requires a relatively recent version of curl, or a
(non-default) `--no-curl` flag, trying to turn it on would cause most
current systems to continue *not* updating the flag, so in practice
the behavior would change depending on the user's system libraries,
which seems very unusual. (Or, if we changed the curl version check
from warning to error, the command would default to being broken unless
you pass `--no-draft`.)
>> +`--draft`::
>> +`--no-draft`::
>> + Mark uploaded messages with the IMAP `\Draft` flag. The default is `--no-draft`.
>> ++
>> +With libcurl, `--draft` requires version 8.13.0 or later.
>> +Older libcurl still uploads the message but cannot set the flag.
>
> When compiled with older libcurl, would the command error out when
> run with '--draft', or would it silently ignore the option? I have
> a mild preference for the former over the latter. Issuing a warning
> without erroring out is better than nothing, but people tend to
> overlook warning messages.
Right now it issues a warning. I don't think I had any particular
reason for that decision and changing to an error seems fine.
> Also you might want to consider adding a configuration variable,
> perhaps? I dunno.
I assume you mean something like `git config imap.draft true`? This has
all the same problems as changing the default (in particular the
`--imap-sent-folder` case), though I guess at least it would be opt-in.
I also read in some past thread (I forget which) that we generally want
to start by adding a flag, and only introduce a configuration if there
is demand for it after the flag has proven itself.
> Thanks.
next prev parent reply other threads:[~2026-09-02 4:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 0:13 [PATCH] imap-send: add --draft to set IMAP \Draft flag Wolfgang Faust
2026-09-02 3:25 ` Junio C Hamano
2026-09-02 4:28 ` Wolfgang Faust [this message]
2026-09-02 14:37 ` Junio C Hamano
2026-09-03 5:42 ` Aditya Garg
2026-09-03 13:42 ` Junio C Hamano
2026-09-03 14:37 ` Aditya Garg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=31d24dc3-3ef6-41cb-acbd-4cb4fb0d2338@app.fastmail.com \
--to=contrib-git@wolfgangfaust.com \
--cc=gargaditya08@live.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).