altra's profile picture
altra

email

Public

Email for LM Studio over IMAP/SMTP — search, read, list folders, and send across multiple accounts. Credentials stay on your machine.

406 Downloads

1 star

README

Email Plugin for LM Studio — AI Email Search, Read & Send via IMAP

Keywords: lm studio plugin, email ai, imap ai, local email assistant, gmail ai local, outlook ai, private email ai, read email with ai, no cloud, send email ai

Search, read, and send email across multiple accounts — using your actual IMAP inbox.

Supports up to 3 accounts simultaneously. Works with Gmail, Outlook, Yahoo, iCloud, Fastmail, and any IMAP provider.


What It Does

  • email_accounts — list configured accounts with slot numbers and labels
  • email_list — recent emails from any folder
  • email_search — search by keywords, sender, subject, date range, or unread status
  • email_read — full email body, headers, and attachment list
  • email_list_folders — all mailbox folders for an account
  • email_send — send or reply via SMTP

All processing happens locally. Your emails are never sent to any external service.


Who This Is For

  • Users wanting AI to search, summarize, and navigate their inbox without a cloud service
  • Power users managing multiple email accounts who want a unified AI interface
  • Privacy-conscious users who won't use cloud-based email AI tools — all processing stays on your machine
  • Anyone who wants to query, draft, and send email using natural language from LM Studio

Installation

cd email-plugin
npm install
npm run build

Load the plugin folder in LM Studio, then configure accounts in plugin settings.


Configuration

Up to 3 accounts. Each account has its own set of credentials.

FieldDescription
Account N — LabelFriendly name shown in responses (e.g. Work, Personal, Gmail)
Account N — IMAP Hoste.g. imap.gmail.com, outlook.office365.com
Account N — IMAP Port993 = SSL (recommended), 143 = STARTTLS
Account N — Email AddressYour full email address
Account N — Password / App PasswordPassword or app-specific password
Account N — SMTP Hoste.g. smtp.gmail.com. Leave blank to disable sending for this account
Account N — SMTP Port587 = STARTTLS (recommended), 465 = SSL
Default FolderMailbox folder used when folder param is blank (default: INBOX)
Max ResultsEmails returned per search/list call (default: 20)

Only Account 1 is required. Accounts 2 and 3 are optional — leave their labels blank to disable.

Gmail Setup

  • Enable IMAP: Gmail Settings → See all settings → Forwarding and POP/IMAP → Enable IMAP
  • Create an App Password: myaccount.google.com/apppasswords
  • IMAP Host: imap.gmail.com Port: 993
  • SMTP Host: smtp.gmail.com Port: 587
  • Use the App Password (not your Google password) in the Password field

Outlook / Microsoft 365

  • IMAP Host: outlook.office365.com Port: 993
  • SMTP Host: smtp-mail.outlook.com Port: 587

Multi-Account Usage

Every tool accepts an account parameter:

  • "1", "2", "3" — by slot number
  • "Work", "Personal", "Gmail" — by label (case-insensitive)
  • blank — uses the first configured account
email_list(account="Work")
email_search(query="invoice", account="2")
email_send(account="Personal", to="...", subject="...", body="...")

Example Queries

"What accounts do I have set up?" → email_accounts()

"Show my recent inbox" → email_list()

"Show unread emails on my work account" → email_list(account="Work", unseen=true)

"Find the contract Sarah sent last month" → email_search(from="sarah@company.com", subject="contract", since="2024-11-01")

"Search both accounts for that invoice" → email_search(query="invoice", account="1") then email_search(query="invoice", account="2")

"Reply to that email" → email_read(uid=...) → get messageId → email_send(reply_to_message_id=..., body=...)


Safety

email_send always requires explicit user confirmation before the LLM calls it — sending is irreversible. The system prompt instructs the model never to send without confirmation.

💚 Support Development

This plugin is free and open source. If you find it useful, consider supporting development:

Ko-fi
TierAmountPerks
☕ Coffee$3Name in credits
🍔 Lunch$10+ Priority support
🍕 Pizza$25+ Name in README
🏆 Founding$50+ Lifetime support, consultation

Every coffee helps keep this project alive! ☕