# Strip incoming email subject?

**URL:** <https://meta.discourse.org/t/strip-incoming-email-subject/132242>\
**Category:** Product Support\
**Created:** [30 באוקטובר,‏ 2019,‏ 1:57pm UTC](https://meta.discourse.org/t/strip-incoming-email-subject/132242 "2019-10-30T13:57:24Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![paradeiser](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/paradeiser/32/152821_2.png) [@paradeiser](https://meta.discourse.org/u/paradeiser)\
**Post date:** [4 בנובמבר,‏ 2019,‏ 6:25pm UTC](https://meta.discourse.org/t/strip-incoming-email-subject/132242/5 "2019-11-04T18:25:32Z")

</div>

I changed the `mbox/importer.rb` using the corrected RegEx and also tried a static replace string without any change of the incoming topics.

I’ll try to clarify:

- I subscribed the email-adress of the related dicourse category (custom address for incoming e-mails; √ category mirrors mailing-list) to the existing mailing-list
- discourse receives this mails and creates according topics
- as the mailing-list adds a prefix to the email-subject, I want to remove it before discourse creates the topic

My questions now

1. is `./script/import_scripts/mbox/importer.rb` the correct importer?
2. is the `.gsub("remove this prefix ","")` syntaxt right?

I tried  
`mapped[:title] = row['subject'].strip[0...255].gsub(/^\[(.*?)\]\s/,"")`

So far it didn’t change anything…  
Thanks again.

---

_[View the full topic](https://meta.discourse.org/t/strip-incoming-email-subject/132242)._
