2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

muttによるGMailの送受信のための設定

Last updated at Posted at 2021-11-07

基本的にこちらの記事の通りで動きます。

mkdir -p ~/.mutt/cache/headers
mkdir ~/.mutt/cache/bodies
touch ~/.mutt/certificates
touch ~/.mutt/muttrc

~/.mutt/muttrc を編集します。usernameをユーザー名に置き換えてください。

set from = "username@gmail.com"
set realname = "First Last"
# IMAP settings
set imap_user = "username@gmail.com"
set imap_pass = "<mailbox password>"
# SMTP settings
set smtp_url = "smtps://username@smtp.gmail.com"
set smtp_pass = "<mailbox password>"
# Remote Gmail folders
set folder = "imaps://imap.gmail.com/"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set record = "+[Gmail]/Sent Mail"
set trash = "+[Gmail]/Trash"

ここで、最大のハマりどころは、パスワードです。

はGmailの普段のパスワードではなく、アプリパスワードを設定します。

Googleアカウント > セキュリティ > Google へのログイン >「アプリパスワード」の生成が必要です。

これで便利にCUIからGメールを送信できるようになるはずです。
以上です。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?