From 1e21123d906b6ca137f1b80f7c667e266a1c82bf Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 22 Apr 2022 22:19:28 -0700 Subject: [PATCH] mention how to put it in the wallet --- content/posts/oh-no-git-send-email/index.md | 24 +++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/content/posts/oh-no-git-send-email/index.md b/content/posts/oh-no-git-send-email/index.md index 06bbbdd..4aa4497 100644 --- a/content/posts/oh-no-git-send-email/index.md +++ b/content/posts/oh-no-git-send-email/index.md @@ -29,6 +29,26 @@ implementation being broken. I ended up needing to use a separate *Mail Transfer Agent* (SMTP-speak for "SMTP client") and plumb it into git. For this, I used `msmtp`. +First, store your SMTP email password in the system keyring: + +``` +# on KDE +$ kwallet-query -w user@example.com kdewallet -f mail + +# on GNOME/other things supporting freedesktop secrets +$ secret-tool store --label=msmtp host smtp.migadu.com service smtp user myuser@example.com + +# on macOS +$ security add-internet-password -s smtp.migadu.com -r smtp -a myuser@example.com -w +``` + +I use KDE, so this setup uses the KDE wallet to store the password. If you use +macOS, GNOME or the future version of KDE that supports the freedesktop secrets +system, **remove the `passwordeval` line from the sample config here** as +`msmtp` can get the password from your keyring by itself. + +Then write a `msmtp` configuration file: + {% codesample(desc="`~/.msmtprc`") %} # Used to identify which account you are using in the msmtp command line account myaccountname @@ -51,8 +71,8 @@ from listsubscriber@example.com # Use kwallet-query to get the password because kwallet does not support the # freedesktop secrets protocol -# "mail" is the folder on the left hand side of the "Wallet Manager" -# and user@example.com is the name of the item +# NOTE!! If you are on macOS or GNOME or the future version of KDE that +# supports freedesktop secrets, delete the following line! passwordeval kwallet-query -r user@example.com kdewallet -f mail {% end %}