<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-send-email.perl, branch v2.50.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.50.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.50.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-05-23T22:34:08Z</updated>
<entry>
<title>Merge branch 'ag/send-email-hostname-f'</title>
<updated>2025-05-23T22:34:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-05-23T22:34:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fb67f789b05d46a05d652da43119ea2ac4a57e6f'/>
<id>urn:sha1:fb67f789b05d46a05d652da43119ea2ac4a57e6f</id>
<content type='text'>
Teach "git send-email" to also consult `hostname -f` for mail
domain to compute the identity given to SMTP servers.

* ag/send-email-hostname-f:
  send-email: try to get fqdn by running hostname -f on Linux and macOS
</content>
</entry>
<entry>
<title>Merge branch 'ag/doc-send-email'</title>
<updated>2025-05-19T23:02:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-05-19T23:02:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae0b60e0095a118af7bb4026622d8c308e0a4c52'/>
<id>urn:sha1:ae0b60e0095a118af7bb4026622d8c308e0a4c52</id>
<content type='text'>
The `send-email` documentation has been updated with OAuth2.0
related examples.

* ag/doc-send-email:
  docs: add credential helper for outlook and gmail in OAuth list of helpers
  docs: improve send-email documentation
  send-mail: improve checks for valid_fqdn
</content>
</entry>
<entry>
<title>send-email: try to get fqdn by running hostname -f on Linux and macOS</title>
<updated>2025-05-14T00:14:29Z</updated>
<author>
<name>Aditya Garg</name>
<email>gargaditya08@live.com</email>
</author>
<published>2025-05-12T08:11:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9c9f8849a2a5ca058e8a9a1dfd6c9c925533e581'/>
<id>urn:sha1:9c9f8849a2a5ca058e8a9a1dfd6c9c925533e581</id>
<content type='text'>
`hostname` is a popular command available on both Linux and macOS. As
per the man-page[1], `hostname -f` command returns the fully qualified
domain name (FQDN) of the system. The current Net::Domain perl module
being used in the script for the same has been quite unrealiable in many
cases. Thankfully, we now have a better check for valid_fqdn, which does
reject the invalid FQDNs given by this module properly, but at the same
time, it will result in a fallback to 'localhost.localdomain' being
used. `hostname -f` has been quite reliable (probably even more reliable
than the Net::Domain module) and before falling back to
'localhost.localdomain', we should try to use it. Interestingly, the
`hostname` command is actually used by perl modules like Net::Domain[2]
and Sys::Hostname[3] to get the hostname. So, lets give `hostname -f` a
chance as well!

[1]: https://man7.org/linux/man-pages/man1/hostname.1.html
[2]: https://github.com/Perl/perl5/blob/blead/cpan/libnet/lib/Net/Domain.pm#L88
[3]: https://github.com/Perl/perl5/blob/blead/ext/Sys-Hostname/Hostname.pm#L93

Signed-off-by: Aditya Garg &lt;gargaditya08@live.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-mail: improve checks for valid_fqdn</title>
<updated>2025-05-08T18:07:07Z</updated>
<author>
<name>Aditya Garg</name>
<email>gargaditya08@live.com</email>
</author>
<published>2025-05-08T17:14:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8adee0c0b06f7d1347b4e26a635e0ef20be217f4'/>
<id>urn:sha1:8adee0c0b06f7d1347b4e26a635e0ef20be217f4</id>
<content type='text'>
The current implementation of a valid Fully Qualified Domain Name
is not that strict. It just checks whether it has a dot (.) and
if using macOS, it should not end with .local. As per RFC1035[1],
from what I understood, the following checks need to be done:

- The domain must contain atleast one dot
- Each label (separated by dots) must be 1-63 characters long
- Labels must start and end with an alphanumeric character
- Labels can contain alphanumeric characters and hyphens

Here are some examples of valid and invalid labels:

'example.com',          # Valid
'sub.example.com',      # Valid
'my-domain.org',        # Valid
'localhost',            # Invalid (no dot)
'MacBook..',            # Invalid (double dots)
'-example.com',         # Invalid (starts with a hyphen)
'example-.com',         # Invalid (ends with a hyphen)
'example..com',         # Invalid (double dots)
'example',              # Invalid (no TLD)
'example.local',        # Invalid on macOS
'valid-domain.co.uk',   # Valid
'123.example.com',      # Valid
'example.com.',         # Invalid (trailing dot)
'toolonglabeltoolonglabeltoolonglabeltoolonglabeltoolonglabeltoolonglabel.com', # Invalid (label &gt; 63 chars)

Due to current implementation, I was not able to send emails from
Ubuntu. Upon debugging, I found that the SMTP domain being passed
to Outlook's servers was not valid.

Net::SMTP=GLOB(0x5db4351225f8)&gt;&gt;&gt; EHLO MacBook..
Net::SMTP=GLOB(0x5db4351225f8)&lt;&lt;&lt; 501 5.5.4 Invalid domain name
Net::SMTP=GLOB(0x5db4351225f8)&gt;&gt;&gt; HELO MacBook..

Notice that an invalid domain name "MacBook.." is sent by git-send-email.
We have a fallback code that checks output from Net::Domain::domainname()
or asking domain method of an Net::SMTP instance to detect a misconfigured
hostname and replace it with fallback "localhost.localdomain", but the
valid_fqdn apparently is failing to say "MacBook.." is not a valid fqdn.

With this patch, the rule used in valid_fqdn is tightened, the beginning
part of the SMTP exchange looked like this:

Net::SMTP=GLOB(0x58c8af71e930)&gt;&gt;&gt; EHLO localhost.localdomain
Net::SMTP=GLOB(0x58c8af71e930)&lt;&lt;&lt; 250-PN4P287CA0064.outlook.office365.com Hello

[1]: https://datatracker.ietf.org/doc/html/rfc1035

Signed-off-by: Aditya Garg &lt;gargaditya08@live.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-email: add --[no-]outlook-id-fix option</title>
<updated>2025-04-29T17:06:52Z</updated>
<author>
<name>Aditya Garg</name>
<email>gargaditya08@live.com</email>
</author>
<published>2025-04-29T16:37:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=daec3c08e3e40c436cab013c5005a6e8b2e7923e'/>
<id>urn:sha1:daec3c08e3e40c436cab013c5005a6e8b2e7923e</id>
<content type='text'>
Add an option to allow users to specifically enable or disable
retrieving the Message-ID from the Outlook SMTP server. This can be used
for other hosts mimicking the behaviour of Outlook, or for users who set
a custom domain to be a CNAME for the Outlook SMTP server.

While at it, lets also add missing * in description of --no-smtp-auth.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Aditya Garg &lt;gargaditya08@live.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-email: retrieve Message-ID from outlook SMTP server</title>
<updated>2025-04-25T17:08:24Z</updated>
<author>
<name>Aditya Garg</name>
<email>gargaditya08@live.com</email>
</author>
<published>2025-04-25T10:09:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d235c468a5d713f8244727d1862eaa1f029b3821'/>
<id>urn:sha1:d235c468a5d713f8244727d1862eaa1f029b3821</id>
<content type='text'>
The script generates a Message-ID alongwith the other headers when
gen_header is called, and is sent alongwith the email. For most email
providers, including gmail, the Message-ID goes unchanged to the
recipient.

But, this does not seem to be a case with Outlook. In Outlook, when we
send our own Message-ID as a part of the headers, it discards it. Then
it generates a new random Message-ID and that is what the recipient
gets.

This is a problem because the Message-ID is crucial when we are sending
multiple emails in a thread. The current implementation for threads in
the script replies to the Message-ID it generated, but due to Outlook's
behavior, it is not the same as the one that the recipient got, thus
breaking threads. So a need arises to retrieve the Message-ID from the
server response and set it in the In-Reply-To and References email
headers instead of using the self generated one for the purpose of
replies.

The $smtp-&gt;message variable in this script for outlook is something like
this:

2.0.0 OK &lt;Message-ID&gt; [Hostname=Some-hostname]

The Message-ID here is the one the recipient gets, rather than the one
the script generated.

This patch uses the fact above and retrieves the Message-ID from the
server response. It then changes the value of the $message_id variable
to the one received from the server. This value will be used when next
and subsequent messages are sent as replies to the message, thus
preserving the threading of the messages.

Signed-off-by: Aditya Garg &lt;gargaditya08@live.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-email: finer-grained SMTP error handling</title>
<updated>2025-04-07T21:54:05Z</updated>
<author>
<name>Zheng Yuting</name>
<email>05zyt30@gmail.com</email>
</author>
<published>2025-03-26T07:52:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ac402cdf3d5a82d3ba8943a452e84f54f398522'/>
<id>urn:sha1:1ac402cdf3d5a82d3ba8943a452e84f54f398522</id>
<content type='text'>
Code captured errors but did not process them further.
This treated all failures the same without distinguishing SMTP status.

Add handle-smtp_error to extract SMTP status codes using a regex (as
defined in RFC 5321) and handle errors as follows:

- No error present:
	- If a result is provided, return 1 to indicate success.
	- Otherwise, return 0 to indicate failure.

- Error present with a captured three-digit status code:
	- For 4yz (transient errors), return 1 and allow retries.
	- For 5yz (permanent errors), return 0 to indicate failure.
	- For any other recognized status code, return 1, treating it as
	a transient error.

- Error present but no status code found:
	- Return 1 as a transient error.

Signed-off-by: Zheng Yuting &lt;05ZYT30@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-email: capture errors in an eval {} block</title>
<updated>2025-04-07T21:54:05Z</updated>
<author>
<name>Zheng Yuting</name>
<email>05zyt30@gmail.com</email>
</author>
<published>2025-03-26T07:52:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce20dec4a4de8a75cbc9735538c9430e68d3c1f8'/>
<id>urn:sha1:ce20dec4a4de8a75cbc9735538c9430e68d3c1f8</id>
<content type='text'>
Auth relied solely on return values without catching errors. This misjudges
non-credential errors as auth failure without error info.

Patch wraps the entire auth process in an eval {} block to catch
all exceptions, including non-credential errors. It adds a new $error var,
uses 'or do' to prevent flow break, and returns $result ? 1 : 0. And merges
if/else branches, integrates SASL and basic auth, with comments for
future status code handling.

Signed-off-by: Zheng Yuting &lt;05ZYT30@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Makefile: consistently use @PLACEHOLDER@ to substitute</title>
<updated>2024-12-06T22:52:08Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-06T13:24:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbe46c0feb25417d01267bb97edb861694ed023d'/>
<id>urn:sha1:dbe46c0feb25417d01267bb97edb861694ed023d</id>
<content type='text'>
We have a bunch of placeholders in our scripts that we replace at build
time, for example by using sed(1). These placeholders come in three
different formats: @PLACEHOLDER@, @@PLACEHOLDER@@ and ++PLACEHOLDER++.

Next to being inconsistent it also creates a bit of a problem with
CMake, which only supports the first syntax in its `configure_file()`
function. To work around that we instead manually replace placeholders
via string operations, which is a hassle and removes safeguards that
CMake has to verify that we didn't forget to replace any placeholders.
Besides that, other build systems like Meson also support the CMake
syntax.

Unify our codebase to consistently use the syntax supported by such
build systems.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Require Perl 5.26.0</title>
<updated>2024-10-23T20:16:36Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2024-10-23T00:45:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=702d8c1f3b5377a64670b0f22add157b0bfc33dd'/>
<id>urn:sha1:702d8c1f3b5377a64670b0f22add157b0bfc33dd</id>
<content type='text'>
Our platform support policy states that we require "versions of
dependencies which are generally accepted as stable and supportable,
e.g., in line with the version used by other long-term-support
distributions".  Of Debian, Ubuntu, RHEL, and SLES, the four most common
distributions that provide LTS versions, the version with mainstream
long-term security support with the oldest Perl is 5.26.0 in SLES 15.6.

This is a major upgrade, since Perl 5.8.1, according to the Perl
documentation, was released in September of 2003.  It brings a lot of
new features that we can choose to use, such as s///r to return the
modified string, the postderef functionality, and subroutine signatures,
although the latter was still considered experimental until 5.36.

This change was made with the following one-liner, which intentionally
excludes modifying the vendored modules we include to avoid conflicts:

    git grep -l 'use 5.008001' | grep -v 'LoadCPAN/' | xargs perl -pi -e 's/use 5.008001/require v5.26/'

Use require instead of use to avoid changing the behavior as the latter
enables features and the former does not.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
</feed>
