$ 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؟
إذن، هل ما يُقال عن قبول البريد الإلكتروني هو كذبة؟
ما أريده أكثر هو أن يتجاهل مهمة rake إعداد تعطيل البريد الإلكتروني. فإذا كان لدى شخص ما وصول إلى وحدة التحكم، فيجب أن يكون قادرًا على إرسال بريد إلكتروني تجريبي.
لم أتمكن من تكرار مشكلة عدم إرسال الرسالة بسبب 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
[...]