質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
シェルスクリプト

シェルスクリプトは、UNIX系のOSもしくはコマンドラインインタプリタ向けに記述されたスクリプト。bash/zshといったシェルによって実行されるため、このように呼ばれています。バッチ処理などに使用されており、テキストファイルに書かれた命令を順に実行します。

Gmail

GmailとはGoogleによって提供されているウェブメールのサービスのことです。

コマンドライン

コマンドライン(別名:Command Line Interface)は、ユーザに命令の入力を促す(プロンプト)文字列の表示を行い、すべての操作をキーボードを用いて文字列を打ち込む事でプログラムを走らせるユーザインターフェースです。

Q&A

解決済

2回答

2144閲覧

5/22以降、linuxシェルからmailやmutt等のコマンドでgmail宛に送信する方法について

USDI

総合スコア10

シェルスクリプト

シェルスクリプトは、UNIX系のOSもしくはコマンドラインインタプリタ向けに記述されたスクリプト。bash/zshといったシェルによって実行されるため、このように呼ばれています。バッチ処理などに使用されており、テキストファイルに書かれた命令を順に実行します。

Gmail

GmailとはGoogleによって提供されているウェブメールのサービスのことです。

コマンドライン

コマンドライン(別名:Command Line Interface)は、ユーザに命令の入力を促す(プロンプト)文字列の表示を行い、すべての操作をキーボードを用いて文字列を打ち込む事でプログラムを走らせるユーザインターフェースです。

0グッド

0クリップ

投稿2022/05/26 12:09

現在、CentOS及びubuntuのサーバにて、
サーバ監視の各シェルから処理結果内容をmailコマンドやmuttコマンドで
gmailにてユーザ/pass認証にて送信しておりますが、
2022/05/30からgoogle社にて第3パーティのアプリ(シェルがこれに相当)に対する制限を行なうようで
これまでのようにシェルからメールを送信してgmailで受信し内容を確認したいため、
何をどのような手順で対応すべきかご教授いただきたい。
googleの公式サイトの記載内容では理解できませんでした。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

maisumakun

2022/05/26 12:37

> 2022/05/30からgoogle社にて第3パーティのアプリ(シェルがこれに相当)に対する制限を行なうようで 詳細の書かれたURLなどはありますか?
USDI

2022/05/26 12:50

5/30の一ヶ月前に相当する4/29に件名:You may lose access to some of your third-party appsが googleから送信されました。内容は以下の通りです。 On May 30, you may lose access to apps that are using less secure sign-in technology To help keep your account secure, Google will no longer support the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password. Instead, you’ll need to sign in using Sign in with Google or other more secure technologies, like OAuth 2.0. Learn moreWhat do you need to do? An app or device which uses Simple Mail Transfer Protocol (SMTP) to send emails using your Google Account has less secure access to your Gmail. This might be an older device, like a printer or scanner. To continue using your Google Account with this app or device: App - Remove your Google Account from the app or device and sign in again using Sign in with Google Device - Change your device’s settings so you’re using more secure sign-in technology learn moreリンク先では以下のような記載内容でした。 Less secure apps & your Google Account To help keep your account secure, starting May 30, 2022, ​​Google will no longer support the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password. Please note this deadline does not apply to Google Workspace or Google Cloud Identity customers. The enforcement date for these customers will be announced on the Workspace blog at a later date. For more information, please continue reading. Special Note on Apple Device Sign-Ins. Users who have not recently signed into their Google Account using only username and password will be able to only make new sign in attempts using the Google account type starting from February 28, 2022. Existing users may continue to sign into their Google Account using their username and password until May 30, 2022. If an app or site doesn’t meet our security standards, Google might block anyone who’s trying to sign in to your account from it. Less secure apps can make it easier for hackers to get in to your account, so blocking sign-ins from these apps helps keep your account safe. If "Less secure app access" is on for your account If "Less secure app access" is off for your account How more secure apps help protect your account When a third-party app meets our security standards, you can: See what level of account access you’re giving the app before you connect your Google Account Let the app access only a relevant part of your Google Account, like your email or calendar Connect your Google Account to the app without exposing your password Disconnect your Google Account from the app at any time Learn more about third-party apps with access to your account. Fix problems Can’t use an app with my Google Account Update your app or operating system Use more secure apps Use an App Password An App password is a 16-digit passcode that gives a non-Google app or device permission to access your Google Account. Learn more about how to sign in using App Passwords. If you're still having trouble accessing your third-party app or device not through "Less secure apps access," reach out using this form.
USDI

2022/05/26 12:54

送信先のgoogleユーザのapp password設定画面があるどうか調べた場合、app password入力欄が見当たらないため、この場で確認させていただいております。
USDI

2022/05/26 12:56

件名の訂正: 誤 5/22 ー> 正 5/30
bsdfan

2022/05/26 13:56

アプリパスワードは、2段階認証を有効にしていないと、使えなかったと思います。
maisumakun

2022/05/26 13:57

> 送信先のgoogleユーザのapp password設定画面があるどうか調べた場合、app password入力欄が見当たらないため https://myaccount.google.com/security に「アプリパスワード」がありませんか?
USDI

2022/05/26 16:11

bsdfanさんのご指摘通り、2段階認証を有効にすればアプリパスワードの設定が表示されました。 その後、アプリパスワードをlinuxという仮想デバイスを定義してパスワードを生成して そのパスワードを用いて、mailコマンドと連動するssmtpの設定ファイルに反映して動作検証を行ない、 送信できることは確認できたのですが、その設定が5/30以降も利用できるか不明ですが 一旦これで観察状態とし,その後も私自身も調査を継続しながら皆様からのご意見をお伺いさせていただきます。
guest

回答2

0

SMTP はそのまま SMTP-Auth で送信できそうに読み取れます。
IMAP は OAuth が必須になります。mutt は OAuth に対応しています。

投稿2022/05/26 15:39

TaichiYanagiya

総合スコア12146

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

自己解決

bsdfanさんのご指摘通り、2段階認証を有効にすればアプリパスワードの設定が表示されました。
その後、アプリパスワードをlinuxという仮想デバイスを定義してパスワードを生成して
そのパスワードを用いて、mailコマンドと連動するssmtp等の設定ファイルに反映して動作検証を行ない、
送信できることは確認。5/31未明時点にてメール送受信されていることを確認したため解決したと判断

投稿2022/05/30 19:34

USDI

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問