email-imap-append
Skill11 starsChanged 3 months agoMITView on GitHub
Compose unsent email drafts (with optional attachments) and append them to an IMAP mailbox via APPEND (typically Drafts) without sending. Use when tasks need to save draft messages for human review, prefill reply templates, stage outbound content inside mailbox folders before manual send, or prepare draft attachments in mailbox-native format.
- Reads credentials
In this repository62 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academic-paper-downloadSkill
- airnow-hourly-obs-fetchSkill
- ai-tech-fulltext-fetchSkill
- ai-tech-rss-fetchSkill
- ai-tech-summarySkill
- apply-environmental-thinkingSkill
- bluesky-cascade-fetchSkill
- convert-image-to-jpgSkill
- dify-knowledge-base-searchSkill
- dify-knowledge-base-uploadSkill
- document-granular-decomposeSkill
- domain-onboardingSkill
- eceee-news-fulltext-fetchSkill
- email-imap-fetchSkill
- email-imap-full-fetchSkill
- email-smtp-sendSkill
- epa-eis-records-fetchSkill
- federal-register-doc-fetchSkill
- fetch-abstract-to-kbSkill
- fetch-meta-from-kbSkill
- fetch-meta-to-kbSkill
- figshare-data-downloadSkill
- gdelt-doc-searchSkill
- gdelt-events-fetchSkill
- gdelt-gkg-fetchSkill
- gdelt-mentions-fetchSkill
- gdelt-web-ngrams-searchSkill
- github-contribution-period-analysisSkill
- nasa-firms-fire-fetchSkill
- notebooklmSkill
- openaq-data-fetchSkill
- open-meteo-air-quality-fetchSkill
- open-meteo-flood-fetchSkill
- open-meteo-historical-fetchSkill
- regulationsgov-attachments-fetchSkill
- regulationsgov-comment-detail-fetchSkill
- regulationsgov-comments-fetchSkill
- remove-similar-imageSkill
- river-outfall-status-visualizerSkill
- sustainability-fulltext-fetchSkill
- sustainability-rss-fetchSkill
- sustainability-summarySkill
- synology-file-stationSkill
- tiangong-auto-researchSkill
- tiangong-auto-research-workbuddySkill
- tiangong-kb-course-fulltext-fetchSkill
- tiangong-kb-course-searchSkill
- tiangong-kb-edu-searchSkill
- tiangong-kb-esg-searchSkill
- tiangong-kb-ingestSkill
- tiangong-kb-patent-searchSkill
- tiangong-kb-report-searchSkill
- tiangong-kb-sci-searchSkill
- tiangong-kb-textbook-searchSkill
- tsinghua-graduate-thesisSkill
- usbr-project-records-fetchSkill
- usbr-rise-fetchSkill
- use-thuenv-presentation-styleSkill
- usgs-water-iv-fetchSkill
- The first 60 shown.
The file
Files
Email IMAP Append
Core Goal
- Build RFC 5322 draft messages with subject/body/recipients.
- Attach local files into draft MIME payload when requested.
- Append the draft MIME into an IMAP mailbox using
APPEND. - Set draft flags (default
\\Draft) and keep the message unsent. - Return machine-readable JSON with append status and server response metadata.
Workflow
- Configure IMAP env vars (see
references/env.mdandassets/config.example.env). - Validate config and defaults:
python3 scripts/imap_append.py check-config- Append one draft email to Drafts mailbox:
python3 scripts/imap_append.py append-draft \
--to reviewer@example.com \
--subject "Draft: quarterly update" \
--body "Please review this draft before sending."- Append HTML draft with explicit mailbox and flags:
python3 scripts/imap_append.py append-draft \
--mailbox "Drafts" \
--flags "\\Draft,\\Seen" \
--content-type html \
--subject "Draft: release note" \
--body "<p>Release note draft for approval.</p>"- Append draft with attachments:
python3 scripts/imap_append.py append-draft \
--to reviewer@example.com \
--subject "Draft: WG2 package" \
--body "See attached draft tables." \
--attach ./wg2-table.xlsx \
--attach ./notes.docxOutput Contract
check-configprints sanitized IMAP + append defaults as JSON.append-draftsuccess prints onetype=statusJSON object containing:event=imap_draft_appendedaccount,mailbox,subject,message_id- recipient lists and counts
flagsattachment_countandattachments[]metadataappend_uidvalidityandappend_uidwhen server returnsAPPENDUID
append-draftfailure printstype=errorJSON to stderr withevent=imap_append_failed.
Parameters
append-draft --to: optional recipient, repeatable or comma-separated.append-draft --cc: optional CC recipient list.append-draft --bcc: optional BCC recipient list.append-draft --subject: optional subject (defaults from env).append-draft --body: optional body (defaults from env).append-draft --content-type:plainorhtml.append-draft --from: optional sender override.append-draft --mailbox: target mailbox (defaultIMAP_APPEND_MAILBOX, thenIMAP_MAILBOX, thenDrafts).append-draft --flags: append flags, comma-separated (default\\Draft).append-draft --message-id: explicit Message-ID header.append-draft --in-reply-to: optional In-Reply-To header.append-draft --references: optional References header.append-draft --attach: local attachment path, repeatable or comma-separated.append-draft --max-attachment-bytes: max bytes allowed per attachment.
Required Environment
IMAP_HOSTIMAP_USERNAMEIMAP_PASSWORD
Optional defaults:
IMAP_NAMEIMAP_PORTIMAP_SSLIMAP_CONNECT_TIMEOUTIMAP_MAILBOXIMAP_APPEND_MAILBOXIMAP_APPEND_FLAGSIMAP_APPEND_FROMIMAP_APPEND_TOIMAP_APPEND_CCIMAP_APPEND_BCCIMAP_APPEND_SUBJECTIMAP_APPEND_BODYIMAP_APPEND_CONTENT_TYPEIMAP_APPEND_MAX_ATTACHMENT_BYTES
References
references/env.md
Assets
assets/config.example.env
Scripts
scripts/imap_append.py
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

