가상 서버에서 이메일이 작동하지 않습니다

저는 독일의 호스팅 제공업체 Hosteurope의 가상 서버를 사용하고 있습니다. 가상 서버에는 MTA Postfix가 설치되어 있지 않습니다. 설치 과정은 매우 간단했습니다. ./launcher bootstrap app와 ./launcher start app를 실행한 후 앱이 시작되었습니다.

./discourse-doctor를 실행하면 다음과 같은 메시지가 표시됩니다:

Email address for mail test? (‘n’ to skip) [test@example.com]:
Sending mail to test@example.com. . .
Testing sending to test@example.com using wpxxx.mailout.server-he.de:25.
SMTP server connection successful.
Sending to test@example.com. . .
Mail accepted by SMTP server.

If you do not receive the message, check your SPAM folder
or test again using a service like http://www.mail-tester.com/.

If the message is not delivered it is not a problem with Discourse.

Check the SMTP server logs to see why it failed to deliver the message.
Replacing: SMTP_PASSWORD
Replacing: LETSENCRYPT_ACCOUNT_EMAIL
Replacing: DEVELOPER_EMAILS
Replacing: DISCOURSE_DB_PASSWORD

다음은 app.yml 파일의 일부입니다.

  DISCOURSE_SMTP_ADDRESS: wpxxx.mailout.server-he.de
  DISCOURSE_SMTP_PORT: 25
  #DISCOURSE_SMTP_USER_NAME:
  #DISCOURSE_SMTP_PASSWORD:
  #DISCOURSE_SMTP_ENABLE_START_TLS: true  # (선택 사항, 기본값 true)
  #DISCOURSE_SMTP_AUTHENTICATION: login

스팸 폴더를 확인해 보셨나요?

mail-tester로 전송을 시도해 보셨나요?

네, mail-tester에 이메일을 보냈습니다. SMTP 서버가 이메일은 접수했지만 수신자에게 전달하지는 않은 것 같습니다?

==================== 메일 테스트 ====================
보다 안정적인 테스트를 위해 http://www.mail-tester.com/에서 주소를 받아보세요.
또는 자신에게 테스트 메시지를 보내는 것도 좋습니다.
메일 테스트에 사용할 이메일 주소? (건너뛰려면 'n' 입력) []: test-2v7z63ww6@srv1.mail-tester.com
test-2v7z63ww6@srv1.mail-tester.com으로 메일 전송 중. . . 
wp10750459.mailout.server-he.de:25를 사용하여 test-2v7z63ww6@srv1.mail-tester.com으로 전송 테스트 중.
SMTP 서버 연결 성공.
test-2v7z63ww6@srv1.mail-tester.com으로 전송 중. . . 
SMTP 서버가 메일을 접수했습니다.

메시지를 받지 못하신 경우 스팸 폴더를 확인하시거나
http://www.mail-tester.com/와 같은 서비스를 사용하여 다시 테스트해 보세요.

메시지가 전달되지 않는다면 이는 Discourse의 문제가 아닙니다.

메시지가 전달되지 않은 원인을 확인하려면 SMTP 서버 로그를 확인하세요.
Replacing: SMTP_PASSWORD
Replacing: LETSENCRYPT_ACCOUNT_EMAIL
Replacing: DEVELOPER_EMAILS
Replacing: DISCOURSE_DB_PASSWORD
Replacing: Sending mail to

==================== 완료! ====================

그렇게 보입니다. 메일 서버 로그를 확인해 보셔야 합니다. 메일 서버에서는 메시지를 수락은 했지만 전달하지는 않았습니다.

질문은 다음과 같습니다. 가상 서버에 메일 서버를 설치해야 하는가? 가상 서버에는 메일 서버가 필요 없다고 생각합니다. 제공자의 SMTP 서버를 사용하려고 합니다. 포트는 닫혀 있습니다. 어떤 메일 서버를 설치해야 할까요?

telnet 178.77.102.5 25
Trying 178.77.102.5...
telnet: Unable to connect to remote host: Connection refused

nmap -PN -p 25,110,143,465,587,993,995 178.77.102.5

Starting Nmap 7.01 ( https://nmap.org  ) at 2021-01-07 16:45 CET
Nmap scan report for lvps178-77-102-5.dedicated.hosteurope.de (178.77.102.5)
Host is up (0.0058s latency).
PORT      STATE   SERVICE
25/tcp   closed smtp
110/tcp closed pop3
143/tcp closed imap
465/tcp closed smtps
587/tcp closed submission
993/tcp closed imaps
995/tcp closed pop3s

Nmap done: 1 IP address (1 host up) scanned in 0.23 seconds

[root@lvps178-77-102-5 ~]# yum list installed | grep mail
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
fetchmail.x86_64                               6.3.24-7.el7                     installed
mailcap.noarch                                  2.1.41-2.el7                     installed
mailx.x86_64                                     12.5-19.el7                      installed
procmail.x86_64                                 3.22-36.el7_4.1                installed
sendmail.x86_64                                 8.14.7-6.el7                     installed
sendmail-cf.noarch                            8.14.7-6.el7                     installed
sendmail-doc.noarch                           8.14.7-6.el7                     installed
[root@lvps178-77-102-5 ~]#
[root@lvps178-77-102-5 ~]# ss -tanup
Netid State         Recv-Q Send-Q                                              Local Address:Port                                                                     Peer Address:Port
tcp    LISTEN       0         128                                                                     *:22                                                                                        *:*                            users:(("sshd",pid=396,fd=3))
tcp    LISTEN       0         128                                                                     *:3000                                                                                     *:*                            users:(("docker-proxy",pid=841,fd=4))
tcp    LISTEN       0         128                                                                     *:443                                                                                       *:*                            users:(("docker-proxy",pid=783,fd=4))
tcp    LISTEN       0         128                                                                     *:2045                                                                                     *:*                            users:(("docker-proxy",pid=3321,fd=4))
tcp    LISTEN       0         128                                                                     *:80                                                                                        *:*                            users:(("docker-proxy",pid=851,fd=4))
tcp    LISTEN       0         128                                                                     *:81                                                                                        *:*                            users:(("docker-proxy",pid=829,fd=4))
tcp    ESTAB         0         0                                                       178.77.102.5:22                                                                     185.243.70.181:39124                      users:(("sshd",pid=16868,fd=3))
tcp    LISTEN       0         128                                                                [::]:22                                                                                    [::]:*                            users:(("sshd",pid=396,fd=4))

메일 서버를 설치하고 실행하는 방법을 원하신다면 다른 곳에서 확인하셔야 합니다. 여기서는 지원 범위를 벗어난 내용이기 때문입니다.

wp10750459.mailout.server-he.de를 메일 서버로 사용하고 계신 것 같습니다. 따라서 메일을 수신하고 있지만 전달하지 못하는 것은 해당 서버의 문제입니다. 원인을 파악하려면 해당 서버의 로그를 확인해야 합니다.

간단한 해결책은 Mailgun 또는 유사한 서비스를 사용하는 것입니다.