# Importierte Mbox-Dateien haben bei allen E-Mails den Benutzer „system"

**URL:** https://meta.discourse.org/t/imported-mbox-file-mails-all-have-user-system/106567
**Category:** Support
**Created:** [15. Januar 2019 um 09:33 UTC](https://meta.discourse.org/t/imported-mbox-file-mails-all-have-user-system/106567 "2019-01-15T09:33:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![YoavNordmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yoavnordmann/32/125158_2.png) [@YoavNordmann](https://meta.discourse.org/u/YoavNordmann)
#### Post date: [15. Januar 2019 um 09:33 UTC](https://meta.discourse.org/t/imported-mbox-file-mails-all-have-user-system/106567/1 "2019-01-15T09:33:18Z")

</div>

Hi All

We are trying to move to discourse but in order to do so I must be able to import all old chain mails we have aggregated in the past 2 years.

I am following the [instructions](https://meta.discourse.org/t/importing-mailing-lists-mbox-listserv-google-groups-emails/79773) and while the import works, there are two problematic issues:

1. The order of the topics is latest on top (which I know how to fix with rake)
2. The user is not imported, not staged, rather the posting user is **system**

This is problematic as we would not know whom to contact on one of the older answes given to a question.

I am running the latest version ([v2.2.0.beta8](https://github.com/discourse/discourse/compare/6c2333a780494fc1339b871211a309864fcd9cb4...tests-passed)). The following is my **settings.yml** file for import

```
data_dir: /shared/import/data
split_regex: "^From.*.+@tikalk.+"
default_trust_level: 1
prefer_html: true
staged: true
index_only: false
group_messages_by_subject: true

```

In my mbox files I have the following _From_ sections:

```
From: Yoav Nordmann <yoav.nordmann@tikalk.com>

```

Any ideas ?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [15. Januar 2019 um 09:59 UTC](https://meta.discourse.org/t/imported-mbox-file-mails-all-have-user-system/106567/2 "2019-01-15T09:59:23Z")

</div>

> [@YoavNordmann](#):
>
> split\_regex: “^From.\*.+@tikalk.+”

> [@YoavNordmann](#):
>
> From: Yoav Nordmann [yoav.nordmann@tikalk.com](mailto:yoav.nordmann@tikalk.com)

Well, that’s a problem. Your regex will match the actual `From` header of emails. Are you sure that your separator between emails contains a colon? Usually it looks like `From foo@example.com Sat Aug 18 19:23:56 2018`. Note that there is no colon after the “From”, because that should be reserved for the email header.

If there is a colon in your separator, you might need to find another way to cleanly separate the emails in the mbox file. You are importing from mbox, right? Not just a bunch of emails where every email is stored in its own file?

---

<div class="post-metadata">

### Author: ![YoavNordmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yoavnordmann/32/125158_2.png) [@YoavNordmann](https://meta.discourse.org/u/YoavNordmann)
#### Post date: [15. Januar 2019 um 10:29 UTC](https://meta.discourse.org/t/imported-mbox-file-mails-all-have-user-system/106567/3 "2019-01-15T10:29:29Z")

</div>

Yo answer your question, I am importing from a gmail account and all mails are in 1 single mbox file.

From what you wrote I am starting to think I used the wrong separator.  
There is another from separator:

> From 1621016496672657672@xxx Thu Dec 27 14:43:19 +0000 2018

But this one does not have out company mail: [tikalk.com](http://tikalk.com) rather “xxx” so I thought I need to use the one with out company mail in it.

I will try with the following regex as separator regex: **“^From .+@xxx.+”**

I will update on my progress.

---

<div class="post-metadata">

### Author: ![YoavNordmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yoavnordmann/32/125158_2.png) [@YoavNordmann](https://meta.discourse.org/u/YoavNordmann)
#### Post date: [15. Januar 2019 um 11:16 UTC](https://meta.discourse.org/t/imported-mbox-file-mails-all-have-user-system/106567/4 "2019-01-15T11:16:54Z")

</div>

Thanks so much for the support  
Not only did it fix the user issue, but it also order the topics in the correct order.

---

<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: [14. Februar 2019 um 11:16 UTC](https://meta.discourse.org/t/imported-mbox-file-mails-all-have-user-system/106567/5 "2019-02-14T11:16:57Z")

</div>

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