sSMTPを使用してGmailでHELO / EHLOメールエラーをテストする方法は?

sSMTPを使用してGmailでHELO / EHLOメールエラーをテストする方法は?

SSMTPによるデーモンとして実行されないそれ自体、どうやってテストしますか?動作しますか?

nicholas@mordor:~$ 
nicholas@mordor:~$ telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
nicholas@mordor:~$ 
nicholas@mordor:~$ telnet mordor.saundersconsulting.tech 25
Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused
nicholas@mordor:~$ 
nicholas@mordor:~$ swaks --to [email protected] --from [email protected] --server mordor.saundersconsulting.tech
=== Trying mordor.saundersconsulting.tech:25...
*** Error connecting to mordor.saundersconsulting.tech:25:
***     IO::Socket::INET6: connect: Connection refused
nicholas@mordor:~$ 
nicholas@mordor:~$ sudo cat /etc/ssmtp/ssmtp.conf
[sudo] password for nicholas: 
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
[email protected]

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com

mailhub=smtp.gmail.com:587

[email protected]
AuthPass=fdsfdsfdsf
UseTLS=YES
UseSTARTTLS=YES


# Where will the mail seem to come from?
#rewriteDomain=

rewriteDomain=gmail.com

# The full hostname
#hostname=mordor.saundersconsulting.tech
[email protected]

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address

FromLineOverride=YES
nicholas@mordor:~$ 
nicholas@mordor:~$ sudo cat /etc/ssmtp/revaliases
# sSMTP aliases
# 
# Format:   local_account:outgoing_address:mailhub
#
# Example: root:[email protected]:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.


root:[email protected]:smtp.gmail.com:587
nicholas@mordor:~$ 
nicholas@mordor:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.10
Release:    23.10
Codename:   mantic
nicholas@mordor:~$ 

この場合、何をテストするのかわかりません。

コマンドを直接試すと、次のようになります。

nicholas@mordor:~$ 
nicholas@mordor:~$ ssmtp [email protected]
to:[email protected]
from:[email protected]
subject:ping
testingssmtp: Cannot open smtp.gmail.com:587
nicholas@mordor:~$ 

/var/log/mail.err ログには次のリンクが表示されます。

HELO/EHLO メールエラー

電子メールを送信しようとしたときに「無効なHELO / EHLOパラメータ」というバウンスメッセージを受信した場合は、次の手順を実行できます。

Contact your email administrator. You should have an administrator if you’re using Gmail for a work, school, or organization account.

そうでない場合は、電子メールプロバイダにお問い合わせください。 Gmailサーバーにアクセスするときは、管理者にトランスポートサーバーの完全修飾ドメイン名またはIPアドレスを送信するように依頼してください。

このエラーは通常、プリンタ、スキャナ、ファックスなどのメールを送信するデバイスで発生します。

このように:

nicholas@mordor:~$ 
nicholas@mordor:~$ cat /var/log/mail.err
2023-12-19T09:37:13.183560+00:00 mordor sSMTP[11658]: Invalid response: 501 5.5.4  https://support.google.com/mail/?p=helo s17-20020a170902b19100b001d366f8cfd7sm7380648plr.182 - gsmtp ([email protected])
2023-12-19T09:37:13.184272+00:00 mordor sSMTP[11658]: Cannot open smtp.gmail.com:587
2023-12-19T13:10:01.378049+00:00 mordor sSMTP[14174]: Invalid response: 501 5.5.4  https://support.google.com/mail/?p=helo y20-20020a056a00191400b00688435a9915sm20054254pfi.189 - gsmtp ([email protected])
2023-12-19T13:10:01.378702+00:00 mordor sSMTP[14174]: Cannot open smtp.gmail.com:587
2023-12-19T13:10:36.241185+00:00 mordor sSMTP[14186]: Invalid response: 501 5.5.4  https://support.google.com/mail/?p=helo b18-20020a170902d51200b001cf511aa772sm20973353plg.145 - gsmtp ([email protected])
2023-12-19T13:10:36.241851+00:00 mordor sSMTP[14186]: Cannot open smtp.gmail.com:587
2023-12-19T13:11:49.694632+00:00 mordor sSMTP[14213]: Invalid response: 501 5.5.4  https://support.google.com/mail/?p=helo l15-20020a170902f68f00b001c9c5a1b477sm21000470plg.169 - gsmtp ([email protected])
2023-12-19T13:11:49.695296+00:00 mordor sSMTP[14213]: Cannot open smtp.gmail.com:587
nicholas@mordor:~$ 

ベストアンサー1

おすすめ記事