Email backup

How to Download and Back Up Yahoo Mail

Updated 3 min read

On this page
  1. Download Yahoo Mail with mailmd
  2. Keep the archive separate from Yahoo
  3. Check what the backup contains
  4. Privacy and limits

To keep a copy of Yahoo Mail on your computer, download messages and save them separately from the mailbox. Email synchronization keeps an email app aligned with Yahoo. When you delete a message on Yahoo, the app also deletes its copy. A separate archive protects the local copy from that kind of deletion. Thunderbird’s explanation of IMAP synchronization describes this behavior.

For a local archive made of readable files, mailmd is free, open-source software that you run by typing commands in a terminal. It copies mail into Markdown files, which are plain-text files with simple formatting. It connects to Yahoo over IMAP, reads messages without changing them, and keeps downloaded files even if the messages are later deleted from Yahoo.

Download Yahoo Mail with mailmd #

IMAP, or Internet Message Access Protocol, is a way for an email program to access messages stored in a mailbox. mailmd uses IMAP for Yahoo and other IMAP mailboxes. Some providers require an app password, a separate password for an email program; mailmd tells you when one is needed.

On macOS or Linux, open a terminal. On Windows, use Git Bash. Install mailmd, connect the Yahoo account, and start the first download:

curl -fsSL https://raw.githubusercontent.com/vincentsch/mailmd/main/install.sh | sh
mailmd connect imap --email you@example.com
mailmd sync

Replace you@example.com with the Yahoo address. Follow the prompts to finish connecting. Enter the password yourself in mailmd rather than sharing it with another person or a coding agent.

By default, mail is saved under ~/mail/<account>. Each message becomes a Markdown file. Each file starts with message headers that include details such as the sender and subject. HTML messages become readable Markdown; attachments are saved alongside their messages. To preserve each message’s original .eml file too, use --keep-raw when syncing.

mailmd leaves spam and trash out unless you ask for them. Use --folder to choose folders, --exclude to leave folders out, and --since to limit the date range. Check your folder choices before relying on the archive, especially if you keep important messages outside the Inbox.

Keep the archive separate from Yahoo #

Run mailmd sync again to add new mail and update whether messages are marked as read or starred. mailmd never deletes files from the archive; if a message is later deleted from Yahoo, its saved file remains and is marked as deleted on the server. If a sync stops, run it again to continue.

For ongoing backups, schedule mailmd sync --quiet with your computer’s scheduler, such as cron, systemd, launchd, or Task Scheduler. Keep the archive folder in a separate backup location or in a normal backup service so a computer failure does not destroy both the mailbox copy and its backup.

The files are plain text and can be opened in an editor or note app. To search from a terminal, use rg or grep; to filter the message index, a file that lists saved messages, use jq with index.jsonl. mailmd does not include its own search engine.

Check what the backup contains #

After the first sync, open messages from different folders and dates, and open several saved attachments. Confirm that the folders you need were included. mailmd does not free space in Yahoo: the server keeps its messages until you delete them there yourself.

Yahoo’s help pages offer mixed information about downloading mailbox data directly, so check the current options in your account before relying on a Yahoo-provided export. Other desktop email programs also have export features, including formats such as PST and MBOX, but their exports include only messages that have finished downloading, so you may need to save another copy for safekeeping.

Privacy and limits #

mailmd only reads the mailbox: it does not mark messages as read, move or delete them, or send email. Login details are stored outside the archive and are readable only by your user account, but they are not encrypted. Protect the computer and any backup location accordingly. mailmd does not run a server of its own and sends no telemetry.

The archive is for reading and preserving mail. mailmd does not act as a mail client, restore messages to a mailbox, or convert mail to PST or PDF.

Free and open source

Try mailmd

mailmd is a free command-line tool that copies your email into Markdown files on your computer, one file per message. It works with any IMAP mailbox, and with Gmail and Outlook through their own APIs.

Install

$ curl -fsSL https://raw.githubusercontent.com/vincentsch/mailmd/main/install.sh | sh

Set it up with your coding agent

Set up mailmd so you can read my email. Use https://github.com/vincentsch/mailmd: read its AGENTS.md and follow the steps. Connect my mailbox and run the first sync. Then show me where the files are.

More on email backup