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

Re: [PATCH v3 1/3] send-mail: improve checks for valid_fqdn

From
Aditya Garg <gargaditya08@live.com>
Date
May 6, 2025, 17:49 UTC
Message-ID
<PN3PR01MB9597CF56985502FBC32A8520B889A@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
In-Reply-To
<PN3PR01MB959731081532150F5FE54875B889A@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
Show 56 quoted lines
> On 6 May 2025, at 10:53 PM, Aditya Garg <gargaditya08@live.com> wrote:
> 
> 
> 
>> On 06/05/25 10:41 pm, Junio C Hamano wrote:
>> Aditya Garg <gargaditya08@live.com> writes:
>> 
>>> I think we can add a minimal check to ensure that there are no two dots together.
>>> Does that sound fair?
>> 
>> Is it a common misconfiguration in the first place that singling out
>> a name ending with double dots (which indeed is very likely that
>> nobody should be relying on getting accepted by sensible SMTP
>> servers, hence very safe tightening) is worth doing?  If MacBooks as
>> shipped would by default claim to be "MacBook.." like your example
>> had (I do not know if that is the case, as I do not live in Apple
>> ecosystem), it may give us a reason to special case the trailing
>> double-dots, for example.
> 
> Its not an Apple thing. I am not even using macOS at the first place
> when I tested this, I was on Ubuntu running on my Mac.
> 
> Its a problem with Net::Domain. In systems without a domainname, and
> without a period in the hostname, Net::Domain will always output
> "hostname..". You probably should check your machine with smtp-debug?
> Btw, the output of `hostname -f` on these machines will be "hostname".
> 
> Now gmail does not reject this, probably the reason it is unnoticed?
> Since Outlook support is new, such problems are being observed.
> 
> 
>> 
>> I personally feel that "run of at most 63 alnum or dash separated by
>> a single dot in between" is easy enough to explain, so if I were
>> doing this change, I would just use the regexp used in posted patch
>> [*] and if nobody complains, stop right there.  If we get any
>> complaint, then I'd detect and reject the case where the string ends
>> with double-dots.
> 
> The regexp used in the original patch covers the double dots case as well.
> Its basically following the RFC guidelines, which a sensible SMTP server
> should follow, and so must a user.
> 
>> 
>> [Footnote]
>> 
>> * ... but I don't know if your use of negative lookaround
>>   assersions is correct.  Shouldn't the "a label cannot begin or
>>   end with dash" be applied not just to the first label but
>>   consistently to all of the dot-separated labels?
> 
> I think you are talking about this case:
> 
> someone.-example.com
> 
> No, its not valid.a

Although my regex is considering it as valid, which I can fix, but I'd rather wait for us to come to a conclusion on how we are fixing this in the first place.

Previous: Aditya GargNext: Junio C Hamano
Message 24 of 68 in “Improve checks for valid_fqdn in send-email and update documentation”
  1. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 4, 2025
  2. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 4, 2025
  3. Kristoffer HaugsbakkMay 4, 2025
  4. Aditya GargMay 4, 2025
  5. Kristoffer HaugsbakkMay 4, 2025
  6. 2/3 docs: improve send-email documentationAditya Garg, May 4, 2025
  7. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 4, 2025
  8. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 5, 2025
  9. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 5, 2025
  10. 2/3 docs: improve send-email documentationAditya Garg, May 5, 2025
  11. Junio C HamanoMay 5, 2025
  12. Aditya GargMay 5, 2025
  13. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 5, 2025
  14. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 5, 2025
  15. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 5, 2025
  16. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 5, 2025
  17. Junio C HamanoMay 5, 2025
  18. Aditya GargMay 6, 2025
  19. Aditya GargMay 6, 2025
  20. Aditya GargMay 6, 2025
  21. Junio C HamanoMay 6, 2025
  22. Junio C HamanoMay 6, 2025
  23. Aditya GargMay 6, 2025
  24. Aditya GargMay 6, 2025
  25. Junio C HamanoMay 6, 2025
  26. 2/3 docs: improve send-email documentationAditya Garg, May 5, 2025
  27. Junio C HamanoMay 5, 2025
  28. Aditya GargMay 6, 2025
  29. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 7, 2025
  30. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 7, 2025
  31. Aditya GargMay 7, 2025
  32. Junio C HamanoMay 7, 2025
  33. Aditya GargMay 8, 2025
  34. 2/3 docs: improve send-email documentationAditya Garg, May 7, 2025
  35. Junio C HamanoMay 7, 2025
  36. Aditya GargMay 8, 2025
  37. Junio C HamanoMay 8, 2025
  38. Aditya GargMay 8, 2025
  39. Junio C HamanoMay 8, 2025
  40. Aditya GargMay 8, 2025
  41. Junio C HamanoMay 8, 2025
  42. Aditya GargMay 8, 2025
  43. Aditya GargMay 8, 2025
  44. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 7, 2025
  45. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 8, 2025
  46. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 8, 2025
  47. 2/3 docs: improve send-email documentationAditya Garg, May 8, 2025
  48. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 8, 2025
  49. 0/3 Improve checks for valid_fqdn in send-email and update documentationAditya Garg, May 8, 2025
  50. 1/3 send-mail: improve checks for valid_fqdnAditya Garg, May 8, 2025
  51. 2/3 docs: improve send-email documentationAditya Garg, May 8, 2025
  52. 3/3 docs: add credential helper for outlook and gmail in OAuth list of helpersAditya Garg, May 8, 2025
  53. Junio C HamanoMay 8, 2025
  54. send-email: try to get fqdn by running hostname --fqdn on Linux and macOSAditya Garg, May 9, 2025
  55. Junio C HamanoMay 9, 2025
  56. send-email: try to get fqdn by running hostname --fqdn on Linux and macOSAditya Garg, May 10, 2025
  57. Julian SwagemakersMay 12, 2025
  58. Aditya GargMay 12, 2025
  59. Junio C HamanoMay 12, 2025
  60. Aditya GargMay 12, 2025
  61. Junio C HamanoMay 12, 2025
  62. Aditya GargMay 12, 2025
  63. Eric SunshineMay 12, 2025
  64. Junio C HamanoMay 12, 2025
  65. Aditya GargMay 13, 2025
  66. Junio C HamanoMay 12, 2025
  67. send-email: try to get fqdn by running hostname -f on Linux and macOSAditya Garg, May 12, 2025
  68. send-email: try to get fqdn by running hostname -f on Linux and macOSAditya Garg, May 12, 2025

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.