Y.jg31 downloadsImport encrypted diary emails from an IMAP mailbox into Markdown notes in your vault.
English | 简体中文
Import encrypted diary emails from an IMAP mailbox into Markdown notes in your Obsidian vault.
Treehole Diary (树洞日记) is an Android app focused on one thing: writing. Each entry is sent by email to your own mailbox, and no copy is kept on the phone after a successful delivery. This plugin is the receiving side: it fetches those emails over IMAP, decrypts them locally, and merges them into Markdown notes in your vault. The source code of the companion Android app is not part of this repository.
The plugin works on desktop only because it uses the Node.js crypto module and an IMAP client.
assets/YYYY-MM-DD/; no empty folders are created for days without photos..treehole bootstrap config exported by the phone app with a single paste, without typing server settings by hand.From the community plugin directory: select Settings → Community plugins → Browse, search for Treehole Diary, then install and enable the plugin.
Manually: download main.js, manifest.json, and styles.css from Releases and place them in <vault>/.obsidian/plugins/shudong-diary/. Restart Obsidian and enable the plugin. The folder name follows the plugin ID shudong-diary, which differs from the display name.
imap.<your email domain> on port 993 with TLS; check your provider if that does not work..treehole file.You can also add an account manually in the plugin settings (email address, IMAP host, authorization code, and optional older authorization codes). If you have replaced your authorization code, add the old one as an alternative so that older emails can still be decrypted.
All files are written to the output folder configured in the settings (树洞日记/ by default):
YYYY-MM-DD.md — one note per day. These files are the local source of truth; deleting the emails does not delete them.assets/YYYY-MM-DD/ — photos for that day, created only when photos exist.index.md — an index of dates.all_entries.md and all_entries_text.md — full collections with and without images; the first heading includes the date range..obsidian/plugins/shudong-diary/data.json and are never uploaded.Network use (disclosure required by the Obsidian developer policies): this plugin connects only to the IMAP server you configure yourself (or one derived from your email address when left blank, port 993, TLS). It reads messages whose subject starts with Log and contains a YYYY-MM-DD date, downloads their bodies and attachments, and decrypts them locally. It does not send diary content, credentials, or telemetry to the plugin author or to any other service. No other network endpoints are used.
Entry text and attachments use AES-256-GCM. The key comes from the bootstrap config exported by the app; older entries use a key derived from the mailbox authorization code. The bootstrap file itself is an envelope encrypted with a one-time passphrase. See src/crypto.ts for the algorithm details. The plugin never uploads the key and never keeps a copy of the emails.
Requires Node.js 20 or later.
npm ci
npm run build # Type check with tsc, then bundle main.js with esbuild
npm test # Encryption alignment and envelope tests
npm run check # Pre-submit checks: version consistency, manifest rules, required files
npm run notices # Regenerate third-party license notices after dependency updates
manifest.json, package.json, and versions.json (add "x.y.z": "minAppVersion").npm run build && npm run check.v prefix (for example 0.1.0).main.js, manifest.json, and styles.css.chnyjg/Treehole-Diary. The review is automated; to address its feedback, update the repository, increment the version, and publish a new Release. After the plugin is published, later versions only need a new Release, not another directory submission.main.js is a build artifact and is excluded by .gitignore. Take it from the repository root when you create the Release.
See THIRD_PARTY_NOTICES.md and the licenses/ folder. Main runtime dependencies include imapflow (MIT), mailparser (MIT), and nodemailer (MIT-0).