Movatterモバイル変換


[0]ホーム

URL:


Git
English ▾Topics ▾ Latest version ▾git-send-email last updated in 2.52.0

NAME

git-send-email - Send a collection of patches as emails

SYNOPSIS

git send-email [<options>] (<file>|<directory>)…​git send-email [<options>] <format-patch-options>git send-email --dump-aliasesgit send-email --translate-aliases

DESCRIPTION

Takes the patches given on the command line and emails them out.Patches can be specified as files, directories (which will send allfiles in the directory), or directly as a revision list. In thelast case, any format accepted bygit-format-patch[1] canbe passed togitsend-email, as well as options understood bygit-format-patch[1].

The header of the email is configurable via command-line options. If notspecified on the command line, the user will be prompted with a ReadLineenabled interface to provide the necessary information.

There are two formats accepted for patch files:

  1. mbox format files

    This is whatgit-format-patch[1] generates. Most headers and MIMEformatting are ignored.

  2. The original format used by Greg Kroah-Hartman’ssend_lots_of_email.plscript

    This format expects the first line of the file to contain theCc: valueand theSubject: of the message as the second line.

OPTIONS

Composing

--annotate

Review and edit each patch you’re about to send. Default is the valueofsendemail.annotate. See the CONFIGURATION section forsendemail.multiEdit.

--bcc=<address>,…​

Specify aBcc: value for each email. Default is the value ofsendemail.bcc.

This option may be specified multiple times.

--cc=<address>,…​

Specify a startingCc: value for each email.Default is the value ofsendemail.cc.

This option may be specified multiple times.

--compose

Invoke a text editor (see GIT_EDITOR ingit-var[1])to edit an introductory message for the patch series.

When--compose is used,gitsend-email will use theFrom,To,Cc,Bcc,Subject,Reply-To, andIn-Reply-To headers specified in themessage. If the body of the message (what you type after the headers and ablank line) only contains blank (orGit: prefixed) lines, the summary won’t besent, but the headers mentioned above will be used unless they areremoved.

MissingFrom orIn-Reply-To headers will be prompted for.

See the CONFIGURATION section forsendemail.multiEdit.

--from=<address>

Specify the sender of the emails. If not specified on the command line,the value of thesendemail.from configuration option is used. Ifneither the command-line option norsendemail.from are set, then theuser will be prompted for the value. The default for the prompt will bethe value ofGIT_AUTHOR_IDENT, orGIT_COMMITTER_IDENT if that is notset, as returned bygitvar-l.

--reply-to=<address>

Specify the address where replies from recipients should go to.Use this if replies to messages should go to another address than whatis specified with the--from parameter.

--in-reply-to=<identifier>

Make the first mail (or all the mails with--no-thread) appear as areply to the given Message-ID, which avoids breaking threads toprovide a new patch series.The second and subsequent emails will be sent as replies according tothe--[no-]chain-reply-to setting.

So for example when--thread and--no-chain-reply-to are specified, thesecond and subsequent patches will be replies to the first one like in theillustration below where[PATCHv20/3] is in reply to[PATCH0/2]:

[PATCH 0/2] Here is what I did...  [PATCH 1/2] Clean up and tests  [PATCH 2/2] Implementation  [PATCH v2 0/3] Here is a reroll    [PATCH v2 1/3] Clean up    [PATCH v2 2/3] New tests    [PATCH v2 3/3] Implementation

Only necessary if--compose is also set. If--composeis not set, this will be prompted for.

--outlook-id-fix
--no-outlook-id-fix

Microsoft Outlook SMTP servers discard the Message-ID sent via email andassign a new random Message-ID, thus breaking threads.

With--outlook-id-fix,gitsend-email uses a mechanism specific toOutlook servers to learn the Message-ID the server assigned to fix thethreading. Use it only when you know that the server reports therewritten Message-ID the same way as Outlook servers do.

Without this option specified, the fix is done by default when talkingtosmtp.office365.com orsmtp-mail.outlook.com. Use--no-outlook-id-fix to disable even when talking to these two servers.

--subject=<string>

Specify the initial subject of the email thread.Only necessary if--compose is also set. If--composeis not set, this will be prompted for.

--to=<address>,…​

Specify the primary recipient of the emails generated. Generally, thiswill be the upstream maintainer of the project involved. Default is thevalue of thesendemail.to configuration value; if that is unspecified,and--to-cmd is not specified, this will be prompted for.

This option may be specified multiple times.

--8bit-encoding=<encoding>

When encountering a non-ASCII message or subject that does notdeclare its encoding, add headers/quoting to indicate it isencoded in <encoding>. Default is the value of thesendemail.assume8bitEncoding; if that is unspecified, thiswill be prompted for if any non-ASCII files are encountered.

Note that no attempts whatsoever are made to validate the encoding.

--compose-encoding=<encoding>

Specify encoding of compose message. Default is the value of thesendemail.composeEncoding; if that is unspecified, UTF-8 is assumed.

--transfer-encoding=(7bit|8bit|quoted-printable|base64|auto)

Specify the transfer encoding to be used to send the message over SMTP.7bit will fail upon encountering a non-ASCII message.quoted-printablecan be useful when the repository contains files that contain carriagereturns, but makes the raw patch email file (as saved from an MUA) muchharder to inspect manually.base64 is even more fool proof, but alsoeven more opaque.auto will use8bit when possible, andquoted-printable otherwise.

Default is the value of thesendemail.transferEncoding configurationvalue; if that is unspecified, default toauto.

--xmailer
--no-xmailer

Add (or prevent adding) theX-Mailer: header. By default,the header is added, but it can be turned off by setting thesendemail.xmailer configuration variable tofalse.

Sending

--envelope-sender=<address>

Specify the envelope sender used to send the emails.This is useful if your default address is not the address that issubscribed to a list. In order to use theFrom address, set thevalue toauto. If you use thesendmail binary, you must havesuitable privileges for the-f parameter. Default is the value of thesendemail.envelopeSender configuration variable; if that isunspecified, choosing the envelope sender is left to your MTA.

--sendmail-cmd=<command>

Specify a command to run to send the email. The command shouldbe sendmail-like; specifically, it must support the-i option.The command will be executed in the shell if necessary. Defaultis the value ofsendemail.sendmailCmd. If unspecified, and if--smtp-server is also unspecified,gitsend-email will searchforsendmail in/usr/sbin,/usr/lib and$PATH.

--smtp-encryption=<encryption>

Specify in what way encrypting begins for the SMTP connection.Valid values aressl andtls. Any other value reverts to plain(unencrypted) SMTP, which defaults to port 25.Despite the names, both values will use the same newer version of TLS,but for historic reasons have these names.ssl refers to "implicit"encryption (sometimes called SMTPS), that uses port 465 by default.tls refers to "explicit" encryption (often known as STARTTLS),that uses port 25 by default. Other ports might be used by the SMTPserver, which are not the default. Commonly found alternative port fortls and unencrypted is 587. You need to check your provider’sdocumentation or your server configuration to make surefor your own case. Default is the value ofsendemail.smtpEncryption.

--smtp-domain=<FQDN>

Specifies the Fully Qualified Domain Name (FQDN) used in theHELO/EHLO command to the SMTP server. Some servers require theFQDN to match your IP address. If not set,gitsend-email attemptsto determine your FQDN automatically. Default is the value ofsendemail.smtpDomain.

--smtp-auth=<mechanisms>

Whitespace-separated list of allowed SMTP-AUTH mechanisms. This settingforces using only the listed mechanisms. Example:

$ git send-email --smtp-auth="PLAIN LOGIN GSSAPI" ...

If at least one of the specified mechanisms matches the ones advertised by theSMTP server and if it is supported by the utilized SASL library, the mechanismis used for authentication. If neithersendemail.smtpAuth nor--smtp-authis specified, all mechanisms supported by the SASL library can be used. Thespecial valuenone maybe specified to completely disable authenticationindependently of--smtp-user.

--smtp-pass[=<password>]

Password for SMTP-AUTH. The argument is optional: If noargument is specified, then the empty string is used asthe password. Default is the value ofsendemail.smtpPass,however--smtp-pass always overrides this value.

Furthermore, passwords need not be specified in configuration filesor on the command line. If a username has been specified (with--smtp-user or asendemail.smtpUser), but no password has beenspecified (with--smtp-pass orsendemail.smtpPass), thena password is obtained usinggit-credential[1].

--no-smtp-auth

Disable SMTP authentication. Short hand for--smtp-auth=none.

--smtp-server=<host>

If set, specifies the outgoing SMTP server to use (e.g.smtp.example.com or a raw IP address). If unspecified, and if--sendmail-cmd is also unspecified, the default is to searchforsendmail in/usr/sbin,/usr/lib and$PATH if such aprogram is available, falling back tolocalhost otherwise.

For backward compatibility, this option can also specify a full pathnameof a sendmail-like program instead; the program must support the-ioption. This method does not support passing arguments or using plaincommand names. For those use cases, consider using--sendmail-cmdinstead.

--smtp-server-port=<port>

Specifies a port different from the default port (SMTPservers typically listen to smtp port 25, but may also listen tosubmission port 587, or the common SSL smtp port 465);symbolic port names (e.g.submission instead of 587)are also accepted. The port can also be set with thesendemail.smtpServerPort configuration variable.

--smtp-server-option=<option>

If set, specifies the outgoing SMTP server option to use.Default value can be specified by thesendemail.smtpServerOptionconfiguration option.

The--smtp-server-option option must be repeated for each option you wantto pass to the server. Likewise, different lines in the configuration filesmust be used for each option.

--smtp-ssl

Legacy alias for--smtp-encryptionssl.

--smtp-ssl-cert-path

Path to a store of trusted CA certificates for SMTP SSL/TLScertificate validation (either a directory that has been processedbyc_rehash, or a single file containing one or more PEM formatcertificates concatenated together: see the description of the-CAfile<file> and the-CApath<dir> options ofhttps://docs.openssl.org/master/man1/openssl-verify/[OpenSSL’s verify(1) manual page] for more information on these).Set it to an empty string to disable certificate verification.Defaults to the value of thesendemail.smtpSSLCertPath configurationvariable, if set, or the backing SSL library’s compiled-in defaultotherwise (which should be the best choice on most platforms).

--smtp-user=<user>

Username for SMTP-AUTH. Default is the value ofsendemail.smtpUser;if a username is not specified (with--smtp-user orsendemail.smtpUser),then authentication is not attempted.

--smtp-debug=(0|1)

Enable (1) or disable (0) debug output. If enabled, SMTPcommands and replies will be printed. Useful to debug TLSconnection and authentication problems.

--imap-sent-folder=<folder>

Some email providers (e.g. iCloud) do not send a copy of the emails sentusing SMTP to theSent folder or similar in your mailbox. Use this optionto usegitimap-send to send a copy of the emails to the folder specifiedusing this option. You can rungitimap-send--list to get a list ofvalid folder names, including the correct name of theSent folder inyour mailbox. You can also use this option to send emails to a dedicatedIMAP folder of your choice.

This feature requires setting upgitimap-send. Seegit-imap-send[1]for instructions.

--use-imap-only
--no-use-imap-only

If this is set, all emails will only be copied to the IMAP folder specifiedwith--imap-sent-folder orsendemail.imapSentFolder and will not be sentto the recipients. Useful if you just want to create a draft of the emailsand use another email client to send them.If disabled with--no-use-imap-only, the emails will be sent like usual.Disabled by default, but thesendemail.useImapOnly configurationvariable can be used to enable it.

This feature requires setting upgitimap-send. Seegit-imap-send[1]for instructions.

--batch-size=<num>

Some email servers (e.g.smtp.163.com) limit the number of emails to besent per session (connection) and this will lead to a failure whensending many messages. With this option, send-email will disconnect aftersending<num> messages and wait for a few seconds(see--relogin-delay) and reconnect, to work around such a limit.You may want to use some form of credential helper to avoid having toretype your password every time this happens. Defaults to thesendemail.smtpBatchSize configuration variable.

--relogin-delay=<int>

Waiting<int> seconds before reconnecting to SMTP server. Used togetherwith--batch-size option. Defaults to thesendemail.smtpReloginDelayconfiguration variable.

Automating

--no-to
--no-cc
--no-bcc

Clears any list ofTo:,Cc:,Bcc: addresses previouslyset via config.

--no-identity

Clears the previously read value ofsendemail.identity setvia config, if any.

--to-cmd=<command>

Specify a command to execute once per patch file whichshould generate patch file specificTo: entries.Output of this command must be single email address per line.Default is the value ofsendemail.toCmd configuration value.

--cc-cmd=<command>

Specify a command to execute once per patch file whichshould generate patch file specificCc: entries.Output of this command must be single email address per line.Default is the value ofsendemail.ccCmd configuration value.

--header-cmd=<command>

Specify a command that is executed once per outgoing messageand output RFC 2822 style header lines to be inserted intothem. When thesendemail.headerCmd configuration variable isset, its value is always used. When--header-cmd is providedat the command line, its value takes precedence over thesendemail.headerCmd configuration variable.

--no-header-cmd

Disable any header command in use.

--chain-reply-to
--no-chain-reply-to

If this is set, each email will be sent as a reply to the previousemail sent. If disabled with--no-chain-reply-to, all emails afterthe first will be sent as replies to the first email sent. When usingthis, it is recommended that the first file given be an overview of theentire patch series. Disabled by default, but thesendemail.chainReplyToconfiguration variable can be used to enable it.

--identity=<identity>

A configuration identity. When given, causes values in thesendemail.<identity> subsection to take precedence overvalues in thesendemail section. The default identity isthe value ofsendemail.identity.

--signed-off-by-cc
--no-signed-off-by-cc

If this is set, add emails found in theSigned-off-by trailer orCc:lines to the cc list. Default is the value ofsendemail.signedOffByCcconfiguration value; if that is unspecified, default to--signed-off-by-cc.

--cc-cover
--no-cc-cover

If this is set, emails found inCc: headers in the first patch ofthe series (typically the cover letter) are added to the cc listfor each email set. Default is the value ofsendemail.ccCoverconfiguration value; if that is unspecified, default to--no-cc-cover.

--to-cover
--no-to-cover

If this is set, emails found inTo: headers in the first patch ofthe series (typically the cover letter) are added to the to listfor each email set. Default is the value ofsendemail.toCoverconfiguration value; if that is unspecified, default to--no-to-cover.

--suppress-cc=<category>

Specify an additional category of recipients to suppress theauto-cc of:

  • author will avoid including the patch author.

  • self will avoid including the sender.

  • cc will avoid including anyone mentioned in Cc lines in the patch headerexcept for self (useself for that).

  • bodycc will avoid including anyone mentioned in Cc lines in thepatch body (commit message) except for self (useself for that).

  • sob will avoid including anyone mentioned in the Signed-off-by trailers exceptfor self (useself for that).

  • misc-by will avoid including anyone mentioned in Acked-by,Reviewed-by, Tested-by and other "-by" lines in the patch body,except Signed-off-by (usesob for that).

  • cccmd will avoid running the --cc-cmd.

  • body is equivalent tosob +bodycc +misc-by.

  • all will suppress all auto cc values.

Default is the value ofsendemail.suppressCc configuration value; ifthat is unspecified, default toself if--suppress-from isspecified, as well asbody if--no-signed-off-cc is specified.

--suppress-from
--no-suppress-from

If this is set, do not add theFrom: address to theCc: list.Default is the value ofsendemail.suppressFrom configurationvalue; if that is unspecified, default to--no-suppress-from.

--thread
--no-thread

If this is set, theIn-Reply-To andReferences headers will beadded to each email sent. Whether each mail refers to theprevious email (deep threading pergitformat-patchwording) or to the first email (shallow threading) isgoverned by--[no-]chain-reply-to.

If disabled with--no-thread, those headers will not be added(unless specified with--in-reply-to). Default is the value of thesendemail.thread configuration value; if that is unspecified,default to--thread.

It is up to the user to ensure that no In-Reply-To header alreadyexists whengitsend-email is asked to add it (especially note thatgitformat-patch can be configured to do the threading itself).Failure to do so may not produce the expected result in therecipient’s MUA.

--mailmap
--no-mailmap

Use the mailmap file (seegitmailmap[5]) to map alladdresses to their canonical real name and email address. Additionalmailmap data specific togitsend-email may be provided using thesendemail.mailmap.file orsendemail.mailmap.blob configurationvalues. Defaults tosendemail.mailmap.

Administering

--confirm=<mode>

Confirm just before sending:

  • always will always confirm before sending.

  • never will never confirm before sending.

  • cc will confirm before sending when send-email has automaticallyadded addresses from the patch to the Cc list.

  • compose will confirm before sending the first message when using --compose.

  • auto is equivalent tocc +compose.

Default is the value ofsendemail.confirm configuration value; if thatis unspecified, default toauto unless any of the suppress optionshave been specified, in which case default tocompose.

--dry-run

Do everything except actually send the emails.

--format-patch
--no-format-patch

When an argument may be understood either as a reference or as a file name,choose to understand it as a format-patch argument (--format-patch)or as a file name (--no-format-patch). By default, when such a conflictoccurs,gitsend-email will fail.

--quiet

Makegitsend-email less verbose. One line per email should beall that is output.

--validate
--no-validate

Perform sanity checks on patches.Currently, validation means the following:

  • Invoke the sendemail-validate hook if present (seegithooks[5]).

  • Warn of patches that contain lines longer than998 characters unless a suitable transfer encoding(auto,base64, orquoted-printable) is used;this is due to SMTP limits as described byhttps://www.ietf.org/rfc/rfc5322.txt.

Default is the value ofsendemail.validate; if this is not set,default to--validate.

--force

Send emails even if safety checks would prevent it.

Information

--dump-aliases

Instead of the normal operation, dump the shorthand alias names fromthe configured alias file(s), one per line in alphabetical order. Notethat this only includes the alias name and not its expanded email addresses.Seesendemail.aliasesFile for more information about aliases.

--translate-aliases

Instead of the normal operation, read from standard input andinterpret each line as an email alias. Translate it according to theconfigured alias file(s). Output each translated name and emailaddress to standard output, one per line. Seesendemail.aliasFilefor more information about aliases.

CONFIGURATION

Everything below this line in this section is selectively includedfrom thegit-config[1] documentation. The content is the sameas what’s found there:

sendemail.identity

A configuration identity. When given, causes values in thesendemail.<identity> subsection to take precedence overvalues in thesendemail section. The default identity isthe value ofsendemail.identity.

sendemail.smtpEncryption

Seegit-send-email[1] for description. Note that thissetting is not subject to theidentity mechanism.

sendemail.smtpSSLCertPath

Path to ca-certificates (either a directory or a single file).Set it to an empty string to disable certificate verification.

sendemail.<identity>.*

Identity-specific versions of thesendemail.* parametersfound below, taking precedence over those when thisidentity is selected, through either the command-line orsendemail.identity.

sendemail.multiEdit

Iftrue (default), a single editor instance will be spawned to editfiles you have to edit (patches when--annotate is used, and thesummary when--compose is used). Iffalse, files will be edited oneafter the other, spawning a new editor each time.

sendemail.confirm

Sets the default for whether to confirm before sending. Must beone ofalways,never,cc,compose, orauto. See--confirmin thegit-send-email[1] documentation for the meaning of thesevalues.

sendemail.mailmap

Iftrue, makesgit-send-email[1] assume--mailmap,otherwise assume--no-mailmap.False by default.

sendemail.mailmap.file

The location of agit-send-email[1] specific augmentingmailmap file. The default mailmap andmailmap.file are loadedfirst. Thus, entries in this file take precedence over entries inthe default mailmap locations. Seegitmailmap[5].

sendemail.mailmap.blob

Likesendemail.mailmap.file, but consider the value as a referenceto a blob in the repository. Entries insendemail.mailmap.filetake precedence over entries here. Seegitmailmap[5].

sendemail.aliasesFile

To avoid typing long email addresses, point this to one or moreemail aliases files. You must also supplysendemail.aliasFileType.

sendemail.aliasFileType

Format of the file(s) specified in sendemail.aliasesFile. Must beone ofmutt,mailrc,pine,elm,gnus, orsendmail.

What an alias file in each format looks like can be found inthe documentation of the email program of the same name. Thedifferences and limitations from the standard formats aredescribed below:

sendmail
  • Quoted aliases and quoted addresses are not supported: lines thatcontain a" symbol are ignored.

  • Redirection to a file (/path/name) or pipe (|command) is notsupported.

  • File inclusion (:include:/path/name) is not supported.

  • Warnings are printed on the standard error output for anyexplicitly unsupported constructs, and any other lines that are notrecognized by the parser.

sendemail.annotate
sendemail.bcc
sendemail.cc
sendemail.ccCmd
sendemail.chainReplyTo
sendemail.envelopeSender
sendemail.from
sendemail.headerCmd
sendemail.signedOffByCc
sendemail.smtpPass
sendemail.suppressCc
sendemail.suppressFrom
sendemail.to
sendemail.toCmd
sendemail.smtpDomain
sendemail.smtpServer
sendemail.smtpServerPort
sendemail.smtpServerOption
sendemail.smtpUser
sendemail.imapSentFolder
sendemail.useImapOnly
sendemail.thread
sendemail.transferEncoding
sendemail.validate
sendemail.xmailer

These configuration variables all provide a default forgit-send-email[1] command-line options. See itsdocumentation for details.

sendemail.outlookidfix

Iftrue, makesgit-send-email[1] assume--outlook-id-fix,and iffalse assume--no-outlook-id-fix. If not specified, it willbehave the same way as if--outlook-id-fix is not specified.

sendemail.signedOffCc (deprecated)

Deprecated alias forsendemail.signedOffByCc.

sendemail.smtpBatchSize

Number of messages to be sent per connection, after that a reloginwill happen. If the value is0 or undefined, send all messages inone connection.See also the--batch-size option ofgit-send-email[1].

sendemail.smtpReloginDelay

Seconds to wait before reconnecting to the smtp server.See also the--relogin-delay option ofgit-send-email[1].

sendemail.forbidSendmailVariables

To avoid common misconfiguration mistakes,git-send-email[1]will abort with a warning if any configuration options forsendmailexist. Set this variable to bypass the check.

EXAMPLES OF SMTP SERVERS

Use Gmail as the SMTP Server

To usegitsend-email to send your patches through the Gmail SMTP server,edit~/.gitconfig to specify your account settings:

[sendemail]smtpEncryption = sslsmtpServer = smtp.gmail.comsmtpUser = yourname@gmail.comsmtpServerPort = 465

Gmail does not allow using your regular password forgitsend-email.If you have multi-factor authentication set up on your Gmail account, you cangenerate an app-specific password for use withgitsend-email. Visithttps://security.google.com/settings/security/apppasswords to create it.

Alternatively, instead of using an app-specific password, you can useOAuth2.0 authentication with Gmail. OAuth2.0 is more secure thanapp-specific passwords, and works regardless of whether you have multi-factorauthentication set up.OAUTHBEARER andXOAUTH2 are common mechanisms usedfor this type of authentication. Gmail supports both of them. As an example,if you want to useOAUTHBEARER, edit your~/.gitconfig file and addsmtpAuth=OAUTHBEARER to your account settings:

[sendemail]smtpEncryption = sslsmtpServer = smtp.gmail.comsmtpUser = yourname@gmail.comsmtpServerPort = 465smtpAuth = OAUTHBEARER

Another alternative is using a tool developed by Google known assendgmailto send emails usinggitsend-email.

Use Microsoft Outlook as the SMTP Server

Unlike Gmail, Microsoft Outlook no longer supports app-specific passwords.Therefore, OAuth2.0 authentication must be used for Outlook. Also, it onlysupportsXOAUTH2 authentication mechanism.

Edit~/.gitconfig to specify your account settings for Outlook and use itsSMTP server withgitsend-email:

[sendemail]smtpEncryption = tlssmtpServer = smtp.office365.comsmtpUser = yourname@outlook.comsmtpServerPort = 587smtpAuth = XOAUTH2

SENDING PATCHES

Once your commits are ready to be sent to the mailing list, run thefollowing commands:

$ git format-patch --cover-letter -M origin/master -o outgoing/$ edit outgoing/0000-*$ git send-email outgoing/*

The first time you run it, you will be prompted for your credentials. Enter theapp-specific or your regular password as appropriate.

If you have a credential helper configured (seegit-credential[1]), thepassword will be saved in the credential store so you won’t have to type it thenext time.

If you are using OAuth2.0 authentication, you need to use an access token inplace of a password when prompted. Various OAuth2.0 token generators areavailable online. Community maintained credential helpers are also available:

You can also seegitcredentials[7] for more OAuth based authenticationhelpers.

Proton Mail does not provide an SMTP server to send emails. If you are a paidcustomer of Proton Mail, you can useProton Mail Bridgeofficially provided by Proton Mail to create a local SMTP server for sendingemails. For both free and paid users, community maintained projects likegit-protonmail can beused.

Note: the following core Perl modules that may be installed with yourdistribution of Perl are required:

These additional Perl modules are also required:

Exploiting thesendmailCmd option ofgitsend-email

Apart from sending emails via an SMTP server,gitsend-email can also sendemails through any application that supports sendmail-like commands. You canread documentation of--sendmail-cmd=<command> above for more information.This ability can be very useful if you want to use another application as anSMTP client forgitsend-email, or if your email provider uses proprietaryAPIs instead of SMTP to send emails.

As an example, lets see how to configuremsmtp, apopular SMTP client found in many Linux distributions. Edit~/.gitconfigto instructgit-send-email to use it for sending emails.

[sendemail]sendmailCmd = /usr/bin/msmtp # Change this to the path where msmtp is installed

Links of a few such community maintained helpers are:

  • msmtp(popular SMTP client with many features, available for Linux and macOS)

  • git-protonmail(cross platform client that can send emails using the ProtonMail API)

  • git-msgraph(cross platform client that can send emails using the Microsoft Graph API)

SEE ALSO

GIT

Part of thegit[1] suite


[8]ページ先頭

©2009-2025 Movatter.jp