Avatar of CEHJ
CEHJ
Flag for United Kingdom of Great Britain and Northern Ireland asked on

IMAP copying tool

Looking for a tool (Linux) that can copy Mbox folders (local) to folders on an IMAP server. Is there anything?
LinuxEmail ClientsEmail Servers

Avatar of undefined
Last Comment
arnold

8/22/2022 - Mon
Jesse Bruffett

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

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...
CEHJ

ASKER
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
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Scott Silva

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.
CEHJ

ASKER
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)
arnold

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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Tomas Helgi Johannsson

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
CEHJ

ASKER
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
arnold

What IMAP server is in use on the system where mail is stored in mbox format?
several IMAP servers include support for mbox formatted .......
CEHJ

ASKER
Not sure actually. I can't access it filesystem-wise though
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Scott Silva

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...
arnold

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.
CEHJ

ASKER
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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
arnold

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.