emails:test rake 작업은 이메일이 비활성화되어 있으면 성공적인 전달을 보고하지 않아야 합니다

Email test area should warn if emails are disabled 의 내용과 유사합니다:

다음은 오해의 소지가 있습니다:

$ rake 'emails:test[michael@example.com]'
Testing sending to michael@example.com using mx-out:25.
SMTP server connection successful.
Sending to michael@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.

이 경우 SiteSetting.disable_emails == "non-staff"였기 때문에 이메일이 전송되지 않았습니다.

이 rake 작업에서 이에 대한 경고를 표시해야 합니다. 다음 중 어떤 방식을 취할까요?

  • Email::Sender#send에 메시지가 전송되었는지를 나타내는 값을 반환하는 로직을 추가합니다 (예: sent, skipped, disabled, no_message)
  • 또는 emails:test 작업에 disable_emails만 테스트하는 로직을 추가합니다
1개의 좋아요

그 코드 중 일부에는 내가 관여한 부분이 있는 것 같아…

그러면 메일이 수락되었다는 부분은 거짓말이라는 거야?

가장 원했던 것은 rake 태스크가 이메일 비활성화 설정을 무시하도록 하는 거야. 콘솔에 접근할 수 있는 사람이라면 테스트 이메일을 보낼 수 있어야 하니까.

1개의 좋아요

동의합니다. 좋은 지적입니다. 만약의 상황에 대비하여 이메일을 보내면서도 이메일이 비활성화되어 있음을 보고하는 것이 좋은 아이디어일 수 있습니다.

2개의 좋아요

SiteSetting.disable_emails로 인해 메시지가 전송되지 않는 문제를 재현하지는 못했지만, EmailLog가 반환된 경우에만 성공으로 보고하도록 스크립트를 수정했고, disable_emails 설정에 대한 추가 경고도 추가했습니다.

$ bin/rake 'emails:test[]'
Testing sending to  using localhost:1025, username: with  auth.
SMTP server connection successful.
Sending to . . . 
Mail was not sent.

Reason: message.to is blank

### WARNING
The `disable_emails` site setting is currently set to non-staff.
Consider changing it to 'no' before performing any further troubleshooting.

그리고

Sending to michael@example.com. . . 
Mail accepted by SMTP server.
Message-ID: dfaf1c88-aab6-474b-b50c-8c500afb6291@localhost

If you do not receive the message, check your SPAM folder
[...]

https://github.com/discourse/discourse/pull/13674

3개의 좋아요

이 주제는 21시간 후 자동으로 닫혔습니다. 더 이상 새로운 답글을 작성할 수 없습니다.