# המייל:משימת ה-rake לבדיקה לא אמורה לדווח על מסירה מוצלחת כאשר המייל מושבת

**URL:** <https://meta.discourse.org/t/the-emails-test-rake-task-should-not-report-successful-delivery-when-email-is-disabled/185109>\
**Category:** Bug\
**Created:** [1 באפריל,‏ 2021,‏ 2:12pm UTC](https://meta.discourse.org/t/the-emails-test-rake-task-should-not-report-successful-delivery-when-email-is-disabled/185109 "2021-04-01T14:12:32Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [1 באפריל,‏ 2021,‏ 2:12pm UTC](https://meta.discourse.org/t/the-emails-test-rake-task-should-not-report-successful-delivery-when-email-is-disabled/185109/1 "2021-04-01T14:12:32Z")

</div>

Similar to [Email test area should warn if emails are disabled](https://meta.discourse.org/t/email-test-area-should-warn-if-emails-are-disabled/95269)

This is misleading:

```plaintext
$ 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.

```

In this case, no email was sent since `SiteSetting.disable_emails == "non-staff"`.

We should warn about this in the rake task. Do we want to:

- add logic to `Email::Sender#send` that returns a value indicating whether the message was sent (e.g. sent, skipped, disabled, no\_message)
- or, add logic to the `emails:test` task that tests only for `disable_emails`?

---

_[View the full topic](https://meta.discourse.org/t/the-emails-test-rake-task-should-not-report-successful-delivery-when-email-is-disabled/185109)._
