LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old Yesterday, 09:05 PM   #1
exerceo
Member
 
Registered: Oct 2022
Posts: 79

Rep: Reputation: 18
Question Which command-line tool can back up an entire IMAP mail account?


[Log in to get rid of this advertisement]
I want to create an automated backup script. Which command-line tool can download/export an entire IMAP email account (including all folders and outbox)?

Requirements:
- eml or some other non-proprietary format.
- Preserve attachments. Normally, they are contained inside the eml file.
- It needs to be a non-interactive command-line tool so it can be accessed from scripts. Non-interactive means it shouldn't stop and ask questions. This would break scripts.

Optional extras:
- Ideally, reproduce the directory structure of the email inbox locally. This means create a local folder for every email account folder. But I can also do that manually.
- Ideally, do not mark emails as read when downloading like Thunderbird does. I only want stuff mark as read when I actually, you know, read it.

Why not POP3? Because it only gets the main inbox folder, no other folders and no outbox.

Last edited by exerceo; Yesterday at 09:07 PM.
 
Old Today, 12:16 AM   #2
lvm_
Senior Member
 
Registered: Jul 2020
Posts: 1,456

Rep: Reputation: 499Reputation: 499Reputation: 499Reputation: 499Reputation: 499
I think just about any mail client can do it. Thunderbird definitely can, and it uses maildir format lately. So does offlineIMAP, if your are looking for command line tools.
 
Old Today, 07:49 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,548

Rep: Reputation: 8130Reputation: 8130Reputation: 8130Reputation: 8130Reputation: 8130Reputation: 8130Reputation: 8130Reputation: 8130Reputation: 8130Reputation: 8130Reputation: 8130
Quote:
Originally Posted by exerceo View Post
I want to create an automated backup script. Which command-line tool can download/export an entire IMAP email account (including all folders and outbox)?

Requirements:
- eml or some other non-proprietary format.
- Preserve attachments. Normally, they are contained inside the eml file.
- It needs to be a non-interactive command-line tool so it can be accessed from scripts. Non-interactive means it shouldn't stop and ask questions. This would break scripts.

Optional extras:
- Ideally, reproduce the directory structure of the email inbox locally. This means create a local folder for every email account folder. But I can also do that manually.
- Ideally, do not mark emails as read when downloading like Thunderbird does. I only want stuff mark as read when I actually, you know, read it.

Why not POP3? Because it only gets the main inbox folder, no other folders and no outbox.
Did you do any research on this??? Several tools exist, and as lvm_ said, any email client can do this as well. There is imapsync and imap-backup, both of which are on github and are fairly current.
 
Old Today, 02:27 PM   #4
exerceo
Member
 
Registered: Oct 2022
Posts: 79

Original Poster
Rep: Reputation: 18
Lightbulb

Quote:
Originally Posted by TB0ne View Post
Several tools exist, and as lvm_ said, any email client can do this as well.
I know that many tools exist, but I want a non-proprietary non-vendor-locked format like eml. Thunderbird stores it in some difficult-to-access database format and does not seem to automatically store attachments. And its eml export feature automatically marks emails as read, which is unwanted.

I want eml files with the attachments included. But thanks, I will try out these tools.

Last edited by exerceo; Today at 02:33 PM. Reason: why Thunderbird isn't satisfactory
 
  


Reply

Tags
email



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
After copying a file using "dd" command, how can I open that single file which contains an entire usb drive? hddfsck Linux - Newbie 16 10-01-2019 12:57 PM
[SOLVED] Replace an "entire" line containing a particular string with a new line kushalkoolwal Programming 4 03-12-2010 04:04 PM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 10:02 AM
courier imap can't auth. imap and pop3 adrianmak Linux - Software 1 12-11-2005 04:22 PM
IMAP serves entire user directory fitzage Linux - Networking 0 07-11-2003 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration