SYNOPSIS

'git imap-send' [-v] [-q] [--[no-]curl] [(--folder|-f) <folder>]
'git imap-send' --list

DESCRIPTION

This command uploads a mailbox generated with git format-patch into an IMAP drafts folder. This allows patches to be sent as other email is when using mail clients that cannot read mailbox files directly. The command also works with any general mailbox in which emails have the fields From, Date, and Subject in that order.

一般的な使用法は以下のようになります:

$ git format-patch --signoff --stdout --attach origin | git imap-send

OPTIONS

-v
--verbose

にぎやかにしろや。

-q
--quiet

静かにしろや。

-f <folder>
--folder=<folder>

Specify the folder in which the emails have to saved. For example: --folder=[Gmail]/Drafts or -f INBOX/Drafts.

--curl

トンネリングしない限り、libcurl を使用してIMAPサーバーと通信します。Gitが USE_CURL_FOR_IMAP_SEND オプションを設定せずにビルドされた場合は無視されます。

--no-curl

libcurl を使用する代わりに、git独自のIMAPルーチンを使用してIMAPサーバーと通信します。Gitが NO_OPENSSL オプションを設定してビルドされた場合は無視されます。

--list

Run the IMAP LIST command to output a list of all the folders present.

CONFIGURATION

このツールを使用するには、 imap.folder と、 imap.tunnel または imap.host のいずれかを、適切な値に設定する必要があります。

このセクションのこの行より上にあるものはすべて、 git-config(1) ドキュメントには含まれていません。 以下の内容に関しては、git-config(1) ドキュメント にあるものと同一です。

imap.folder

メールを投入するフォルダーで、 通常は下書き(Drafts)フォルダーです。 例えば: INBOX.Drafts, INBOX/Drafts, [Gmail]/Drafts です。 IMAP で操作するフォルダーは必ず指定する必要があります。 この設定変数の値は、 --folder オプションが指定されていない場合のフォールバックのデフォルト値として使用されます。

imap.tunnel

サーバーへ直接ネットワーク接続する代わりに、 コマンドがパイプされるIMAPサーバーへのトンネルを設定するために使用されるコマンド。 imap.host が設定されていない場合に必須です。

imap.host

サーバーを識別するURL。 非セキュア接続には imap:// プレフィックスを使用し、セキュア接続には imaps:// プレフィックスを使用します。 imap.tunnel が設定されている場合は無視されますが、それ以外の場合は必須です。

imap.user

サーバーにログインするときに使用するユーザー名。

imap.pass

サーバーにログインするときに使用するパスワード。

imap.port

サーバー上で接続する整数のポート番号。 デフォルトは、 imap:// ホストの場合は143、 imaps:// ホストの場合は993です。 imap.tunnel が設定されている場合は無視されます。

imap.sslverify

SSL/TLS接続で使用されるサーバー証明書の検証を有効/無効にするブール値。デフォルトは true です。 imap.tunnel が設定されている場合は無視されます。

imap.preformattedHTML

パッチを送信するときにhtmlエンコーディングの使用を有効/無効にするブール値。 htmlでエンコードされたパッチは <pre> で囲まれ、コンテンツタイプは text/html になります。皮肉なことに、このオプションを有効にすると、Thunderbirdはパッチを plane/text の format=fixed メールとして送信します。デフォルトは false です。

imap.authMethod

IMAP サーバーとの認証に使用する認証方式を指定します。 Git が NO_CURL オプション付きでビルドされている場合、 または curl のバージョンが 7.34.0 未満の場合、 または git-imap-send を --no-curl オプション付きで実行している場合、 サポートされる方式は PLAINCRAM-MD5OAUTHBEARERXOAUTH2 のみです。 この設定がされていない場合、 git imap-send は基本的な IMAP 平文の LOGIN コマンド(the basic IMAP plaintext LOGIN command)を使用します。

GETTING A LIST OF AVAILABLE FOLDERS

In order to send an email to a specific folder, you need to know the correct name of intended folder in your mailbox. The names like "Junk", "Trash" etc. displayed by various email clients need not be the actual names of the folders stored in the mail server of your email provider.

In order to get the correct folder name to be used with git imap-send, you can run git imap-send --list. This will display a list of valid folder names. An example of such an output when run on a Gmail account is:

* LIST (\HasNoChildren) "/" "INBOX"
* LIST (\HasChildren \Noselect) "/" "[Gmail]"
* LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
* LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
* LIST (\HasNoChildren \Important) "/" "[Gmail]/Important"
* LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
* LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
* LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
* LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash"

Here, you can observe that the correct name for the "Junk" folder is [Gmail]/Spam and for the "Trash" folder is [Gmail]/Trash. Similar logic can be used to determine other folders as well.

EXAMPLES

トンネル(tunnel)モード使用:

[imap]
    folder = "INBOX.Drafts"
    tunnel = "ssh -q -C user@example.com /usr/bin/imapd ./Maildir 2> /dev/null"

直接(direct)モード使用:

[imap]
    folder = "INBOX.Drafts"
    host = imap://imap.example.com
    user = bob
    pass = p4ssw0rd

SSLで直接モードを使用:

[imap]
    folder = "INBOX.Drafts"
    host = imaps://imap.example.com
    user = bob
    pass = p4ssw0rd
    port = 123
    ; sslVerify = false
Note
接続の問題が、セットアップしようとしている(またはセットアップ済の)プライベートサーバー example.com で使用している証明書が正しく検証されていないことが原因であると思われる場合、トラブルシューティング中に sslVerify=false を使用することをお勧めします。

GmailのIMAPインターフェースの使用:

[imap]
    folder = "[Gmail]/Drafts"
    host = imaps://imap.gmail.com
    user = user@gmail.com
    port = 993

Gmail does not allow using your regular password for git imap-send. If you have multi-factor authentication set up on your Gmail account, you can generate an app-specific password for use with git imap-send. Visit https://security.google.com/settings/security/apppasswords to create it. Alternatively, use OAuth2.0 authentication as described below.

Note
You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error that the "Folder doesn’t exist". You can also run git imap-send --list to get a list of available folders.
Note
Gmailアカウントが英語以外の言語に設定されている場合、 "Drafts" フォルダの名前がローカライズされます。

If you want to use OAuth2.0 based authentication, you can specify OAUTHBEARER or XOAUTH2 mechanism in your config. It is more secure than using app-specific passwords, and also does not enforce the need of having multi-factor authentication. You will have to use an OAuth2.0 access token in place of your password when using this authentication.

[imap]
    folder = "[Gmail]/Drafts"
    host = imaps://imap.gmail.com
    user = user@gmail.com
    port = 993
    authmethod = OAUTHBEARER

Using Outlook’s IMAP interface:

Unlike Gmail, Outlook only supports OAuth2.0 based authentication. Also, it supports only XOAUTH2 as the mechanism.

[imap]
    folder = "Drafts"
    host = imaps://outlook.office365.com
    user = user@outlook.com
    port = 993
    authmethod = XOAUTH2

コミットを送信する準備ができたら、以下のコマンドを実行します:

$ git format-patch --cover-letter -M --stdout origin/master | git imap-send

メールクライアントで行の折り返しを無効にしてください(GmailのWebインターフェイスは何があっても行を折り返すため、実際のIMAPクライアント(real IMAP client)を使用する必要があります)。

In case you are using OAuth2.0 authentication, it is easier to use credential helpers to generate tokens. Credential helpers suggested in git-send-email(1) can be used for git imap-send as well.

CAUTION

電子メールプログラムによって送信される電子メールメッセージがプロジェクトの基準を満たしていることを確認するのは、依然としてあなたの責任です。多くのプロジェクトは、パッチを電子メールに添付することを好みません。一部のメールエージェントは、パッチを失敗させる方法でパッチを変換します(たとえば、行を折り返し、format=flowed として送信します)。これをチェックしておかないと、怒りの炎があなたを襲います。

特に Thunderbird は問題があることが知られています。 Thunderbird のユーザーは下記Webページにアクセスして詳細を確認できます: https://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email

SEE ALSO

GIT

Part of the git(1) suite