【CentOS6】mailxでメールを送信
環境
サーバOS: CentOS 6.7
mailxのインストール
$ yum -y install mailx 読み込んだプラグイン:fastestmirror インストール処理の設定をしています Loading mirror speeds from cached hostfile * base: ftp.riken.jp * epel: mirror.premi.st * extras: ftp.riken.jp * rpmforge: ftp.riken.jp * updates: ftp.riken.jp 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> Package mailx.x86_64 0:12.4-8.el6_6 will be インストール --> 依存性解決を終了しました。 依存性を解決しました ============================================================================================================================================================== パッケージ アーキテクチャ バージョン リポジトリー 容量 ============================================================================================================================================================== インストールしています: mailx x86_64 12.4-8.el6_6 base 235 k トランザクションの要約 ============================================================================================================================================================== インストール 1 パッケージ 総ダウンロード容量: 235 k インストール済み容量: 452 k パッケージをダウンロードしています: mailx-12.4-8.el6_6.x86_64.rpm | 235 kB 00:00 rpm_check_debug を実行しています トランザクションのテストを実行しています トランザクションのテストを成功しました トランザクションを実行しています インストールしています : mailx-12.4-8.el6_6.x86_64 1/1 Verifying : mailx-12.4-8.el6_6.x86_64 1/1 インストール: mailx.x86_64 0:12.4-8.el6_6 完了しました!
smtpサーバを建てない場合(gmailのsmtpサーバを利用)
msmtpをインストールする。
$ yum -y install msmtp 読み込んだプラグイン:fastestmirror インストール処理の設定をしています Loading mirror speeds from cached hostfile * base: ftp.riken.jp * epel: ftp.riken.jp * extras: ftp.riken.jp * rpmforge: ftp.kddilabs.jp * updates: ftp.riken.jp 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> Package msmtp.x86_64 0:1.4.32-1.el6 will be インストール --> 依存性の処理をしています: libgsasl.so.7(LIBGSASL_1.1)(64bit) のパッケージ: msmtp-1.4.32-1.el6.x86_64 --> 依存性の処理をしています: libgnutls.so.26(GNUTLS_1_4)(64bit) のパッケージ: msmtp-1.4.32-1.el6.x86_64 --> 依存性の処理をしています: libgsasl.so.7()(64bit) のパッケージ: msmtp-1.4.32-1.el6.x86_64 --> 依存性の処理をしています: libgnutls.so.26()(64bit) のパッケージ: msmtp-1.4.32-1.el6.x86_64 --> 依存性の処理をしています: libgnome-keyring.so.0()(64bit) のパッケージ: msmtp-1.4.32-1.el6.x86_64 --> トランザクションの確認を実行しています。 ---> Package gnome-keyring.x86_64 0:2.28.2-8.el6_3 will be インストール --> 依存性の処理をしています: GConf2 のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: GConf2 のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libpangoft2-1.0.so.0()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libpangocairo-1.0.so.0()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libpango-1.0.so.0()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libgtk-x11-2.0.so.0()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libgdk_pixbuf-2.0.so.0()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libgdk-x11-2.0.so.0()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libgconf-2.so.4()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libfreetype.so.6()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libfontconfig.so.1()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libcairo.so.2()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 --> 依存性の処理をしています: libatk-1.0.so.0()(64bit) のパッケージ: gnome-keyring-2.28.2-8.el6_3.x86_64 ---> Package gnutls.x86_64 0:2.8.5-19.el6_7 will be インストール ---> Package libgsasl.x86_64 0:1.4.0-4.el6 will be インストール --> 依存性の処理をしています: libntlm.so.0()(64bit) のパッケージ: libgsasl-1.4.0-4.el6.x86_64 --> トランザクションの確認を実行しています。 ---> Package GConf2.x86_64 0:2.28.0-6.el6 will be インストール --> 依存性の処理をしています: sgml-common のパッケージ: GConf2-2.28.0-6.el6.x86_64 --> 依存性の処理をしています: dbus のパッケージ: GConf2-2.28.0-6.el6.x86_64 --> 依存性の処理をしています: libpolkit-gobject-1.so.0()(64bit) のパッケージ: GConf2-2.28.0-6.el6.x86_64 --> 依存性の処理をしています: libORBit-2.so.0()(64bit) のパッケージ: GConf2-2.28.0-6.el6.x86_64 ---> Package atk.x86_64 0:1.30.0-1.el6 will be インストール ---> Package cairo.x86_64 0:1.8.8-6.el6_6 will be インストール --> 依存性の処理をしています: libpng12.so.0(PNG12_0)(64bit) のパッケージ: cairo-1.8.8-6.el6_6.x86_64 --> 依存性の処理をしています: libpng12.so.0()(64bit) のパッケージ: cairo-1.8.8-6.el6_6.x86_64 --> 依存性の処理をしています: libpixman-1.so.0()(64bit) のパッケージ: cairo-1.8.8-6.el6_6.x86_64 --> 依存性の処理をしています: libXrender.so.1()(64bit) のパッケージ: cairo-1.8.8-6.el6_6.x86_64 --> 依存性の処理をしています: libX11.so.6()(64bit) のパッケージ: cairo-1.8.8-6.el6_6.x86_64 ---> Package fontconfig.x86_64 0:2.8.0-5.el6 will be インストール ---> Package freetype.x86_64 0:2.3.11-15.el6_6.1 will be インストール ---> Package gdk-pixbuf2.x86_64 0:2.24.1-6.el6_7 will be インストール --> 依存性の処理をしています: libjpeg.so.62(LIBJPEG_6.2)(64bit) のパッケージ: gdk-pixbuf2-2.24.1-6.el6_7.x86_64 --> 依存性の処理をしています: libtiff.so.3()(64bit) のパッケージ: gdk-pixbuf2-2.24.1-6.el6_7.x86_64 --> 依存性の処理をしています: libjpeg.so.62()(64bit) のパッケージ: gdk-pixbuf2-2.24.1-6.el6_7.x86_64 --> 依存性の処理をしています: libjasper.so.1()(64bit) のパッケージ: gdk-pixbuf2-2.24.1-6.el6_7.x86_64 ---> Package gtk2.x86_64 0:2.24.23-6.el6 will be インストール --> 依存性の処理をしています: libXrandr >= 1.2.99.4-2 のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: hicolor-icon-theme のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: libcups.so.2()(64bit) のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: libXrandr.so.2()(64bit) のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: libXinerama.so.1()(64bit) のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: libXi.so.6()(64bit) のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: libXfixes.so.3()(64bit) のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: libXext.so.6()(64bit) のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: libXdamage.so.1()(64bit) のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: libXcursor.so.1()(64bit) のパッケージ: gtk2-2.24.23-6.el6.x86_64 --> 依存性の処理をしています: libXcomposite.so.1()(64bit) のパッケージ: gtk2-2.24.23-6.el6.x86_64 ---> Package libntlm.x86_64 0:1.0-3.el6 will be インストール ---> Package pango.x86_64 0:1.28.1-10.el6 will be インストール --> 依存性の処理をしています: libthai >= 0.1.9 のパッケージ: pango-1.28.1-10.el6.x86_64 --> 依存性の処理をしています: libthai.so.0(LIBTHAI_0.1)(64bit) のパッケージ: pango-1.28.1-10.el6.x86_64 --> 依存性の処理をしています: libthai.so.0()(64bit) のパッケージ: pango-1.28.1-10.el6.x86_64 --> 依存性の処理をしています: libXft.so.2()(64bit) のパッケージ: pango-1.28.1-10.el6.x86_64 --> トランザクションの確認を実行しています。 ---> Package ORBit2.x86_64 0:2.14.17-5.el6 will be インストール --> 依存性の処理をしています: libIDL-2.so.0()(64bit) のパッケージ: ORBit2-2.14.17-5.el6.x86_64 ---> Package cups-libs.x86_64 1:1.4.2-72.el6 will be インストール --> 依存性の処理をしています: libavahi-common.so.3()(64bit) のパッケージ: 1:cups-libs-1.4.2-72.el6.x86_64 --> 依存性の処理をしています: libavahi-client.so.3()(64bit) のパッケージ: 1:cups-libs-1.4.2-72.el6.x86_64 ---> Package dbus.x86_64 1:1.2.24-8.el6_6 will be インストール ---> Package hicolor-icon-theme.noarch 0:0.11-1.1.el6 will be インストール ---> Package jasper-libs.x86_64 0:1.900.1-16.el6_6.3 will be インストール ---> Package libX11.x86_64 0:1.6.0-6.el6 will be インストール --> 依存性の処理をしています: libX11-common = 1.6.0-6.el6 のパッケージ: libX11-1.6.0-6.el6.x86_64 --> 依存性の処理をしています: libxcb.so.1()(64bit) のパッケージ: libX11-1.6.0-6.el6.x86_64 ---> Package libXcomposite.x86_64 0:0.4.3-4.el6 will be インストール ---> Package libXcursor.x86_64 0:1.1.14-2.1.el6 will be インストール ---> Package libXdamage.x86_64 0:1.1.3-4.el6 will be インストール ---> Package libXext.x86_64 0:1.3.2-2.1.el6 will be インストール ---> Package libXfixes.x86_64 0:5.0.1-2.1.el6 will be インストール ---> Package libXft.x86_64 0:2.3.1-2.el6 will be インストール ---> Package libXi.x86_64 0:1.7.2-2.2.el6 will be インストール ---> Package libXinerama.x86_64 0:1.1.3-2.1.el6 will be インストール ---> Package libXrandr.x86_64 0:1.4.1-2.1.el6 will be インストール ---> Package libXrender.x86_64 0:0.9.8-2.1.el6 will be インストール ---> Package libjpeg-turbo.x86_64 0:1.2.1-3.el6_5 will be インストール ---> Package libpng.x86_64 2:1.2.49-2.el6_7 will be インストール ---> Package libthai.x86_64 0:0.1.12-3.el6 will be インストール ---> Package libtiff.x86_64 0:3.9.4-10.el6_5 will be インストール ---> Package pixman.x86_64 0:0.32.4-4.el6 will be インストール ---> Package polkit.x86_64 0:0.96-11.el6 will be インストール --> 依存性の処理をしています: ConsoleKit のパッケージ: polkit-0.96-11.el6.x86_64 --> 依存性の処理をしています: libeggdbus-1.so.0()(64bit) のパッケージ: polkit-0.96-11.el6.x86_64 ---> Package sgml-common.noarch 0:0.6.3-33.el6 will be インストール --> トランザクションの確認を実行しています。 ---> Package ConsoleKit.x86_64 0:0.4.1-3.el6 will be インストール --> 依存性の処理をしています: libck-connector.so.0()(64bit) のパッケージ: ConsoleKit-0.4.1-3.el6.x86_64 ---> Package avahi-libs.x86_64 0:0.6.25-15.el6 will be インストール ---> Package eggdbus.x86_64 0:0.6-3.el6 will be インストール ---> Package libIDL.x86_64 0:0.8.13-2.1.el6 will be インストール ---> Package libX11-common.noarch 0:1.6.0-6.el6 will be インストール ---> Package libxcb.x86_64 0:1.9.1-3.el6 will be インストール --> 依存性の処理をしています: libXau.so.6()(64bit) のパッケージ: libxcb-1.9.1-3.el6.x86_64 --> トランザクションの確認を実行しています。 ---> Package ConsoleKit-libs.x86_64 0:0.4.1-3.el6 will be インストール ---> Package libXau.x86_64 0:1.0.6-4.el6 will be インストール --> 依存性解決を終了しました。 依存性を解決しました ============================================================================================================================================================== パッケージ アーキテクチャ バージョン リポジトリー 容量 ============================================================================================================================================================== インストールしています: msmtp x86_64 1.4.32-1.el6 epel 118 k 依存性関連でのインストールをします。: ConsoleKit x86_64 0.4.1-3.el6 base 82 k ConsoleKit-libs x86_64 0.4.1-3.el6 base 17 k GConf2 x86_64 2.28.0-6.el6 base 964 k ORBit2 x86_64 2.14.17-5.el6 base 168 k atk x86_64 1.30.0-1.el6 base 195 k avahi-libs x86_64 0.6.25-15.el6 base 55 k cairo x86_64 1.8.8-6.el6_6 base 309 k cups-libs x86_64 1:1.4.2-72.el6 base 321 k dbus x86_64 1:1.2.24-8.el6_6 base 207 k eggdbus x86_64 0.6-3.el6 base 91 k fontconfig x86_64 2.8.0-5.el6 base 186 k freetype x86_64 2.3.11-15.el6_6.1 base 361 k gdk-pixbuf2 x86_64 2.24.1-6.el6_7 updates 501 k gnome-keyring x86_64 2.28.2-8.el6_3 base 811 k gnutls x86_64 2.8.5-19.el6_7 updates 347 k gtk2 x86_64 2.24.23-6.el6 base 3.2 M hicolor-icon-theme noarch 0.11-1.1.el6 base 40 k jasper-libs x86_64 1.900.1-16.el6_6.3 base 137 k libIDL x86_64 0.8.13-2.1.el6 base 83 k libX11 x86_64 1.6.0-6.el6 base 586 k libX11-common noarch 1.6.0-6.el6 base 192 k libXau x86_64 1.0.6-4.el6 base 24 k libXcomposite x86_64 0.4.3-4.el6 base 20 k libXcursor x86_64 1.1.14-2.1.el6 base 28 k libXdamage x86_64 1.1.3-4.el6 base 18 k libXext x86_64 1.3.2-2.1.el6 base 35 k libXfixes x86_64 5.0.1-2.1.el6 base 17 k libXft x86_64 2.3.1-2.el6 base 55 k libXi x86_64 1.7.2-2.2.el6 base 37 k libXinerama x86_64 1.1.3-2.1.el6 base 13 k libXrandr x86_64 1.4.1-2.1.el6 base 23 k libXrender x86_64 0.9.8-2.1.el6 base 24 k libgsasl x86_64 1.4.0-4.el6 epel 113 k libjpeg-turbo x86_64 1.2.1-3.el6_5 base 174 k libntlm x86_64 1.0-3.el6 base 42 k libpng x86_64 2:1.2.49-2.el6_7 updates 182 k libthai x86_64 0.1.12-3.el6 base 183 k libtiff x86_64 3.9.4-10.el6_5 base 343 k libxcb x86_64 1.9.1-3.el6 base 110 k pango x86_64 1.28.1-10.el6 base 351 k pixman x86_64 0.32.4-4.el6 base 243 k polkit x86_64 0.96-11.el6 base 162 k sgml-common noarch 0.6.3-33.el6 base 43 k トランザクションの要約 ============================================================================================================================================================== インストール 44 パッケージ 総ダウンロード容量: 11 M インストール済み容量: 41 M パッケージをダウンロードしています: (1/44): ConsoleKit-0.4.1-3.el6.x86_64.rpm | 82 kB 00:00 (2/44): ConsoleKit-libs-0.4.1-3.el6.x86_64.rpm | 17 kB 00:00 (3/44): GConf2-2.28.0-6.el6.x86_64.rpm | 964 kB 00:00 (4/44): ORBit2-2.14.17-5.el6.x86_64.rpm | 168 kB 00:00 (5/44): atk-1.30.0-1.el6.x86_64.rpm | 195 kB 00:00 (6/44): avahi-libs-0.6.25-15.el6.x86_64.rpm | 55 kB 00:00 (7/44): cairo-1.8.8-6.el6_6.x86_64.rpm | 309 kB 00:00 (8/44): cups-libs-1.4.2-72.el6.x86_64.rpm | 321 kB 00:00 (9/44): dbus-1.2.24-8.el6_6.x86_64.rpm | 207 kB 00:00 (10/44): eggdbus-0.6-3.el6.x86_64.rpm | 91 kB 00:00 (11/44): fontconfig-2.8.0-5.el6.x86_64.rpm | 186 kB 00:00 (12/44): freetype-2.3.11-15.el6_6.1.x86_64.rpm | 361 kB 00:00 (13/44): gdk-pixbuf2-2.24.1-6.el6_7.x86_64.rpm | 501 kB 00:00 (14/44): gnome-keyring-2.28.2-8.el6_3.x86_64.rpm | 811 kB 00:00 (15/44): gnutls-2.8.5-19.el6_7.x86_64.rpm | 347 kB 00:00 (16/44): gtk2-2.24.23-6.el6.x86_64.rpm | 3.2 MB 00:01 (17/44): hicolor-icon-theme-0.11-1.1.el6.noarch.rpm | 40 kB 00:00 (18/44): jasper-libs-1.900.1-16.el6_6.3.x86_64.rpm | 137 kB 00:00 (19/44): libIDL-0.8.13-2.1.el6.x86_64.rpm | 83 kB 00:00 (20/44): libX11-1.6.0-6.el6.x86_64.rpm | 586 kB 00:00 (21/44): libX11-common-1.6.0-6.el6.noarch.rpm | 192 kB 00:00 (22/44): libXau-1.0.6-4.el6.x86_64.rpm | 24 kB 00:00 (23/44): libXcomposite-0.4.3-4.el6.x86_64.rpm | 20 kB 00:00 (24/44): libXcursor-1.1.14-2.1.el6.x86_64.rpm | 28 kB 00:00 (25/44): libXdamage-1.1.3-4.el6.x86_64.rpm | 18 kB 00:00 (26/44): libXext-1.3.2-2.1.el6.x86_64.rpm | 35 kB 00:00 (27/44): libXfixes-5.0.1-2.1.el6.x86_64.rpm | 17 kB 00:00 (28/44): libXft-2.3.1-2.el6.x86_64.rpm | 55 kB 00:00 (29/44): libXi-1.7.2-2.2.el6.x86_64.rpm | 37 kB 00:00 (30/44): libXinerama-1.1.3-2.1.el6.x86_64.rpm | 13 kB 00:00 (31/44): libXrandr-1.4.1-2.1.el6.x86_64.rpm | 23 kB 00:00 (32/44): libXrender-0.9.8-2.1.el6.x86_64.rpm | 24 kB 00:00 (33/44): libgsasl-1.4.0-4.el6.x86_64.rpm | 113 kB 00:00 (34/44): libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm | 174 kB 00:00 (35/44): libntlm-1.0-3.el6.x86_64.rpm | 42 kB 00:00 (36/44): libpng-1.2.49-2.el6_7.x86_64.rpm | 182 kB 00:00 (37/44): libthai-0.1.12-3.el6.x86_64.rpm | 183 kB 00:00 (38/44): libtiff-3.9.4-10.el6_5.x86_64.rpm | 343 kB 00:00 (39/44): libxcb-1.9.1-3.el6.x86_64.rpm | 110 kB 00:00 (40/44): msmtp-1.4.32-1.el6.x86_64.rpm | 118 kB 00:00 (41/44): pango-1.28.1-10.el6.x86_64.rpm | 351 kB 00:00 (42/44): pixman-0.32.4-4.el6.x86_64.rpm | 243 kB 00:00 (43/44): polkit-0.96-11.el6.x86_64.rpm | 162 kB 00:00 (44/44): sgml-common-0.6.3-33.el6.noarch.rpm | 43 kB 00:00 -------------------------------------------------------------------------------------------------------------------------------------------------------------- 合計 915 kB/s | 11 MB 00:12 rpm_check_debug を実行しています トランザクションのテストを実行しています トランザクションのテストを成功しました トランザクションを実行しています インストールしています : freetype-2.3.11-15.el6_6.1.x86_64 1/44 インストールしています : fontconfig-2.8.0-5.el6.x86_64 2/44 インストールしています : libjpeg-turbo-1.2.1-3.el6_5.x86_64 3/44 インストールしています : 1:dbus-1.2.24-8.el6_6.x86_64 4/44 インストールしています : 2:libpng-1.2.49-2.el6_7.x86_64 5/44 インストールしています : libtiff-3.9.4-10.el6_5.x86_64 6/44 インストールしています : atk-1.30.0-1.el6.x86_64 7/44 インストールしています : gnutls-2.8.5-19.el6_7.x86_64 8/44 インストールしています : ConsoleKit-libs-0.4.1-3.el6.x86_64 9/44 インストールしています : jasper-libs-1.900.1-16.el6_6.3.x86_64 10/44 インストールしています : pixman-0.32.4-4.el6.x86_64 11/44 インストールしています : libthai-0.1.12-3.el6.x86_64 12/44 インストールしています : libXau-1.0.6-4.el6.x86_64 13/44 インストールしています : libxcb-1.9.1-3.el6.x86_64 14/44 インストールしています : eggdbus-0.6-3.el6.x86_64 15/44 インストールしています : polkit-0.96-11.el6.x86_64 16/44 インストールしています : ConsoleKit-0.4.1-3.el6.x86_64 17/44 インストールしています : libX11-common-1.6.0-6.el6.noarch 18/44 インストールしています : libX11-1.6.0-6.el6.x86_64 19/44 インストールしています : libXrender-0.9.8-2.1.el6.x86_64 20/44 インストールしています : libXext-1.3.2-2.1.el6.x86_64 21/44 インストールしています : cairo-1.8.8-6.el6_6.x86_64 22/44 インストールしています : libXfixes-5.0.1-2.1.el6.x86_64 23/44 インストールしています : gdk-pixbuf2-2.24.1-6.el6_7.x86_64 24/44 インストールしています : libXdamage-1.1.3-4.el6.x86_64 25/44 インストールしています : libXcursor-1.1.14-2.1.el6.x86_64 26/44 インストールしています : libXinerama-1.1.3-2.1.el6.x86_64 27/44 インストールしています : libXrandr-1.4.1-2.1.el6.x86_64 28/44 インストールしています : libXi-1.7.2-2.2.el6.x86_64 29/44 インストールしています : libXft-2.3.1-2.el6.x86_64 30/44 インストールしています : pango-1.28.1-10.el6.x86_64 31/44 インストールしています : libXcomposite-0.4.3-4.el6.x86_64 32/44 インストールしています : avahi-libs-0.6.25-15.el6.x86_64 33/44 インストールしています : 1:cups-libs-1.4.2-72.el6.x86_64 34/44 インストールしています : libIDL-0.8.13-2.1.el6.x86_64 35/44 インストールしています : ORBit2-2.14.17-5.el6.x86_64 36/44 インストールしています : hicolor-icon-theme-0.11-1.1.el6.noarch 37/44 インストールしています : gtk2-2.24.23-6.el6.x86_64 38/44 インストールしています : libntlm-1.0-3.el6.x86_64 39/44 インストールしています : libgsasl-1.4.0-4.el6.x86_64 40/44 インストールしています : sgml-common-0.6.3-33.el6.noarch 41/44 インストールしています : GConf2-2.28.0-6.el6.x86_64 42/44 インストールしています : gnome-keyring-2.28.2-8.el6_3.x86_64 43/44 インストールしています : msmtp-1.4.32-1.el6.x86_64 44/44 Verifying : cairo-1.8.8-6.el6_6.x86_64 1/44 Verifying : libXrender-0.9.8-2.1.el6.x86_64 2/44 Verifying : sgml-common-0.6.3-33.el6.noarch 3/44 Verifying : libXdamage-1.1.3-4.el6.x86_64 4/44 Verifying : jasper-libs-1.900.1-16.el6_6.3.x86_64 5/44 Verifying : libxcb-1.9.1-3.el6.x86_64 6/44 Verifying : fontconfig-2.8.0-5.el6.x86_64 7/44 Verifying : libtiff-3.9.4-10.el6_5.x86_64 8/44 Verifying : ConsoleKit-0.4.1-3.el6.x86_64 9/44 Verifying : GConf2-2.28.0-6.el6.x86_64 10/44 Verifying : pango-1.28.1-10.el6.x86_64 11/44 Verifying : polkit-0.96-11.el6.x86_64 12/44 Verifying : 2:libpng-1.2.49-2.el6_7.x86_64 13/44 Verifying : libgsasl-1.4.0-4.el6.x86_64 14/44 Verifying : libntlm-1.0-3.el6.x86_64 15/44 Verifying : gnome-keyring-2.28.2-8.el6_3.x86_64 16/44 Verifying : hicolor-icon-theme-0.11-1.1.el6.noarch 17/44 Verifying : libIDL-0.8.13-2.1.el6.x86_64 18/44 Verifying : libX11-1.6.0-6.el6.x86_64 19/44 Verifying : ORBit2-2.14.17-5.el6.x86_64 20/44 Verifying : freetype-2.3.11-15.el6_6.1.x86_64 21/44 Verifying : 1:dbus-1.2.24-8.el6_6.x86_64 22/44 Verifying : libXft-2.3.1-2.el6.x86_64 23/44 Verifying : gnutls-2.8.5-19.el6_7.x86_64 24/44 Verifying : avahi-libs-0.6.25-15.el6.x86_64 25/44 Verifying : gdk-pixbuf2-2.24.1-6.el6_7.x86_64 26/44 Verifying : ConsoleKit-libs-0.4.1-3.el6.x86_64 27/44 Verifying : gtk2-2.24.23-6.el6.x86_64 28/44 Verifying : libXinerama-1.1.3-2.1.el6.x86_64 29/44 Verifying : msmtp-1.4.32-1.el6.x86_64 30/44 Verifying : libX11-common-1.6.0-6.el6.noarch 31/44 Verifying : eggdbus-0.6-3.el6.x86_64 32/44 Verifying : libXext-1.3.2-2.1.el6.x86_64 33/44 Verifying : libjpeg-turbo-1.2.1-3.el6_5.x86_64 34/44 Verifying : libXcursor-1.1.14-2.1.el6.x86_64 35/44 Verifying : libXrandr-1.4.1-2.1.el6.x86_64 36/44 Verifying : libXi-1.7.2-2.2.el6.x86_64 37/44 Verifying : 1:cups-libs-1.4.2-72.el6.x86_64 38/44 Verifying : libXau-1.0.6-4.el6.x86_64 39/44 Verifying : libthai-0.1.12-3.el6.x86_64 40/44 Verifying : pixman-0.32.4-4.el6.x86_64 41/44 Verifying : atk-1.30.0-1.el6.x86_64 42/44 Verifying : libXcomposite-0.4.3-4.el6.x86_64 43/44 Verifying : libXfixes-5.0.1-2.1.el6.x86_64 44/44 インストール: msmtp.x86_64 0:1.4.32-1.el6 依存性関連をインストールしました: ConsoleKit.x86_64 0:0.4.1-3.el6 ConsoleKit-libs.x86_64 0:0.4.1-3.el6 GConf2.x86_64 0:2.28.0-6.el6 ORBit2.x86_64 0:2.14.17-5.el6 atk.x86_64 0:1.30.0-1.el6 avahi-libs.x86_64 0:0.6.25-15.el6 cairo.x86_64 0:1.8.8-6.el6_6 cups-libs.x86_64 1:1.4.2-72.el6 dbus.x86_64 1:1.2.24-8.el6_6 eggdbus.x86_64 0:0.6-3.el6 fontconfig.x86_64 0:2.8.0-5.el6 freetype.x86_64 0:2.3.11-15.el6_6.1 gdk-pixbuf2.x86_64 0:2.24.1-6.el6_7 gnome-keyring.x86_64 0:2.28.2-8.el6_3 gnutls.x86_64 0:2.8.5-19.el6_7 gtk2.x86_64 0:2.24.23-6.el6 hicolor-icon-theme.noarch 0:0.11-1.1.el6 jasper-libs.x86_64 0:1.900.1-16.el6_6.3 libIDL.x86_64 0:0.8.13-2.1.el6 libX11.x86_64 0:1.6.0-6.el6 libX11-common.noarch 0:1.6.0-6.el6 libXau.x86_64 0:1.0.6-4.el6 libXcomposite.x86_64 0:0.4.3-4.el6 libXcursor.x86_64 0:1.1.14-2.1.el6 libXdamage.x86_64 0:1.1.3-4.el6 libXext.x86_64 0:1.3.2-2.1.el6 libXfixes.x86_64 0:5.0.1-2.1.el6 libXft.x86_64 0:2.3.1-2.el6 libXi.x86_64 0:1.7.2-2.2.el6 libXinerama.x86_64 0:1.1.3-2.1.el6 libXrandr.x86_64 0:1.4.1-2.1.el6 libXrender.x86_64 0:0.9.8-2.1.el6 libgsasl.x86_64 0:1.4.0-4.el6 libjpeg-turbo.x86_64 0:1.2.1-3.el6_5 libntlm.x86_64 0:1.0-3.el6 libpng.x86_64 2:1.2.49-2.el6_7 libthai.x86_64 0:0.1.12-3.el6 libtiff.x86_64 0:3.9.4-10.el6_5 libxcb.x86_64 0:1.9.1-3.el6 pango.x86_64 0:1.28.1-10.el6 pixman.x86_64 0:0.32.4-4.el6 polkit.x86_64 0:0.96-11.el6 sgml-common.noarch 0:0.6.3-33.el6 完了しました!
msmtpの設定
サンプルを参考に設定ファイルを作成。
$ cp /usr/share/doc/msmtp-1.4.32/msmtprc-user.example ~/.msmtprc $ vi ~/.msmtprc
最終的にこんな感じに。
# Example for a user configuration file # Set default values for all following accounts. defaults auth on tls on tls_trust_file /etc/ssl/certs/ca-bundle.crt logfile ~/.msmtp.log # gmail service account gmail host smtp.gmail.com # smtpサーバ port 587 # smtpサーバのポート from user@gmail.com # 送信元メールアドレス user user # 認証に利用されるユーザ password password # 認証に利用されるパスワード # Set a default account account default : gmail
mailxの設定
.mailrcの作成
$ vi ~/.mailrc
先ほど設定したmsmtpの設定を使うようにする。
# set smtp for mailx set sendmail="/usr/bin/msmtp"
送信テスト
送信してみる。
$ mail hoge@example.com Subject: テスト件名 テスト本文 . EOT
エラーが。。。
send-mail: authentication failed (method PLAIN) send-mail: server message: 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvp3 #〜〜〜〜〜〜〜〜〜〜〜〜〜〜(省略)〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜 send-mail: server message: 534-5.7.14 ygIFjX33634n_LN73HnYlF-FZ-oE> Please log in via your web browser and send-mail: server message: 534-5.7.14 then try again. send-mail: server message: 534-5.7.14 Learn more at send-mail: server message: 534 5.7.14 https://support.google.com/mail/answer/78754 i15sm36542030pfi.55 - gsmtp send-mail: could not send mail (account default from /root/.msmtprc)
ググる。
phpmailer - Gmail SMTP debug: error "please log in via your web browser" - Stack Overflow
Head over to Account Security Settings (https://www.google.com/settings/security/lesssecureapps) and enable "Access for less secure apps", this allows you to use the google smtp for clients other than the official ones.
書いてあるとおりhttps://www.google.com/settings/security/lesssecureappsにアクセス。
ベストな方法ではないんだろうけど、他にやり方が見つからなかったのでこれにて対応。