1
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.

【Jenkins初期設定】Gmailへのメール送信で「javax.mail.AuthenticationFailedException」が発生

Last updated at Posted at 2021-04-30

※ 個人blogに投稿した記事(投稿日:2019/6/7)をQiitaに移行しました

前回の投稿でJenkinsのコンテナは起動でき、初期設定を進めています。

「Jenkinsの管理 > システムの設定 > トークンリファレンス > E-mail通知」にて、
Gmailのアカウントを設定してメール送信を確認するのですが、以下のエラーが発生。  

javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8  https://support.google.com/mail/?p=BadCredentials 104sm807qtc.36 - gsmtp

この原因はエラー内のURLを確認すればすぐに解ることなのですが、
Googleアカウントがデフォルトでは不正なアプリからのログインを許可していないためです。

安全性の低いアプリと Google アカウント

アカウントの設定で「安全性の低いアプリのアクセス」をONにすると前述のエラーは発生せず、
Jenkinからのメールが受信できるようになります。
当然セキュリティ上非推奨の設定なので、あくまで一時的に許可するのがよいでしょう。

1
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
1
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?