Koozali.org: home of the SME Server

moving email from one user to another

Offline david000

  • *****
  • 203
  • +0/-0
moving email from one user to another
« on: January 05, 2017, 03:10:48 PM »
Hi all,

I have a set of couple of hundred emails in a sub folder and would like to move them to a different SME user email account, 'as is'.   

Forwarding appears to change the 'from' address which I need to maintain intact.

Any suggestions appreciated.

Best


David

Offline Daniel B.

  • *
  • 1,700
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: moving email from one user to another
« Reply #1 on: January 05, 2017, 03:37:27 PM »
You can copy mails directly from the filesystem (from /home/e-smith/files/users/userA/Maildir/.INBOX.subfolder to /home/e-smith/files/users/userB/Maildir/.INBOX.subfolder) with cp, or rsync. Just be sure to chown the files to the destination user after the copy
C'est la fin du monde !!! :lol:

Offline david000

  • *****
  • 203
  • +0/-0
Re: moving email from one user to another
« Reply #2 on: January 05, 2017, 04:22:17 PM »
Thanks - I'll give that a go :)

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: moving email from one user to another
« Reply #3 on: January 05, 2017, 04:54:54 PM »
Or use imapsync

Offline david000

  • *****
  • 203
  • +0/-0
Re: moving email from one user to another
« Reply #4 on: January 05, 2017, 05:21:45 PM »
Or use imapsync

Thanks, I'll read the notes..

Offline mmccarn

  • *
  • 2,653
  • +10/-0
Re: moving email from one user to another
« Reply #5 on: January 06, 2017, 01:34:08 PM »
The wiki page for Imapsync still directs you to use the dag repo, which has been retired.  Hidden in the instructions is the note that for SME8 or SME9 you'll need to use the Epel repo instead.

You can also setup both accounts in Thunderbird and drag the folder from one to the other...

The Imapsync docs include a list of similar tools at the bottom; Imapcopy was the easiest to use (simplest syntax).

Offline turandot

  • *
  • 82
  • +0/-0
Re: moving email from one user to another
« Reply #6 on: January 06, 2017, 01:40:44 PM »
You can also setup both accounts in Thunderbird and drag the folder from one to the other...

This is what I would have recommended: an easy and straight forward approach, I used this a dozen times in the past.

Offline david000

  • *****
  • 203
  • +0/-0
Re: moving email from one user to another
« Reply #7 on: January 06, 2017, 02:16:27 PM »
I have installed imapsync but I confess that my linux command line skills are probably not up to it.   I had got as far as looking up what 'chown' is about so that I could try the direct copy approach when I saw the Thunderbird suggestion !

I'll try the Thunderbird approach. It may be handy for archiving old mail as well.. 

UPDATE:   Thunderbird worked very well :)   

Is there a good way of using it to archive mail in a way that can be searched (if needed) at a later date ?
« Last Edit: January 06, 2017, 02:52:58 PM by david000 »

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: moving email from one user to another
« Reply #8 on: January 06, 2017, 03:57:57 PM »
Give some time, I'll post a solution

Offline david000

  • *****
  • 203
  • +0/-0
Re: moving email from one user to another
« Reply #9 on: January 06, 2017, 04:06:04 PM »
Give some time, I'll post a solution

Cheers, much appreciated :)

Offline mmccarn

  • *
  • 2,653
  • +10/-0
Re: moving email from one user to another
« Reply #10 on: January 07, 2017, 02:53:40 PM »
...
Is there a good way of using it to archive mail in a way that can be searched (if needed) at a later date ?

If it fits your use case, Thunderbird will do this, too.

I find Thunderbird's indexing fantastic.  A workstation running Thunderbird configured to fully sync all mail in all folders provides a good poor mans email search solution.

For searching only one or two accounts, just add them to Thunderbird and let it sync.

For searching your entire server, consider creating an archive mailbox and keeping copies of all email using Bcc and BccMode.

If you don't mind Google reading your mail, you could  create a Gmail account that syncs all the email you want to search - either lots of individual mailboxes or using Bcc / BccMode.

There's a wiki page for MailArchiva, but the version it uses hasn't been updated since 2009.

Offline david000

  • *****
  • 203
  • +0/-0
Re: moving email from one user to another
« Reply #11 on: January 09, 2017, 10:26:27 AM »
Quote from: mmccarn
If it fits your use case, Thunderbird will do this, too.


Cheers, a plan is starting to form  :-P