A production-ready Docker service that automatically monitors POP3 mailboxes for voicemails and forwards them via email with audio attachments. Perfect for integrating legacy voicemail systems with modern email workflows.
- π Automated POP3 Polling: Continuously monitors configured mailboxes with customizable intervals
- π§ Smart Email Forwarding: Forwards voicemails via SMTP with preserved audio attachments
- π― Duplicate Prevention: SQLite-based tracking ensures messages are never forwarded twice
- π₯οΈ Web Management UI: Browser-based interface for easy configuration and monitoring
- π Attachment Archiving: Automatically saves audio files locally for audit and backup
- π Comprehensive Logging: Detailed logs with POP3 response codes and processing status
- π Secure: Supports TLS/STARTTLS for both POP3 and SMTP connections
- π³ Container-Ready: Minimal Alpine-based Docker image with persistent volumes
- Quick Start
- Configuration
- Web Interface
- Architecture
- Networking
- Volumes
- Environment Variables
- Building from Source
- Troubleshooting
- Contributing
- License
docker run -d \
--name voicemail-forwarder \
--network host \
-v $(pwd)/data:/app/data \
-v $(pwd)/logs:/app/logs \
dblagbro/voicemail-forwarder:latestservices:
voicemail-forwarder:
image: dblagbro/voicemail-forwarder:latest
container_name: voicemail-forwarder
restart: unless-stopped
network_mode: host
volumes:
- ./data:/app/data
- ./logs:/app/logsAfter starting, access the web UI at http://localhost:8089
The easiest way to configure the service is through the web UI at http://localhost:8089:
- Mailboxes Tab: Add POP3 mailboxes to monitor
- Settings Tab: Configure SMTP server for forwarding
- System Settings: Adjust polling interval and preferences
Configuration is stored in data/config.json:
{
"mailboxes": [
{
"name": "4013",
"pop3_host": "mail.example.com",
"pop3_port": 110,
"pop3_user": "4013",
"pop3_pass": "password",
"use_stls": false,
"dest_to": "[email protected]",
"enabled": true
}
],
"smtp": {
"host": "smtp.gmail.com",
"port": 587,
"use_tls": true,
"username": "[email protected]",
"password": "your-app-password"
},
"poll_interval_seconds": 300,
"smtp_from": "[email protected]"
}| Field | Description | Required |
|---|---|---|
name |
Friendly name for the mailbox | Yes |
pop3_host |
POP3 server hostname or IP | Yes |
pop3_port |
POP3 port (usually 110 or 995) | Yes |
pop3_user |
POP3 username | Yes |
pop3_pass |
POP3 password | Yes |
use_stls |
Enable STARTTLS encryption | No (default: false) |
dest_to |
Email address to forward messages to | Yes |
enabled |
Enable/disable this mailbox | No (default: true) |
| Field | Description | Required |
|---|---|---|
host |
SMTP server hostname | Yes |
port |
SMTP port (usually 587 or 465) | Yes |
use_tls |
Enable TLS encryption | No (default: true) |
username |
SMTP authentication username | Yes |
password |
SMTP authentication password | Yes |
| Field | Description | Default |
|---|---|---|
poll_interval_seconds |
Seconds between polling cycles | 300 (5 min) |
smtp_from |
From address for forwarded emails | voicemail@localhost |
The web interface provides comprehensive monitoring and management:
- Manual poll trigger button
- System status overview
- Recent activity summary
- Add/edit/delete mailbox configurations
- Enable/disable individual mailboxes
- Test connections
- Change mailbox passwords
- Browse archived audio files
- Listen to voicemails directly in browser
- Download attachments
- View metadata (date, size, mailbox)
- Real-time log viewer
- Filter by log level
- Search functionality
- Download logs
- Configure SMTP server
- Adjust polling intervals
- Test email delivery
ββββββββββββββββ
β POP3 Server β
ββββββββ¬ββββββββ
β Poll every N seconds
βΌ
ββββββββββββββββββββ
β Voicemail β
β Forwarder β
β β
β 1. Connect β
β 2. Authenticate β
β 3. List messages β
β 4. Check UIDL βββββΊ SQLite (seen messages)
β 5. Fetch new β
β 6. Forward βββββΊ SMTP Server ββββΊ Recipient
β 7. Archive βββββΊ Local storage
ββββββββββββββββββββ
- Flask Web Server: Provides REST API and web UI
- Core Poller: Handles POP3 polling and message processing
- State Manager: SQLite database for tracking processed messages
- Archive Manager: Saves audio attachments to persistent storage
- Gunicorn: Production WSGI server
This service requires network_mode: host to access POP3 servers on local networks:
network_mode: hostWhy host networking?
- Direct access to LAN-based POP3 servers
- No NAT traversal issues
- Simplified configuration
If using Docker bridge networking:
- Ensure proper routing to POP3 servers
- Map port 8089:
ports: ["8089:8089"] - Configure firewall rules if needed
Example nginx configuration for HTTPS access:
location /voicemail-forwarder {
proxy_pass http://localhost:8089;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}| Path | Purpose | Required |
|---|---|---|
/app/data |
Configuration and state database | Yes |
/app/logs |
Application logs | No |
data/
βββ config.json # Configuration file
βββ state.db # SQLite database (processed messages)
logs/
βββ forwarder.log # Application logs
attachments/ # Created automatically
βββ mailbox_4013/
β βββ 2026-01-10_voicemail.wav
β βββ ...
βββ mailbox_1000/
βββ ...
| Variable | Description | Default |
|---|---|---|
PORT |
Web UI listen port | 8089 |
TZ |
Timezone for logs | UTC |
PYTHONUNBUFFERED |
Disable Python buffering | 1 |
Example:
docker run -d \
-e TZ=America/New_York \
-e PORT=8090 \
--network host \
dblagbro/voicemail-forwarder:latest# Clone the repository
git clone https://github.com/dblagbro/voicemail-forwarder.git
cd voicemail-forwarder
# Build the image
docker build -t voicemail-forwarder:local .
# Run the container
docker run -d \
--name voicemail-forwarder \
--network host \
-v $(pwd)/data:/app/data \
-v $(pwd)/logs:/app/logs \
voicemail-forwarder:local# Install dependencies
pip install -r requirements.txt
# Run locally
cd app
python app.pySymptoms: Logs show timeout or connection refused errors
Solutions:
- Verify POP3 host/port are correct
- Check firewall rules
- Test connection:
telnet pop3_host 110 - Ensure using
network_mode: hostif on LAN
Symptoms: Logs show "already_seen" for new messages
Solutions:
- Check SMTP configuration in Settings
- Test SMTP connection
- Clear state database:
rm data/state.db(will reprocess all messages) - Check logs for SMTP errors
Symptoms: Cannot reach http://localhost:8089
Solutions:
- Verify container is running:
docker ps - Check port mapping:
docker port voicemail-forwarder - Review container logs:
docker logs voicemail-forwarder - Ensure no port conflicts
Symptoms: Logs show forwarding but attachments missing
Solutions:
- Check volume permissions
- Verify disk space:
df -h - Review logs for file I/O errors
Enable detailed logging by checking the logs tab in the web UI or:
docker exec -it voicemail-forwarder tail -f /app/logs/forwarder.logTest POP3 connection manually:
# Install telnet or nc
telnet pop3_server 110
# Commands to test
USER username
PASS password
STAT
UIDL
QUITContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Flask and Gunicorn
- Uses SQLite for state management
- Containerized with Docker Alpine
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Note: This is designed for enterprise voicemail systems that use POP3 for message delivery. Common use cases include Avaya Communication Manager, Cisco Unity, and similar systems.