git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 6/6] imap-send: correctly report "host" when using "tunnel"

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2023, 21:41 UTC
Message-ID
<xmqq1qn25v4r.fsf@gitster.g>
In-Reply-To
<Y94866yd3adoC1o9@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 26 quoted lines
> Yes, I agree that the scenario I'm giving is contrary to what the docs
> say. But IMHO it is worth preferring what the code does now versus what
> the docs say. The current behavior misbehaves if you configure things
> badly (accidentally mix and match imap.host and imap.tunnel). Your new
> behavior misbehaves if you have two correctly-configure imap stanzas
> (both with a host/tunnel combo). Those are both fairly unlikely
> scenarios, and the outcomes are similar (we mix up credentials), but:
>
>   1. In general, all things being equal, I'd rather trust the code as
>      the status quo. People will complain if you break their working
>      setup. They won't if you fix the documentation.
>
>   2. In the current behavior, if it's doing the wrong thing, your next
>      step is to fix your configuration (don't mix and match imap.host
>      and imap.tunnel). In your proposed behavior, there is no fix. You
>      are simply not allowed to use two different imap tunnels with
>      credential helpers, because the helpers don't receive enough
>      context to distinguish them.
>
>      And that is not even "two imap tunnels in the same config". It is
>      really per user. If I have two repositories, each with
>      "imap.tunnel" in their local config, they will still invoke the
>      same credential helpers, and both will just see host=tunnel. The
>      namespace for "host" really is global and should be unique (ideally
>      across the Internet, but at the very least among the hosts that the
>      user contacts).
All good points.
Show 21 quoted lines
> Yes, there are many config schemes that would avoid this problem. If you
> are going to tie the two together, I think it would make sense to use
> real subsections based on the host-name, like:
>
>   # hostname is the subsection key; it also becomes a label when
>   # necessary
>   [imap "example.com"]
>
>   # does not even need to mention a hostname. We'll assume example.com
>   # here.
>   tunnel = "any-command"
>
>   # assumes example.com as hostname; not needed if you are using a
>   # tunnel, of course
>   protocol = imaps
>
> But I would not bother going to that work myself. IMHO imap-send is
> somewhat of an abomination, and I'd actually be just as happy if it went
> away. But what you are doing seems to go totally in the wrong direction
> to me (keeping it, but breaking a rare but working use case to the
> benefit of a rare but broken misconfiguration).
Yup.
Previous: Jeff KingNext: Ævar Arnfjörð Bjarmason
Message 34 of 37 in “Makefile: not use mismatched curl_config to check version”
  1. 1/2 Makefile: not use mismatched curl_config to check versionJiang Xin, Feb 1, 2023
  2. 2/2 imap-send: not define USE_CURL_FOR_IMAP_SEND in MakefileJiang Xin, Feb 1, 2023
  3. imap-send: replace auto-probe libcurl with hard dependencyÆvar Arnfjörð Bjarmason, Feb 1, 2023
  4. Junio C HamanoFeb 1, 2023
  5. Jeff KingFeb 1, 2023
  6. Ævar Arnfjörð BjarmasonFeb 2, 2023
  7. Ævar Arnfjörð BjarmasonFeb 1, 2023
  8. Junio C HamanoFeb 2, 2023
  9. 0/6 imap-send: replace auto-probe libcurl with hard dependencyÆvar Arnfjörð Bjarmason, Feb 2, 2023
  10. 1/6 imap-send: note "auth_method", not "host" on auth method failureÆvar Arnfjörð Bjarmason, Feb 2, 2023
  11. Junio C HamanoFeb 2, 2023
  12. 2/6 imap-send doc: the imap.sslVerify is used with imap.tunnelÆvar Arnfjörð Bjarmason, Feb 2, 2023
  13. 3/6 imap-send: replace auto-probe libcurl with hard dependencyÆvar Arnfjörð Bjarmason, Feb 2, 2023
  14. Junio C HamanoFeb 2, 2023
  15. 4/6 imap-send: make --curl no-optionalÆvar Arnfjörð Bjarmason, Feb 2, 2023
  16. Junio C HamanoFeb 2, 2023
  17. Ævar Arnfjörð BjarmasonFeb 3, 2023
  18. Junio C HamanoFeb 4, 2023
  19. 6/6 imap-send: correctly report "host" when using "tunnel"Ævar Arnfjörð Bjarmason, Feb 2, 2023
  20. Junio C HamanoFeb 2, 2023
  21. Jeff KingFeb 3, 2023
  22. Ævar Arnfjörð BjarmasonFeb 3, 2023
  23. Jeff KingFeb 4, 2023
  24. Ævar Arnfjörð BjarmasonFeb 5, 2023
  25. Jeff KingFeb 7, 2023
  26. Ævar Arnfjörð BjarmasonFeb 7, 2023
  27. Junio C HamanoFeb 7, 2023
  28. Ævar Arnfjörð BjarmasonFeb 7, 2023
  29. Jeff KingFeb 7, 2023
  30. Jeff KingFeb 7, 2023
  31. Junio C HamanoFeb 7, 2023
  32. Ævar Arnfjörð BjarmasonFeb 8, 2023
  33. Jeff KingFeb 17, 2023
  34. Junio C HamanoFeb 6, 2023
  35. 5/6 imap-send: remove old --no-curl codepathÆvar Arnfjörð Bjarmason, Feb 2, 2023
  36. Junio C HamanoFeb 2, 2023
  37. Junio C HamanoFeb 1, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.