Koozali.org: home of the SME Server

Gathering Specific Emails

Gathering Specific Emails
« on: September 23, 2021, 07:45:56 PM »
I'm trying to gather emails/conversations from a specific domain and said domain has conversed with several users in our company. Would like to know the best way to locate/procure these emails as my company will need these emails for legal reasons. Any help is appreciated. Thank you

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Gathering Specific Emails
« Reply #1 on: September 23, 2021, 09:35:06 PM »
Hmmmm. Good one.

I think you might need to do this programatically.

Have a look for some libraries/classes. You might be able to specify from/to correctly.

https://github.com/barbushin/php-imap

https://github.com/robmueller/mail-imaptalk/

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Gathering Specific Emails
« Reply #2 on: September 24, 2021, 02:29:43 AM »
something like this will allow to check what email contain the domain.

Code: [Select]
grep domainname -lr /home/e-smith/files/users/*/Maildir/

to copy them all
Code: [Select]
grep domainname -lr /home/e-smith/files/users/*/Maildir/ | xargs cp -t /root/dest/

or with find, but might also catch non mail

Code: [Select]
find /home/e-smith/files/users/ -type f -exec grep -q 'domainname' {} \; -exec cp -t /home/user/DestinationFolder {} +


you can also refine the expression you earch using regex
« Last Edit: September 24, 2021, 02:36:45 AM by Jean-Philippe Pialasse »

Re: Gathering Specific Emails
« Reply #3 on: September 24, 2021, 11:11:20 AM »
Thank you for both of your responses. Exactly what I was looking for. This will help us out tremendously.

Re: Gathering Specific Emails
« Reply #4 on: September 28, 2021, 06:51:18 PM »
So I've copied what I can to an external HDD (ext 4) and would like to know the best way to transfer to a Windows PC and make the files readable by say Thunderbird/Outlook.

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Gathering Specific Emails
« Reply #5 on: September 28, 2021, 07:22:50 PM »
So I've copied what I can to an external HDD (ext 4) and would like to know the best way to transfer to a Windows PC

Not sure Windows reads Ext 4 - you might need a plugin or program for that.

[qoute]
 and make the files readable by say Thunderbird/Outlook.
[/quote]

They are in Maildir format

https://addons.thunderbird.net/en-US/thunderbird/addon/importexporttools/

It always helps to have a good read around online fist - this info is easily available.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline bunkobugsy

  • *
  • 279
  • +4/-0
Re: Gathering Specific Emails
« Reply #6 on: September 28, 2021, 07:23:24 PM »
Every file is an email so add them .eml extension then drag and drop files to specific folders in TB (not too many at a time).

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: Gathering Specific Emails
« Reply #7 on: September 29, 2021, 12:23:58 PM »
I don't know if this would work on SME10, but on SME9 I would create a new user, copy the emails into the mail folder for that user, then configure Thuderbird to cache local copies of the emails from the new account.

If the emails are accessible via IMAP you could also import them into a gmail account, which might simplify searching for specific email content.

Offline bunkobugsy

  • *
  • 279
  • +4/-0
Re: Gathering Specific Emails
« Reply #8 on: September 29, 2021, 12:42:25 PM »
I don't know if this would work on SME10, but on SME9 I would create a new user, copy the emails into the mail folder for that user, then configure Thuderbird to cache local copies of the emails from the new account.

and   chown newuser:newuser ./*

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Gathering Specific Emails
« Reply #9 on: September 29, 2021, 02:54:19 PM »
....my company will need these emails for legal reasons......

And lastly, as a business, don't forget to make a donation. It's an expense..... !

None of the developers who built this earn $$$$ building Koozali SME, or helping you, and rely on donations to fund the infrastructure that enables you to do all this, run your business, and make a profit.

https://forums.contribs.org/index.php?action=profile;area=subscriptions

Thanks.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Gathering Specific Emails
« Reply #10 on: September 29, 2021, 06:46:03 PM »
you can also put it in a new folder or the admin Maildir and just go throught them as they were regular email of the admin.
need chown admin:admin though

Re: Gathering Specific Emails
« Reply #11 on: October 02, 2021, 05:44:07 PM »
Once again, I appreciate everyone's replies/help. Going to try a few things this weekend and get back to y'all. Will tell our CFO, we need to make a donation immediately.

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Gathering Specific Emails
« Reply #12 on: October 02, 2021, 07:22:29 PM »
Once again, I appreciate everyone's replies/help. Going to try a few things this weekend and get back to y'all.

Let us know if you get stuck.

Quote
Will tell our CFO, we need to make a donation immediately.

If you need a receipt then let us know.

You'll get a shiny forum badge, appreciation from those of us who hack, and a glowy feeling that you have done a bit for open source ;-)

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation