Email Channel
Section titled “Email Channel”Human can send and receive email via SMTP and IMAP. Messages are sent using curl over SMTP (TLS), and received by polling the INBOX with IMAP SEARCH UNSEEN.
Prerequisites
Section titled “Prerequisites”- Build with
-DHU_ENABLE_EMAIL=ONor-DHU_ENABLE_ALL_CHANNELS=ON curlavailable in PATH (used for SMTP send and IMAP polling)- SMTP and IMAP credentials for your email provider
Configuration
Section titled “Configuration”Add to ~/.human/config.json under channels.email:
{ "channels": { "email": { "smtp_host": "smtp.gmail.com", "smtp_port": 587, "from_address": "bot@gmail.com", "smtp_user": "bot@gmail.com", "smtp_pass": "your-app-password", "imap_host": "imap.gmail.com", "imap_port": 993 } }}Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
smtp_host | string | SMTP server hostname (required for send) |
smtp_port | number | SMTP port (default 587 for STARTTLS, 465 for implicit) |
from_address | string | Sender address (required) |
smtp_user | string | SMTP username (often same as from_address) |
smtp_pass | string | SMTP password or app password |
imap_host | string | IMAP server hostname (required for receive) |
imap_port | number | IMAP port (default 993 for IMAPS) |
Gmail app passwords
Section titled “Gmail app passwords”Gmail requires App Passwords when 2FA is enabled. Use an app password rather than your account password.
How it works
Section titled “How it works”Outbound (send)
Section titled “Outbound (send)”- Human writes a MIME plain-text email to a temp file
- Invokes
curlwith--url smtps://host:port(orsmtp://for non-TLS) - Sends via
--mail-from,--mail-rcpt,--upload-file - Port 587 uses STARTTLS; port 465 uses implicit TLS
Inbound (receive)
Section titled “Inbound (receive)”- Polls IMAP every 30 seconds (
SEARCH UNSEENorUID SEARCH UNSEEN UID N:*) - Fetches headers (From, Subject) and body text per message
- Uses sender address as session key; subject + body as content
- Requires both
imap_hostandsmtp_user/smtp_pass(IMAP uses same credentials)
Platform limitations
Section titled “Platform limitations”- Requires curl: The channel uses
curlfor both SMTP and IMAP. Ensure curl is installed and in PATH. - IMAP only: Receive uses IMAP; no POP3 support.
- Single mailbox: Polls INBOX only; no configurable folder.
- No attachments: Sends plain text only; attachments not supported.