Email Importer

unlisted

by Obsidian Mail Importer

Import emails from an IMAP mailbox into your Obsidian vault as Markdown notes with attachments.

Updated 12d ago0BSD
View on GitHub

Email Importer

An Obsidian plugin that imports emails from an IMAP mailbox into your vault as Markdown notes. Unread emails are fetched, converted to Markdown with YAML frontmatter, and saved alongside their attachments.

Features

  • Connect to any IMAP server (SSL/TLS or STARTTLS)
  • Import unread emails as Markdown notes with YAML frontmatter
  • Convert HTML emails to Markdown (tables, headings, lists preserved)
  • Save attachments and inline images locally, linked in the note
  • Automatic sync on a configurable interval
  • Manual sync via ribbon icon or command palette
  • Duplicate filename handling with automatic numbering
  • Status bar progress indicator during sync

Installation

Manual Installation

  1. Download main.js, manifest.json, and styles.css from the latest release.
  2. Create a folder in your vault: <YourVault>/.obsidian/plugins/obsidian-mail-importer/
  3. Copy the three files into that folder.
  4. Restart Obsidian or reload plugins.
  5. Go to Settings → Community plugins, find "Email Importer", and enable it.

Configuration

Open Settings → Community plugins → Email Importer to configure the plugin.

IMAP Connection

SettingDescriptionDefault
HostIMAP server hostname(empty)
PortIMAP server port993
SecuritySSL/TLS (port 993) or STARTTLS (port 143)SSL/TLS
UsernameYour email account username(empty)
PasswordYour email account password(empty)

Mailbox

SettingDescriptionDefault
FolderIMAP folder to monitorINBOX

Import

SettingDescriptionDefault
Vault folderFolder in your vault where emails are savedEmails
IntervalAuto-sync interval in minutes (0 = manual only)0

Use the Test connection button to verify your IMAP settings. Use Sync now to trigger an immediate import.

Usage

Manual Sync

  • Click the mail icon in the ribbon (left sidebar), or
  • Open the command palette (Ctrl/Cmd + P) and run Email Importer: Sync now

Automatic Sync

Set the sync interval to a value greater than 0 in the plugin settings. The plugin will check for new emails at that interval (in minutes).

What Happens During Sync

  1. The plugin connects to your IMAP server.
  2. All unread emails in the configured mailbox are fetched.
  3. Each email is converted to a Markdown file with YAML frontmatter.
  4. Attachments and inline images are saved to a subfolder.
  5. Successfully imported emails are marked as read on the server.
  6. The connection is closed.

If an email fails to import, it remains unread and will be retried on the next sync.

File Format

Each imported email is saved as a Markdown file with the following structure:

Filename

YYYY-MM-DD HH-mm <Subject>.md

Special characters in the subject (/ \ : * ? " < > |) are replaced with -. If a file with the same name already exists, a counter is appended: (2), (3), etc.

Frontmatter

---
date: 2025-05-10T09:15:00+02:00
from: sender@example.com
to: recipient@example.com
cc: ""
subject: Invoice May 2025
messageId: <abc123@mail.example.com>
attachments:
  - invoice.pdf
  - logo.png
---

Body

The HTML body is converted to Markdown. Inline images are embedded as ![filename](path). File attachments are listed at the end as Obsidian wiki-links: [[path]].

Attachments

Attachments are stored in:

<ImportFolder>/attachments/<email-filename>/

Security Notice

⚠️ Password is stored in plaintext. Your IMAP password is saved unencrypted in Obsidian's data.json file within the plugin folder. This is a known limitation. Take appropriate precautions:

  • Use an app-specific password if your email provider supports it.
  • Be aware that anyone with access to your vault files can read the password.
  • Do not sync the .obsidian/plugins/obsidian-mail-importer/data.json file to untrusted locations.

The plugin disables IMAP client logging to prevent credentials from appearing in console output.

Troubleshooting

IssueSolution
Connection timeoutVerify host/port are correct. The plugin has a fixed 30-second timeout. Check firewall settings.
No emails importedEnsure there are unread emails in the configured mailbox folder.
Plugin not loadingConfirm main.js and manifest.json are in the plugin folder. Restart Obsidian.
Sync button does nothingA sync may already be in progress. Wait for it to complete.
Garbled textThe plugin handles standard MIME encodings. Severely malformed emails may not parse correctly.

Requirements

  • Obsidian Desktop (v1.0.0+)
  • This plugin is desktop only — it requires Node.js APIs for IMAP connections.

License

0-BSD

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.