Features
- ✅ IMAP polling for incoming mail
- ✅ SMTP for sending replies
- ✅ Email address-based access control
- ✅ Automatic reply mode
- ✅ Consent-based mailbox access
- ✅ Gmail and other providers supported
Prerequisites
- A dedicated email account for your bot (e.g., Gmail)
- IMAP and SMTP access enabled
- App-specific password (if using Gmail)
Setup
Create dedicated email account
Create a new email account for your bot:
- Gmail: Create account at https://accounts.google.com/signup
- Or use any email provider with IMAP/SMTP support
[email protected]Enable IMAP access
For Gmail:
- Go to Gmail Settings → See all settings
- Click Forwarding and POP/IMAP tab
- Under IMAP access, select Enable IMAP
- Click Save Changes
Generate app password
For Gmail:
- Go to Google Account settings
- Enable 2-Step Verification if not already enabled
- Go to App Passwords
- Select app: Mail
- Select device: Other (enter “nanobot”)
- Click Generate
- Copy the 16-character app password
Use this app password for both IMAP and SMTP in the config
Test the connection
- Send an email to your bot’s address (e.g.,
[email protected]) - Wait for IMAP polling (usually a few seconds)
- Your bot should reply automatically!
Configuration Options
Enable the email channel
Safety gate: Must be
true to allow mailbox accessSet to false to fully disable email channel without removing config.IMAP server hostnameCommon values:
- Gmail:
imap.gmail.com - Outlook:
outlook.office365.com - Yahoo:
imap.mail.yahoo.com
IMAP server port (usually
993 for SSL)IMAP username (usually your full email address)
IMAP password (use app password for Gmail)
SMTP server hostnameCommon values:
- Gmail:
smtp.gmail.com - Outlook:
smtp.office365.com - Yahoo:
smtp.mail.yahoo.com
SMTP server port (usually
587 for TLS or 465 for SSL)SMTP username (usually your full email address)
SMTP password (use app password for Gmail)
Use STARTTLS for SMTP (default:
true for port 587)Use SSL for SMTP (default:
false, set true for port 465)Email address to send replies from (usually same as bot’s email)
List of email addresses allowed to interact with the botExamples:
- Single email:
["[email protected]"] - Multiple:
["[email protected]", "[email protected]"] - All emails:
["*"](not recommended)
If
false, bot reads/analyzes emails but doesn’t send automatic repliesCommon Email Providers
- Gmail
- Outlook / Office 365
- Yahoo Mail
Read-Only Mode
Using email channel without auto-reply
Using email channel without auto-reply
If you want nanobot to read and analyze emails without sending automatic replies:SMTP settings are optional when
autoReplyEnabled is false.Troubleshooting
Authentication failed (Gmail)
Authentication failed (Gmail)
Common Gmail authentication issues:
- Not using app password:
- Don’t use your regular Gmail password
- Generate app password: https://myaccount.google.com/apppasswords
- 2-Step Verification not enabled:
- App passwords require 2FA to be enabled
- Enable at: https://myaccount.google.com/security
- IMAP not enabled:
- Gmail Settings → Forwarding and POP/IMAP → Enable IMAP
- Less secure apps:
- Google deprecated this option
- Use app passwords instead
Connection timeout
Connection timeout
If IMAP/SMTP connection times out:
- Check firewall settings (ensure ports 993 and 587 are open)
- Verify server hostnames are correct
- Try different ports (465 for SSL SMTP)
- Check internet connectivity
- Verify email provider doesn’t block automated access
Bot doesn't respond to emails
Bot doesn't respond to emails
- Verify sender email is in
allowFromlist - Check
consentGrantedis set totrue - Check
autoReplyEnabledis not set tofalse - Look for errors in logs:
nanobot gateway -v - Verify SMTP settings are correct
- Check email quotas (some providers limit sends per day)
TLS/SSL errors
TLS/SSL errors
If you see TLS or SSL errors:For port 587 (STARTTLS):For port 465 (SSL):
Emails marked as spam
Emails marked as spam
If bot replies are marked as spam:
- Use a proper
fromAddress(not a personal email) - Add SPF/DKIM records if using custom domain
- Avoid spammy content in replies
- Don’t send too many emails too quickly
- Ask recipients to mark as “Not Spam”
Complete Example
Full configuration with all options:Related Pages
Configuration Overview
Learn about channel configuration
Security Settings
Set up access control