Agent Email Setup
/install agent-email-setup
Agent Email Setup
Purpose
Provide dedicated email accounts for AI agents with clear role separation and approval workflows. Prevents mixing of responsibilities (e.g., Ace shouldn't handle Contabo support tickets).
When to Use
Set up email for agent when:
- Agent needs external communications (Lourens, Ace)
- Role separation is important
- Audit trail needed for communications
- Professional identity required
Do NOT set up email for:
- Internal-only agents (Bob, Scout)
- Agents without external communication needs
- Temporary/task-specific agents
Architecture
Email Address Strategy
@supplystoreafrica.com domain:
- lourens@ → SysAdmin (infrastructure, support tickets)
- ace@ → Competitions (entries, prize notifications)
- facet@ → CAD (manufacturer communications) - if needed
Forwarding Rules
- All agent emails forward to:
[email protected] - CC on all sent emails:
[email protected] - Maintain separate sent folders per agent
Role Separation
| Agent | Purpose | External Comms | |
|---|---|---|---|
| Lourens | lourens@ | Infrastructure, support tickets, system issues | ✅ Required |
| Ace | ace@ | Competition entries, prize notifications | ✅ Required |
| Facet | facet@ | Manufacturer inquiries, technical specs | ⚠️ Optional |
| Bob | - | Internal coordination only | ❌ Not needed |
| Scout | - | Research, no external comms | ❌ Not needed |
Workflow
1. Sandbox Testing (ALWAYS FIRST)
# Create sandbox environment
python3 /root/.openclaw/workspace/sandbox_lourens_email.py
# Test configuration
cd /tmp/lourens_email_sandbox_*/ && python3 test_email_workflow.py
2. Production Setup
Step 1: Create Email Account
- Log into hosting control panel
- Create email account:
[email protected] - Set strong password (store in Bitwarden)
- Configure forwarding to
[email protected]
Step 2: Configure IMAP/SMTP
{
"imap_server": "mail.supplystoreafrica.com",
"imap_port": 993,
"smtp_server": "mail.supplystoreafrica.com",
"smtp_port": 587,
"username": "[email protected]",
"password": "{{BITWARDEN_PASSWORD}}"
}
Step 3: Agent Configuration
Add to agent's workspace:
# Create email config
mkdir -p /root/.openclaw/agents/{agent}/workspace/email/
cat > /root/.openclaw/agents/{agent}/workspace/email/config.json \x3C\x3C 'EOF'
{{
"email": "{agent}@supplystoreafrica.com",
"display_name": "{Agent Name} {Role}",
"signature": "Best regards,\\
\\
{Agent Name}\\
{Role} Agent\\
Supply Store Africa\\
{agent}@supplystoreafrica.com",
"forward_to": ["[email protected]"],
"auto_cc": ["[email protected]"]
}}
EOF
Step 4: Update OpenClaw Configuration
# Add email tools to agent
openclaw config set agents.list[{index}].tools.allow+=email_send
openclaw config set agents.list[{index}].tools.allow+=email_check
3. Email Templates
Generic Template
TO: {recipient}
FROM: {Agent Name} {Role} \x3C{agent}@supplystoreafrica.com>
CC: Stef Ferreira \[email protected]>
SUBJECT: {subject}
DATE: {date}
{greeting},
{body}
{signature}
Contabo Support Template (Lourens)
TO: [email protected]
FROM: Lourens SysAdmin \[email protected]>
CC: Stef Ferreira \[email protected]>
SUBJECT: {ticket_subject}
DATE: {date}
Dear {support_agent},
{content}
Current system status:
- VPS: 161.97.110.234
- Ticket: {ticket_number}
- Issue: {issue_description}
We appreciate your assistance.
Best regards,
Lourens
SysAdmin Agent
Supply Store Africa
[email protected]
Competition Entry Template (Ace)
TO: [email protected]
FROM: Ace Competitions \[email protected]>
CC: Stef Ferreira \[email protected]>
SUBJECT: Entry: {competition_name}
DATE: {date}
Dear Competition Team,
Please accept my entry for {competition_name}.
{entry_details}
Thank you for this opportunity.
Best regards,
Ace
Competitions Agent
Supply Store Africa
[email protected]
4. Approval Workflow
ALL external emails require approval:
- Draft created in
/root/.openclaw/workspace/drafts/ - Presented to Stef in chat interface
- Wait for explicit "approved" or "send it"
- Send only after approval
- Log sent email
Approval triggers:
- "Approved"
- "Send it"
- "Go ahead"
- "Yes, send that"
NOT approved by:
- "Looks good" (ambiguous)
- "OK" (ambiguous)
- Silence (never assume)
5. Migration Process
When moving communications between agents:
- Set up new agent email
- Forward thread to new agent email
- Send notification: "Future communications: [email protected]"
- Update contact information with external party
- Archive old agent's involvement
Example: Contabo migration from Ace to Lourens
- Create
[email protected] - Forward Contabo thread to Lourens
- Email Contabo: "Future updates: [email protected]"
- Ace focuses only on competitions
Testing Checklist
Sandbox Test
- Configuration files created
- Templates work correctly
- Draft generation tested
- Approval workflow simulated
- No syntax errors
Production Test
- Email account created
- IMAP/SMTP connectivity
- Send test email (to self)
- Receive test email
- Forwarding to [email protected] works
- CC on sent emails works
Integration Test
- Agent can access email
- Draft creation works
- Approval workflow functional
- Sent emails logged
- Error handling works
Error Handling
Common Issues
- IMAP connection failed: Check credentials, firewall, port
- SMTP rejected: Check authentication, port 587 vs 465
- Email not forwarding: Check hosting panel settings
- CC not working: Check email client configuration
Recovery Procedures
# Test IMAP
openssl s_client -connect mail.supplystoreafrica.com:993 -crlf
# Test SMTP
openssl s_client -connect mail.supplystoreafrica.com:587 -starttls smtp
# Check logs
tail -f /var/log/mail.log
Security
Credential Management
- Store passwords in Bitwarden
- Never hardcode in scripts
- Use environment variables
- Rotate passwords periodically
Access Control
- Agents only access their own email
- No cross-agent email access
- All emails CC'd to human oversight
- Sent items archived for audit
Monitoring
- Failed login attempts logged
- Unusual sending patterns flagged
- Regular access review
- Password rotation schedule
Maintenance
Daily
- Check sent items logged
- Verify forwarding working
- Monitor for failed sends
Weekly
- Review email logs
- Check storage quotas
- Update templates if needed
Monthly
- Password rotation
- Audit access logs
- Review security settings
Related Skills
email-approval-workflow- Draft and approval processgmail-gog-setup- Alternative email configurationsecure-secret-sharing- For credential sharing if neededagent-lourens- Lourens-specific configurationace-competitions- Ace-specific configuration
Critical: Agent Knowledge Transfer Protocol
Issue Discovered (March 31, 2026): Facet reported "I have no skills, haven't learned anything yet"
Root Cause: Agents configured but had empty workspaces - no knowledge transfer
What MUST Be Transferred When Creating Agents
- Identity - Who they are (IDENTITY.md, SOUL.md)
- User Context - Who Stef is (USER.md)
- System Knowledge - What we've built (MEMORY.md, AGENTS.md)
- Skills & Learning - What they can do (skill-specific docs)
- Memory & History - What we've learned (memory/ files)
- Tool Access - read tool required to access workspace
Knowledge Transfer Procedure
# Run knowledge transfer script
python3 /root/.openclaw/workspace/setup_agent_knowledge.py --agent {agent_name}
# Verify transfer
ls -la /root/.openclaw/agents/{agent}/workspace/
cat /root/.openclaw/agents/{agent}/workspace/IDENTITY.md
Protocol Document
AGENT_TRANSFORMATION_PROTOCOL.md- Complete transfer proceduresetup_agent_knowledge.py- Automation script
Result: All agents (Lourens, Ace, Scout, Facet) now have complete knowledge and are proper assistants.
Lessons Learned
From Contabo Experience:
- Role confusion: Ace shouldn't handle infrastructure emails
- Email identity: Professional email addresses matter
- Approval workflow: Essential for external communications
- Migration planning: Need clear handover process
From Knowledge Transfer Issue:
- Empty workspaces: Agents need complete knowledge transfer
- Identity files: Must include IDENTITY.md, SOUL.md, USER.md
- System context: MEMORY.md and AGENTS.md essential
- Tool access: read tool required to access workspace files
Best Practices:
- Always sandbox test first
- Document configuration thoroughly
- Maintain role separation
- Human oversight on all external comms
- Regular security reviews
- Complete knowledge transfer for new agents
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install agent-email-setup - 安装完成后,直接呼叫该 Skill 的名称或使用
/agent-email-setup触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Agent Email Setup 是什么?
Set up dedicated email accounts for AI agents with proper workflows. Use when agents need external communications (Lourens for sysadmin, Ace for competitions... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 77 次。
如何安装 Agent Email Setup?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-email-setup」即可一键安装,无需额外配置。
Agent Email Setup 是免费的吗?
是的,Agent Email Setup 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Agent Email Setup 支持哪些平台?
Agent Email Setup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Agent Email Setup?
由 stefanferreira(@stefanferreira)开发并维护,当前版本 v1.0.0。