XEN DOM0内でmsmtp経由で電子メールを送信する方法

XEN DOM0内でmsmtp経由で電子メールを送信する方法

いくつかの仮想マシンを含むXENサーバーがあり、そのうちの1つが電子メールサーバーです。

すべてのルート電子メールを自分の管理者電子メール(電子メールVM内)に送信するようDOM0にどのように指示しますか?

msmtpd設定ファイルをインストールして追加してみました/etc/msmtprc

# A system wide configuration file is optional.
# If it exists, it usually defines a default account.
# This allows msmtp to be used like /usr/sbin/sendmail.
account default

# The SMTP smarthost
host mail.myOtherVM.de

# Use TLS on port 465
port 587
tls on
tls_starttls on

# Construct envelope-from addresses of the form "[email protected]"
from %[email protected]

# Syslog logging with facility LOG_MAIL instead of the default LOG_USER
syslog LOG_MAIL

しかし、Eメールを送信しようとすると

echo -e "Subject: msmtp test\nhello test." | msmtp [email protected]

私のEメールVMにエラーが発生します。

lost connection after DATA from unknown[2a01:xxxx:1d02::2]
disconnect from unknown[2a01:xxxx:1d02::2] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 commands=4/6

(ポート465も試しましたが、そのポートがまったく開いていませんでした。)

ベストアンサー1

msmtpユーザー名とパスワードでのみ機能します。例/etc/msmtprc:

defaults

# Use TLS on port 465
port 587
tls on
tls_starttls on

# Syslog logging with facility LOG_MAIL instead of the default LOG_USER
syslog LOG_MAIL

# Mail account
account [email protected]
 
from yourserver dom0 <[email protected]>

# Host name of the SMTP server
host mail.yourserver.de
 
auth on
 
user [email protected]
password yourpass

account default: [email protected]

構成されていない他のMTAを削除してインストールするように注意してくださいmsmtp-mta(smtpにsendmailをシンボリックリンクする)。

おすすめ記事