面倒な割には手順が一箇所にまとまってないので、ここに記載します。 rpmのインストール テストと認証に必要なrpmを入れます: sudo yum install -y mailx cyrus-sasl-plain gmailの2段階認証の有効可 Sign in - Google Accounts gmailのアプリパスワードの作成 postfixからgoogleに対して認証する際、いつものgmailパスワードではなく、 postfix用の「アプリパスワード」なるものを作成します: Sign in - Google Accounts 「アプリ」はメール、「端末を選択」はCentOS7とかホスト名とかを記述します。 すると16桁のパスワードが発行されるのでメモしておきます。 postfixの設定変更 /etc/postfix/main.cfを開き、次を追記します: relayhost = [s
![CentOS7上のpostfixからgmailを使ってメールを送信 - thebakerのブログ](https://cdn-ak-scissors.b.st-hatena.com/image/square/c9115945344b4e70772d23a1ab006afc6fa68127/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Ft%2Fthebaker%2F20171125%2F20171125121547.png)