IMAP copying tool

CEHJ
CEHJ used Ask the Experts™
on
Looking for a tool (Linux) that can copy Mbox folders (local) to folders on an IMAP server. Is there anything?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jesse BruffettM&F-ing Sorcerer

Commented:
i have to admit IMAP is not something ive messed with too much but couldn't you just use rsync?
Scott SilvaNetwork Administrator

Commented:
That might be a bit difficult but not impossible... You would have to script something to pick each mbox, somehow grab its username AND password, and forward that to the other server..... It would be much easier if both servers are under your control to first get both systems to match by not only username, but numbers, and user numbers...  Clone over the mbox folders to the proper location on the new server, and if you want them in a different format like Maildir, do the conversion on the new server...
Top Expert 2016

Author

Commented:
No, i can't access the target's filesystem. It's shared hosting. IMAP access only. Closest i find so far is https://linux.die.net/man/1/imapsync
The problem is that the source is an mbox file, not an IMAP server
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Scott SilvaNetwork Administrator

Commented:
Is the source just mbox files? Or is it a linux server that you could get IMAP running on?

How many users?

If only a couple users you could load the mbox locally in an email client, ( you at least used to be able to do this with Thunderbird, or convert the mbox to PST for outlook)...

Log into the remote imap server and copy the messages across...

If it is a lot of users, then setting up local IMAP and making sure it can access each mbox in its configured user directory would be easiest. Then you could use imapsync.
Top Expert 2016

Author

Commented:
Is the source just mbox files? Or is it a linux server that you could get IMAP running on?
Yes - or i'd have said so ;)

I'm currently manually copying using Thunderbird. It's a PITA (and error-prone)
Distinguished Expert 2017

Commented:
Use an IMAP server that supports mbox format such as dovecot.

Another option is to convert mbox2Maildir ...... Ending up in the same state where imapsync can be used to copy from local IMAP to another.
Database Administrator / Software Engineer
Commented:
Hi!

You can use this script to upload .mbox files to IMAP server

Regards,
    Tomas Helgi
Top Expert 2016

Author

Commented:
Great. Unfortunately your about 12 hours too late with that - i've done them all manually ;)
If you can find something that will merge remote IMAP folders, that would be genius
Distinguished Expert 2017

Commented:
What IMAP server is in use on the system where mail is stored in mbox format?
several IMAP servers include support for mbox formatted .......
Top Expert 2016

Author

Commented:
Not sure actually. I can't access it filesystem-wise though
Scott SilvaNetwork Administrator

Commented:
I would assume the files got there via some kind of mail server application... But its done now, so at least the OP can move on to the next problem...
Distinguished Expert 2017

Commented:
Mbox formatted messages are in /var/mail/ or /var/spool/mail often one refers to the other the mailbox is named after the user whom it is accepting/storing messages.
Top Expert 2016

Author

Commented:
Yes, but unfortunately that's academic - i have no access to that (part of the) filesystem. I need a tool that can reconcile folders _X and X into X without duplicating messages
Distinguished Expert 2017

Commented:
What do you mean, of course a person has access to their mbox file in that location otherwise mail, mutt, pine and other mail clients would be unable to function.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial