# How to inject an email using the rails console?

**URL:** https://meta.discourse.org/t/how-to-inject-an-email-using-the-rails-console/210428
**Category:** Support
**Created:** [November 29, 2021, 6:52pm UTC](https://meta.discourse.org/t/how-to-inject-an-email-using-the-rails-console/210428 "2021-11-29T18:52:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dachary](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dachary/32/119731_2.png) [@dachary](https://meta.discourse.org/u/dachary)
#### Post date: [November 29, 2021, 6:52pm UTC](https://meta.discourse.org/t/how-to-inject-an-email-using-the-rails-console/210428/1 "2021-11-29T18:52:17Z")

</div>

Bonjour,

The following email, when received via POP3 by discourse 2.7.9 just disappears, i.e. there is no stack trace it in the logs and nothing in the admin email panel. To solve that mystery, I’d like parse it from the rails console, as if it was received from POP3. My hope is that it will show some kind of error.

And idea?

[mail1.txt](https://meta.discourse.org/uploads/short-url/1mQR1KpRmwiECniekYnpclsY1Kv.txt) (3.7 KB)

---

<div class="post-metadata">

### Author: ![dachary](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dachary/32/119731_2.png) [@dachary](https://meta.discourse.org/u/dachary)
#### Post date: [December 17, 2021, 1:00pm UTC](https://meta.discourse.org/t/how-to-inject-an-email-using-the-rails-console/210428/2 "2021-12-17T13:00:34Z")

</div>

I did not find an answer but found an acceptable fallback. I created a virgin discourse 2.7.9 instance moved the mail to be imported, [as instructed when importing mailboxes](https://meta.discourse.org/t/importing-mailing-lists-mbox-listserv-google-groups-emails/79773). It effectively imports the mail and by editing the `script/import_scripts/mbox/support/indexer.rb` file I was able to add a few **puts** statements here and there to get more information about the problem.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [January 16, 2022, 1:01pm UTC](https://meta.discourse.org/t/how-to-inject-an-email-using-the-rails-console/210428/3 "2022-01-16T13:01:02Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
