mailx/msmtp によるメール送信はルートユーザーのみに有効です

mailx/msmtp によるメール送信はルートユーザーのみに有効です

解決策を見つけるのに苦労しています。私はheirloom-mailxとmsmtpを次のようにインストールしましたサイト. ルート ユーザーとして (Gmail を使用して) メールを送信できます。問題は、非ルート ユーザーの場合です。メッセージはキュー フォルダー (/var/spool/mqueue) に移動され、送信されません。

私は Linux の経験がほとんどありません。助けていただけませんか?

システム: Cubieboard 1 - Armbian Legacy Jessie サーバー 3.4.112

.mailrc
set sendmail="/usr/bin/msmtp"
set message-sendmail-extra-arguments="-a gmail"
========================================================================================
.msmtprc
#Gmail account
defaults
logfile ~/msmtp.log

account gmail
auth on
host smtp.gmail.com
from [email protected]
auth on
tls on
# tls_trust_file /etc/ssl/cert.pem
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt
user [email protected]
password XXX
port 587

account default : gmail
========================================================================================
/var/log/mail.info
Oct 30 21:08:52 localhost sm-mta[4429]: u9U129DY004614: to=<[email protected]>, ctladdr=<root@localhost> (0/0), delay=22:06:43, xdelay=00:00:00, mailer=esmtp, pri=11910461, relay=alt4.gmail-smtp-in.l.google.com., dsn=4.0.0, stat=Deferred: Connection timed out with alt4.gmail-smtp-in.l.google.com.

メール.log:

Nov  1 20:08:27 localhost sendmail[15107]: uA1M8RXu015107: from=debian-transmission, size=380, class=0, nrcpts=1, msgid=<201611012208.uA1M8RXu015107@localhost>, relay=debian-transmission@localhost
Nov  1 20:08:27 localhost sm-mta[15111]: uA1M8RiY015111: from=<debian-transmission@localhost>, size=628, class=0, nrcpts=1, msgid=<201611012208.uA1M8RXu015107@localhost>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Nov  1 20:08:27 localhost sendmail[15107]: uA1M8RXu015107: [email protected], ctladdr=debian-transmission (107/114), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30380, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (uA1M8RiY015111 Message accepted for delivery)
Nov  1 20:13:43 localhost sm-mta[15113]: uA1M8RiY015111: to=<[email protected]>, ctladdr=<debian-transmission@localhost> (107/114), delay=00:05:16, xdelay=00:05:16, mailer=esmtp, pri=120628, relay=alt4.gmail-smtp-in.l.google.com. [74.125.130.27], dsn=4.0.0, stat=Deferred: Connection timed out with alt4.gmail-smtp-in.l.google.com.

Debian-transmission は、transmission によって作成されたユーザーです。Transmission はダウンロード後に以下のスクリプトを呼び出します。

printf "The torrent $TR_TORRENT_NAME was downloaded successfully at $TR_TIME_LOCATIME" | /usr/bin/mailx -s "Transmission downloaded : $TR_TORRENT_NAME" [email protected]

スクリプトに mailrc および msmtprc パラメータを追加できるでしょうか?

答え1

ファイル.mailrc.msmtprcホームディレクトリにも置く必要があります。

そのプログラムが から構成ファイルも読み取ることができるかどうかを確認します/etc/

関連情報