This plugin allows you to receive emails directly in your Obsidian vault. It consists of two parts:
- An Obsidian plugin that creates notes from emails
- An API service that receives emails via SMTP and makes them available to the plugin
- Receive emails as Obsidian notes
- Automatically save email attachments
- Real-time notifications for new emails
- Configure where emails are saved in your vault
Note
This plugin is currently in its alpha state, and I welcome feedback to enhance its functionality and stability.
-
Before installing, ensure you have the BRAT Obsidian plugin installed and running.
-
Then follow the BRAT instructions.
-
When prompted, use
vault-bridges/obsidian-email-plugin
as the plugin name to add it to your Obsidian setup.
- Go to Settings > Community plugins > Email Plugin.
- Configure the following settings:
- Service URL: The URL of your email API service (e.g.,
https://your-email-api.example.com
) - Service API Key: The authentication key for your email service
- Email Save Path: The folder path where emails will be saved in your vault (e.g.,
emails
)
- Service URL: The URL of your email API service (e.g.,
Once configured, the plugin will:
- Connect to the email service and listen for new emails
- Create a new note for each email received
- Save any attachments to the specified folder
- Show notifications when new emails arrive
Each email note will contain:
- The email content (HTML or text)
- Links to any attachments
The API service is a Node.js application that:
- Runs an SMTP server to receive emails
- Stores emails in a database
- Provides an API for the Obsidian plugin to fetch emails
- Node.js v16 or higher
- SSL certificates for secure SMTP (key.pem and cert.pem)
- A domain name for receiving emails
- Clone the repository
- Provide env variables from the next section
- Install dependencies with
pnpm install
The API service is configured using environment variables:
API_HOST
: Host to bind the API server (default: localhost)API_PORT
: Port for the API server (default: 80)API_TOKEN
: Authentication token for API requests
SMTP_HOST
: Host to bind the SMTP server (default: localhost)SMTP_PORT
: Port for the SMTP server (default: 25)SMTP_SECURE
: Whether to use SSL/TLS (true/false)SMTP_PROXY
: Whether to use proxy protocol (true/false)SMTP_KEY
: Path to SSL key file (default: key.pem)SMTP_CERT
: Path to SSL certificate file (default: cert.pem)SMTP_DOMAIN
: Domain name for receiving emails (default: localhost)
DB_PATH
: Path to the database file (default: ./emails.db)
Start the service with:
node api/index.ts
For production use, consider using a process manager like PM2:
pnpm install -g pm2
pm2 start api/index.ts --name email-api
If you want to contribute to the plugin or modify it for your own needs:
- Clone the repository
- Install dependencies with
pnpm install
- Run
pnpm run dev
to start the compilation in watch mode - Make changes to the TypeScript files
- Reload Obsidian to test your changes
For convenience, you can clone the repository directly into your .obsidian/plugins/obsidian-email-plugin
folder for easier testing.
If you want to modify the API service:
- Navigate to the
api
directory - Make your changes to the TypeScript files
- Run
node --experimental-strip-types index.ts
- Restart the service to apply changes
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- The Obsidian team for creating an amazing knowledge management tool
- All contributors who have helped improve this plugin
If you need help with the plugin, please open an issue on GitHub or reach out through the Obsidian community forums.