# Email::Processor 不应以 mail=nil 调用

**URL:** https://meta.discourse.org/t/email-processor-does-not-expect-to-be-called-with-mail-nil/258428
**Category:** Bug
**Tags:** email
**Created:** [2023年三月16日 21:31 UTC](https://meta.discourse.org/t/email-processor-does-not-expect-to-be-called-with-mail-nil/258428 "2023-03-16T21:31:33Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [2023年三月19日 05:36 UTC](https://meta.discourse.org/t/email-processor-does-not-expect-to-be-called-with-mail-nil/258428/2 "2023-03-19T05:36:28Z")

</div>

我目前的理解是，`Email::Processor.process!` 使用 `mail=nil` 调用 `Email::Receiver.new`，这会引发一个 `Email::Receiver.EmptyEmailError`，导致 `@receiver` 未定义。

接下来的 `rescue` 部分期望一个已初始化的 `@receiver`。

难道不应该在调用 `Email::Processor.initialize` 时传入 `mail==nil` 时引发某种错误吗？

---

_[View the full topic](https://meta.discourse.org/t/email-processor-does-not-expect-to-be-called-with-mail-nil/258428)._
