http://localhost:1880 (or your configured port)# 1. Generate dashboard
python docs/generate-dashboard.py
# 2. Open dashboard
open web/index.html
# 3. Check all services are running
curl http://localhost:1880 # Node-RED
curl http://localhost:11435 # Ollama
curl http://localhost:9090 # Prometheus
curl http://localhost:3000 # Grafana
Real-time status monitoring for all components:
Based on your configuration:
IMAP, POP3, SMTP, Microsoft Graph API, Gmail API
# System automatically checks for new emails based on your configuration
# Check interval is set in .env file: EMAIL_CHECK_INTERVAL=300 (in seconds)
# Manually trigger email check
curl -X POST "http://localhost:1880/api/email/check"
http://localhost:1880# Submit email via API
curl -X POST "http://localhost:1880/api/email/process" \
-H "Content-Type: application/json" \
-d '{
"from": "sender@example.com",
"to": "recipient@example.com",
"subject": "Meeting Request",
"body": "Can we schedule a meeting for tomorrow?",
"date": "2024-01-20T10:30:00Z"
}'
graph LR
A[Email Received] --> B[Metadata Extraction]
B --> C[Content Analysis]
C --> D[AI Classification]
D --> E[Priority Assignment]
E --> F[Storage & Indexing]
F --> G[Alerts & Auto-Replies]
Purpose: Visual workflow designer for email processing
Key Features:
Common Tasks:
// Example: Custom email classifier
if (msg.payload.subject.includes('urgent')) {
msg.classification = 'URGENT';
return [msg, null, null, null];
} else if (msg.payload.from.includes('boss')) {
msg.classification = 'BUSINESS';
return [null, msg, null, null];
} else if (msg.payload.subject.includes('personal')) {
msg.classification = 'PERSONAL';
return [null, null, msg, null];
} else {
msg.classification = 'SPAM';
return [null, null, null, msg];
}
Purpose: Visualize email processing metrics and trends
Key Dashboards:
Dashboard Examples:
Purpose: Time-series metrics collection
Key Metrics:
email_processed_total: Total emails processedemail_processing_duration_seconds: Processing timeemail_classification_count{type="URGENT"}: Count by typeemail_auto_reply_sent_total: Auto-replies sentQuery Examples:
# Average processing time over last hour
rate(email_processing_duration_seconds_sum[1h]) / rate(email_processing_duration_seconds_count[1h])
# Email classification distribution
email_classification_count{type="URGENT"} / sum(email_classification_count)
# System load during email processing
node_cpu_seconds_total{mode="system"} / node_cpu_seconds_total{mode="idle"}
Purpose: AI model for email classification and analysis
Key Features:
API Examples:
# Generate email classification
curl -X POST "http://localhost:11435/api/generate" \
-H "Content-Type: application/json" \
-d '{
"model": "llama2:7b",
"prompt": "Classify this email: Subject: Urgent Meeting, From: boss@company.com, Body: We need to discuss the project status immediately.",
"stream": false
}'
Search Interface: Node-RED Dashboard or API
Search Parameters:
from: Sender email addressto: Recipient email addresssubject: Email subject linebody: Email body contentdate: Date rangeclassification: Email classificationhas_attachments: Boolean filterSearch Examples:
# Find urgent emails from last week
curl "http://localhost:1880/api/email/search?classification=URGENT&from=2024-01-01"
# Search for specific content
curl "http://localhost:1880/api/email/search?q=project+status"
# Advanced search with JSON
curl -X POST "http://localhost:1880/api/email/search" \
-H "Content-Type: application/json" \
-d '{
"query": {
"bool": {
"must": [
{"match": {"subject": "meeting"}},
{"range": {"date": {"gte": "now-7d"}}}
]
}
}
}'
Standard Reports:
Custom Reports:
http://localhost:3000Using Node-RED:
http://localhost:1880Example Workflow: VIP Sender:
[Email In] β [Filter VIP] β [Set Priority] β [Notify Slack] β [Auto-Reply] β [Store]
Template Variables:
Example Template:
<p>Dear ,</p>
<p>Thank you for your email regarding "".</p>
<p>This is an automated response confirming we've received your message
and it has been classified as .</p>
<p>We'll respond within:
2 hours
24 hours
48 hours
</p>
<p>Best regards,<br>
HubMail System</p>
Available Channels:
Slack Configuration:
# In .env file
WEBHOOK_URL=https://hooks.slack.com/services/your-webhook-url
WEBHOOK_ENABLED=true
WEBHOOK_CHANNEL=#email-alerts
Key Metrics:
Viewing Metrics:
http://localhost:3000Alert Types:
Setting Up Alerts:
http://localhost:3000Example Alert Rule:
# Alert when URGENT emails are not processed within 5 minutes
name: UrgentEmailDelayed
expr: time() - max(email_received_timestamp{classification="URGENT"}) > 300
for: 5m
labels:
severity: critical
annotations:
summary: Urgent email processing delayed
description: Urgent emails have not been processed in over 5 minutes
# Check email server connectivity
nc -zv $EMAIL_SERVER $EMAIL_PORT
# View detailed connection logs
docker-compose logs node-red | grep "Email connection"
# Test email credentials
curl -X POST "http://localhost:1880/api/email/test-connection"
# Check AI model status
curl "http://localhost:11435/api/tags"
# View classification logs
docker-compose logs node-red | grep "Classification"
# Manually classify an email to test
curl -X POST "http://localhost:1880/api/email/classify" \
-H "Content-Type: application/json" \
-d '{
"subject": "Test Subject",
"body": "Test Body"
}'
# Check system resources
docker stats
# View processing times
curl "http://localhost:1880/api/email/stats"
# Restart services if needed
docker-compose restart node-red ollama
Viewing Logs:
# All services
docker-compose logs
# Specific service
docker-compose logs node-red
# Follow logs in real-time
docker-compose logs -f
# Filter logs
docker-compose logs | grep "error"
Diagnostic Tools:
curl http://localhost:1880/api/system/statuscurl http://localhost:1880/api/email/queuecurl http://localhost:9090/api/v1/query?query=upIf you encounter issues not covered here:
Best Practices:
Configuration:
# In .env file
EMAIL_SECURE=true
EMAIL_AUTH_TYPE=oauth2
EMAIL_OAUTH_CLIENT_ID=your-client-id
EMAIL_OAUTH_CLIENT_SECRET=your-client-secret
Default Policy:
Custom Configuration:
# In .env file
EMAIL_RETENTION_DAYS=90
ATTACHMENT_RETENTION_DAYS=30
LOG_RETENTION_DAYS=14
The HubMail dashboard is responsive and can be accessed from mobile devices:
Mobile Features:
# Pull latest changes
git pull
# Update containers
docker-compose pull
# Restart services
docker-compose down
docker-compose up -d
Backup Data:
# Backup configuration
cp .env .env.backup
# Backup Node-RED flows
curl "http://localhost:1880/flows" > flows-backup.json
# Backup Redis data
docker-compose exec redis redis-cli SAVE
Restore Data:
# Restore configuration
cp .env.backup .env
# Restore Node-RED flows
curl -X POST "http://localhost:1880/flows" \
-H "Content-Type: application/json" \
-d @flows-backup.json
# Restart system
docker-compose restart
π Youβre now ready to use HubMail for efficient email processing!