Clean up repo: move docs to docs/, add SECURITY.md, .editorconfig, update README with badges, fix cross-references, correct documentation to reflect actual project state
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/pop_puller_to_gmail/sessions/71f26285-5584-42b2-8255-8ad2c9e9ecb4
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
# EditorConfig — https://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.{js,jsx,ts,tsx,json,css,scss,yml,yaml}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[Dockerfile*]
|
||||||
|
indent_size = 4
|
||||||
+27
-22
@@ -20,7 +20,7 @@ Be respectful and inclusive. We welcome contributions from everyone.
|
|||||||
|
|
||||||
### Suggesting Features
|
### Suggesting Features
|
||||||
|
|
||||||
1. Check the [Roadmap](ROADMAP.md) to see if it's already planned
|
1. Check the [Roadmap](docs/ROADMAP.md) to see if it's already planned
|
||||||
2. Open an issue with the "enhancement" label
|
2. Open an issue with the "enhancement" label
|
||||||
3. Describe the feature and its use case
|
3. Describe the feature and its use case
|
||||||
4. Explain why it would be useful
|
4. Explain why it would be useful
|
||||||
@@ -40,14 +40,14 @@ Be respectful and inclusive. We welcome contributions from everyone.
|
|||||||
|
|
||||||
4. **Test your changes**
|
4. **Test your changes**
|
||||||
```bash
|
```bash
|
||||||
# Test Python syntax
|
# Run the test suite
|
||||||
python3 -m py_compile pop3_forwarder.py
|
make test
|
||||||
|
|
||||||
|
# Or run linting + formatting + tests together
|
||||||
|
make quick-test
|
||||||
|
|
||||||
# Test Docker build
|
# Test Docker build
|
||||||
docker build -t pop3-test .
|
docker build -t pop3-test .
|
||||||
|
|
||||||
# Test with your configuration
|
|
||||||
docker-compose up
|
|
||||||
```
|
```
|
||||||
|
|
||||||
5. **Commit your changes**
|
5. **Commit your changes**
|
||||||
@@ -80,19 +80,18 @@ Be respectful and inclusive. We welcome contributions from everyone.
|
|||||||
git clone https://github.com/YOUR-USERNAME/pop_puller_to_gmail.git
|
git clone https://github.com/YOUR-USERNAME/pop_puller_to_gmail.git
|
||||||
cd pop_puller_to_gmail
|
cd pop_puller_to_gmail
|
||||||
|
|
||||||
# Create virtual environment
|
# Install all development dependencies
|
||||||
python3 -m venv venv
|
make install-dev
|
||||||
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
# Copy example config
|
# Copy example config
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
# Edit .env with test credentials
|
# Edit .env with test credentials
|
||||||
|
|
||||||
# Run locally
|
# Run the legacy forwarder script directly
|
||||||
python pop3_forwarder.py
|
python pop3_forwarder.py
|
||||||
|
|
||||||
|
# Or start the SaaS backend in dev mode
|
||||||
|
make run-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker Development
|
### Docker Development
|
||||||
@@ -112,23 +111,29 @@ docker run --env-file .env pop3-dev
|
|||||||
- Add docstrings to functions and classes
|
- Add docstrings to functions and classes
|
||||||
- Keep functions focused and small
|
- Keep functions focused and small
|
||||||
- Handle errors gracefully
|
- Handle errors gracefully
|
||||||
|
- Run `make format` to auto-format with Black and Ruff
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
Before submitting a PR:
|
Before submitting a PR:
|
||||||
|
|
||||||
1. **Syntax check**
|
1. **Run the test suite**
|
||||||
```bash
|
```bash
|
||||||
python3 -m py_compile pop3_forwarder.py
|
make test
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Docker build**
|
2. **Run linting**
|
||||||
|
```bash
|
||||||
|
make lint
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Docker build**
|
||||||
```bash
|
```bash
|
||||||
docker build -t pop3-test .
|
docker build -t pop3-test .
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Manual testing**
|
4. **Manual testing** (if applicable)
|
||||||
- Test with real POP3 account (or mock)
|
- Test with a real POP3 account or mock
|
||||||
- Verify emails are forwarded correctly
|
- Verify emails are forwarded correctly
|
||||||
- Check error handling
|
- Check error handling
|
||||||
- Review logs
|
- Review logs
|
||||||
@@ -143,9 +148,9 @@ Update documentation when:
|
|||||||
|
|
||||||
Files to update:
|
Files to update:
|
||||||
- `README.md` - Main documentation
|
- `README.md` - Main documentation
|
||||||
- `QUICKSTART.md` - If setup changes
|
- `docs/QUICKSTART.md` - If setup changes
|
||||||
- `MVP.md` - If MVP scope changes
|
- `docs/MVP.md` - If MVP scope changes
|
||||||
- `ROADMAP.md` - If adding future plans
|
- `docs/ROADMAP.md` - If adding future plans
|
||||||
|
|
||||||
## Security
|
## Security
|
||||||
|
|
||||||
@@ -158,7 +163,7 @@ Files to update:
|
|||||||
|
|
||||||
**Do NOT open public issues for security vulnerabilities.**
|
**Do NOT open public issues for security vulnerabilities.**
|
||||||
|
|
||||||
Email security concerns to the maintainers privately.
|
Please see [SECURITY.md](SECURITY.md) for responsible disclosure instructions.
|
||||||
|
|
||||||
## Questions?
|
## Questions?
|
||||||
|
|
||||||
|
|||||||
@@ -1,135 +1,61 @@
|
|||||||
# POP3 to Gmail Forwarder
|
# POP3 to Gmail Forwarder
|
||||||
|
|
||||||
|
[](https://github.com/christianlouis/pop_puller_to_gmail/actions/workflows/test.yml)
|
||||||
|
[](https://github.com/christianlouis/pop_puller_to_gmail/actions/workflows/lint.yml)
|
||||||
|
[](https://github.com/christianlouis/pop_puller_to_gmail/actions/workflows/security.yml)
|
||||||
|
[](https://github.com/christianlouis/pop_puller_to_gmail/actions/workflows/docker-build.yml)
|
||||||
|
[](https://opensource.org/licenses/MIT)
|
||||||
|
[](https://www.python.org/downloads/)
|
||||||
|
[](https://www.docker.com/)
|
||||||
|
|
||||||
A Docker-based solution that automatically fetches emails from POP3 mailboxes and forwards them to Gmail, replacing Google's discontinued POP3 import feature.
|
A Docker-based solution that automatically fetches emails from POP3 mailboxes and forwards them to Gmail, replacing Google's discontinued POP3 import feature.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- ✅ **Multiple POP3 Accounts**: Support for unlimited POP3 mailboxes via environment variables
|
- **Multiple POP3 Accounts** — support for unlimited POP3 mailboxes via environment variables
|
||||||
- ✅ **Automatic Forwarding**: Sends emails to your Gmail account via SMTP
|
- **Automatic Forwarding** — sends emails to your Gmail account via SMTP
|
||||||
- ✅ **Smart Throttling**: Rate limiting to avoid Gmail quotas (configurable emails per minute)
|
- **Smart Throttling** — configurable rate limiting to stay within Gmail quotas
|
||||||
- ✅ **Error Reporting**: Email notifications via Postmarkapp when issues occur
|
- **Error Reporting** — notifications via Postmarkapp when issues occur
|
||||||
- ✅ **Scheduled Polling**: Configurable check intervals (default: every 5 minutes)
|
- **Scheduled Polling** — configurable check intervals (default: every 5 minutes)
|
||||||
- ✅ **Docker Ready**: Fully containerized with docker-compose support
|
- **Docker Ready** — fully containerized with Docker Compose support
|
||||||
- ✅ **Secure**: Runs as non-root user, uses SSL/TLS for connections
|
- **Secure** — runs as non-root user, SSL/TLS connections
|
||||||
- ✅ **Production Ready**: Comprehensive logging, error handling, and best practices
|
|
||||||
|
### SaaS Platform (in development)
|
||||||
|
|
||||||
|
The repository also includes a multi-tenant SaaS backend built with FastAPI, PostgreSQL, Redis, and Celery. It adds multi-user support, OAuth2 authentication, POP3/IMAP protocol support, encrypted credential storage, and background job processing. See the [SaaS README](docs/README_SAAS.md) for details.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
### Prerequisites
|
### Using a Pre-built Docker Image (Recommended)
|
||||||
|
|
||||||
- Docker and Docker Compose installed
|
|
||||||
- A Gmail account with [App Password](https://support.google.com/accounts/answer/185833) enabled
|
|
||||||
- POP3 account credentials
|
|
||||||
- (Optional) Postmarkapp account for error notifications
|
|
||||||
|
|
||||||
### Option 1: Using Pre-built Docker Image (Recommended)
|
|
||||||
|
|
||||||
The Docker images are automatically built and published to GitHub Container Registry.
|
|
||||||
|
|
||||||
1. **Create configuration file**
|
|
||||||
```bash
|
|
||||||
# Download the docker-compose.yml and .env.example
|
|
||||||
curl -O https://raw.githubusercontent.com/christianlouis/pop_puller_to_gmail/main/docker-compose.yml
|
|
||||||
curl -o .env https://raw.githubusercontent.com/christianlouis/pop_puller_to_gmail/main/.env.example
|
|
||||||
|
|
||||||
# Edit .env with your credentials
|
|
||||||
nano .env
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Update docker-compose.yml to use the pre-built image**
|
|
||||||
```yaml
|
|
||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
|
||||||
pop3-forwarder:
|
|
||||||
image: ghcr.io/christianlouis/pop_puller_to_gmail:latest
|
|
||||||
container_name: pop3-gmail-forwarder
|
|
||||||
restart: unless-stopped
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Run the container**
|
|
||||||
```bash
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
### Option 2: Building from Source
|
|
||||||
|
|
||||||
1. **Clone the repository**
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/christianlouis/pop_puller_to_gmail.git
|
|
||||||
cd pop_puller_to_gmail
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Configure environment variables**
|
|
||||||
```bash
|
|
||||||
cp .env.example .env
|
|
||||||
# Edit .env with your credentials
|
|
||||||
nano .env
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Essential Configuration**
|
|
||||||
|
|
||||||
Edit `.env` and set:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Your POP3 account(s)
|
|
||||||
POP3_ACCOUNT_1_HOST=pop.yourprovider.com
|
|
||||||
POP3_ACCOUNT_1_PORT=995
|
|
||||||
POP3_ACCOUNT_1_USER=your-email@provider.com
|
|
||||||
POP3_ACCOUNT_1_PASSWORD=your-password
|
|
||||||
|
|
||||||
# Your Gmail SMTP settings
|
|
||||||
SMTP_USER=your-gmail@gmail.com
|
|
||||||
SMTP_PASSWORD=your-app-password # Generate at myaccount.google.com/apppasswords
|
|
||||||
GMAIL_DESTINATION=your-gmail@gmail.com
|
|
||||||
|
|
||||||
# Optional: Postmarkapp for error notifications
|
|
||||||
POSTMARK_API_TOKEN=your-token
|
|
||||||
POSTMARK_FROM_EMAIL=errors@yourdomain.com
|
|
||||||
POSTMARK_TO_EMAIL=admin@yourdomain.com
|
|
||||||
```
|
|
||||||
|
|
||||||
4. **Run with Docker Compose**
|
|
||||||
```bash
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
5. **Check logs**
|
|
||||||
```bash
|
|
||||||
docker-compose logs -f
|
|
||||||
```
|
|
||||||
|
|
||||||
## Using Pre-built Docker Images
|
|
||||||
|
|
||||||
Docker images are automatically built and published to GitHub Container Registry for every release and commit to the main branch.
|
|
||||||
|
|
||||||
### Available Image Tags
|
|
||||||
|
|
||||||
- `ghcr.io/christianlouis/pop_puller_to_gmail:latest` - Latest build from main branch
|
|
||||||
- `ghcr.io/christianlouis/pop_puller_to_gmail:v1.0.0` - Specific version tags
|
|
||||||
- `ghcr.io/christianlouis/pop_puller_to_gmail:main` - Main branch builds
|
|
||||||
|
|
||||||
### Pull and Run
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Pull the latest image
|
# Pull and configure
|
||||||
docker pull ghcr.io/christianlouis/pop_puller_to_gmail:latest
|
curl -O https://raw.githubusercontent.com/christianlouis/pop_puller_to_gmail/main/docker-compose.yml
|
||||||
|
curl -o .env https://raw.githubusercontent.com/christianlouis/pop_puller_to_gmail/main/.env.example
|
||||||
|
|
||||||
# Run directly with Docker
|
# Edit .env with your credentials
|
||||||
docker run -d \
|
nano .env
|
||||||
--name pop3-forwarder \
|
|
||||||
--env-file .env \
|
# Start
|
||||||
--restart unless-stopped \
|
docker-compose up -d
|
||||||
ghcr.io/christianlouis/pop_puller_to_gmail:latest
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Building from Source
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/christianlouis/pop_puller_to_gmail.git
|
||||||
|
cd pop_puller_to_gmail
|
||||||
|
cp .env.example .env # then edit .env
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [Quick Start Guide](docs/QUICKSTART.md) for detailed instructions.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
### POP3 Accounts
|
### POP3 Accounts
|
||||||
|
|
||||||
Add multiple POP3 accounts by incrementing the account number:
|
Add multiple POP3 accounts by incrementing the account number in your `.env`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
POP3_ACCOUNT_1_HOST=pop.provider1.com
|
POP3_ACCOUNT_1_HOST=pop.provider1.com
|
||||||
@@ -139,199 +65,115 @@ POP3_ACCOUNT_1_PASSWORD=password1
|
|||||||
POP3_ACCOUNT_2_HOST=pop.provider2.com
|
POP3_ACCOUNT_2_HOST=pop.provider2.com
|
||||||
POP3_ACCOUNT_2_USER=user2@provider2.com
|
POP3_ACCOUNT_2_USER=user2@provider2.com
|
||||||
POP3_ACCOUNT_2_PASSWORD=password2
|
POP3_ACCOUNT_2_PASSWORD=password2
|
||||||
|
|
||||||
# ... add more as needed
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Gmail App Password
|
### Gmail App Password
|
||||||
|
|
||||||
1. Go to your Google Account: https://myaccount.google.com/
|
1. Go to your [Google Account Security](https://myaccount.google.com/security)
|
||||||
2. Select Security
|
2. Under "Signing in to Google," select **App Passwords**
|
||||||
3. Under "Signing in to Google," select App Passwords
|
3. Generate a new app password for "Mail"
|
||||||
4. Generate a new app password for "Mail"
|
4. Use this password as `SMTP_PASSWORD`
|
||||||
5. Use this password in `SMTP_PASSWORD`
|
|
||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
|
|
||||||
| Variable | Required | Default | Description |
|
| Variable | Required | Default | Description |
|
||||||
|----------|----------|---------|-------------|
|
|----------|----------|---------|-------------|
|
||||||
| `POP3_ACCOUNT_N_HOST` | Yes | - | POP3 server hostname |
|
| `POP3_ACCOUNT_N_HOST` | Yes | — | POP3 server hostname |
|
||||||
| `POP3_ACCOUNT_N_PORT` | No | 995 | POP3 server port |
|
| `POP3_ACCOUNT_N_PORT` | No | `995` | POP3 server port |
|
||||||
| `POP3_ACCOUNT_N_USER` | Yes | - | POP3 username |
|
| `POP3_ACCOUNT_N_USER` | Yes | — | POP3 username |
|
||||||
| `POP3_ACCOUNT_N_PASSWORD` | Yes | - | POP3 password |
|
| `POP3_ACCOUNT_N_PASSWORD` | Yes | — | POP3 password |
|
||||||
| `POP3_ACCOUNT_N_USE_SSL` | No | true | Use SSL/TLS |
|
| `POP3_ACCOUNT_N_USE_SSL` | No | `true` | Use SSL/TLS |
|
||||||
| `SMTP_HOST` | No | smtp.gmail.com | SMTP server |
|
| `SMTP_HOST` | No | `smtp.gmail.com` | SMTP server |
|
||||||
| `SMTP_PORT` | No | 587 | SMTP port |
|
| `SMTP_PORT` | No | `587` | SMTP port |
|
||||||
| `SMTP_USER` | Yes | - | SMTP username |
|
| `SMTP_USER` | Yes | — | SMTP username |
|
||||||
| `SMTP_PASSWORD` | Yes | - | SMTP password (App Password) |
|
| `SMTP_PASSWORD` | Yes | — | SMTP password (App Password) |
|
||||||
| `SMTP_USE_TLS` | No | true | Use STARTTLS |
|
| `SMTP_USE_TLS` | No | `true` | Use STARTTLS |
|
||||||
| `GMAIL_DESTINATION` | Yes | - | Destination Gmail address |
|
| `GMAIL_DESTINATION` | Yes | — | Destination Gmail address |
|
||||||
| `CHECK_INTERVAL_MINUTES` | No | 5 | How often to check for new mail |
|
| `CHECK_INTERVAL_MINUTES` | No | `5` | Polling interval |
|
||||||
| `MAX_EMAILS_PER_RUN` | No | 50 | Max emails to process per account per run |
|
| `MAX_EMAILS_PER_RUN` | No | `50` | Max emails per account per run |
|
||||||
| `THROTTLE_EMAILS_PER_MINUTE` | No | 10 | Rate limit for sending emails |
|
| `THROTTLE_EMAILS_PER_MINUTE` | No | `10` | Rate limit |
|
||||||
| `POSTMARK_API_TOKEN` | No | - | Postmarkapp API token |
|
| `POSTMARK_API_TOKEN` | No | — | Postmarkapp API token |
|
||||||
| `POSTMARK_FROM_EMAIL` | No | - | Error notification sender |
|
| `POSTMARK_FROM_EMAIL` | No | — | Error notification sender |
|
||||||
| `POSTMARK_TO_EMAIL` | No | - | Error notification recipient |
|
| `POSTMARK_TO_EMAIL` | No | — | Error notification recipient |
|
||||||
| `LOG_LEVEL` | No | INFO | Logging level (DEBUG, INFO, WARNING, ERROR) |
|
| `LOG_LEVEL` | No | `INFO` | Logging level |
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
1. **Polling**: The application checks configured POP3 mailboxes at regular intervals
|
|
||||||
2. **Fetching**: Retrieves new emails from each POP3 account
|
|
||||||
3. **Forwarding**: Sends emails to your Gmail account via SMTP with original metadata preserved
|
|
||||||
4. **Cleanup**: Deletes emails from POP3 server after successful forwarding
|
|
||||||
5. **Throttling**: Respects rate limits to avoid Gmail quota issues
|
|
||||||
6. **Error Handling**: Sends notifications via Postmarkapp if issues occur
|
|
||||||
|
|
||||||
## Email Format
|
|
||||||
|
|
||||||
Forwarded emails include:
|
|
||||||
- Original sender information in the subject line: `[Fwd from user@provider.com] Original Subject`
|
|
||||||
- Header section with original From, Date, Subject, and source account
|
|
||||||
- Original email body preserved
|
|
||||||
|
|
||||||
## Monitoring and Logs
|
|
||||||
|
|
||||||
### View logs
|
|
||||||
```bash
|
|
||||||
docker-compose logs -f pop3-forwarder
|
|
||||||
```
|
|
||||||
|
|
||||||
### Check container status
|
|
||||||
```bash
|
|
||||||
docker-compose ps
|
|
||||||
```
|
|
||||||
|
|
||||||
### Restart the service
|
|
||||||
```bash
|
|
||||||
docker-compose restart
|
|
||||||
```
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### Gmail Authentication Issues
|
|
||||||
|
|
||||||
**Problem**: "Username and Password not accepted"
|
|
||||||
|
|
||||||
**Solution**:
|
|
||||||
- Ensure 2FA is enabled on your Google account
|
|
||||||
- Generate an App Password (don't use your regular Gmail password)
|
|
||||||
- Use the 16-character app password without spaces
|
|
||||||
|
|
||||||
### POP3 Connection Issues
|
|
||||||
|
|
||||||
**Problem**: "Connection refused" or "SSL error"
|
|
||||||
|
|
||||||
**Solution**:
|
|
||||||
- Verify POP3 server hostname and port
|
|
||||||
- Check if POP3 is enabled in your email provider settings
|
|
||||||
- Try with `POP3_ACCOUNT_N_USE_SSL=false` for non-SSL connections (port 110)
|
|
||||||
|
|
||||||
### No Emails Being Forwarded
|
|
||||||
|
|
||||||
**Problem**: Container runs but no emails are forwarded
|
|
||||||
|
|
||||||
**Solution**:
|
|
||||||
- Check if there are emails in your POP3 mailbox
|
|
||||||
- Review logs for errors: `docker-compose logs -f`
|
|
||||||
- Verify `GMAIL_DESTINATION` is correct
|
|
||||||
- Check Gmail spam folder
|
|
||||||
|
|
||||||
### Rate Limiting
|
|
||||||
|
|
||||||
**Problem**: "Too many requests" or quota errors
|
|
||||||
|
|
||||||
**Solution**:
|
|
||||||
- Increase `CHECK_INTERVAL_MINUTES`
|
|
||||||
- Decrease `THROTTLE_EMAILS_PER_MINUTE`
|
|
||||||
- Reduce `MAX_EMAILS_PER_RUN`
|
|
||||||
|
|
||||||
## Security Best Practices
|
|
||||||
|
|
||||||
1. **Never commit `.env` file** - It contains sensitive credentials
|
|
||||||
2. **Use App Passwords** - Don't use your main Gmail password
|
|
||||||
3. **Rotate credentials regularly** - Update passwords periodically
|
|
||||||
4. **Enable 2FA** - On all email accounts
|
|
||||||
5. **Review logs** - Monitor for suspicious activity
|
|
||||||
6. **Use SSL/TLS** - Keep `USE_SSL` and `USE_TLS` enabled
|
|
||||||
7. **Limit network access** - Use firewall rules if needed
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
### Local Development (without Docker)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Create virtual environment
|
|
||||||
python3 -m venv venv
|
|
||||||
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
# Copy and configure .env
|
|
||||||
cp .env.example .env
|
|
||||||
# Edit .env with your settings
|
|
||||||
|
|
||||||
# Run the application
|
|
||||||
python pop3_forwarder.py
|
|
||||||
```
|
|
||||||
|
|
||||||
### Building the Docker Image
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker build -t pop3-gmail-forwarder .
|
|
||||||
```
|
|
||||||
|
|
||||||
### Running Tests
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run with verbose logging
|
|
||||||
LOG_LEVEL=DEBUG docker-compose up
|
|
||||||
```
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
```
|
```
|
||||||
┌─────────────────┐
|
┌─────────────────┐
|
||||||
│ POP3 Server 1 │
|
│ POP3 Server 1 │
|
||||||
└────────┬────────┘
|
└────────┬────────┘
|
||||||
│
|
|
||||||
│ (Fetch emails)
|
│ (Fetch emails)
|
||||||
│
|
|
||||||
▼
|
▼
|
||||||
┌─────────────────┐ ┌──────────────┐ ┌─────────────┐
|
┌─────────────────┐ ┌──────────────┐ ┌─────────────┐
|
||||||
│ POP3 Server 2 │─────▶│ Forwarder │─────▶│ Gmail │
|
│ POP3 Server 2 │─────▶│ Forwarder │─────▶│ Gmail │
|
||||||
└─────────────────┘ │ Container │ │ (SMTP) │
|
└─────────────────┘ │ Container │ │ (SMTP) │
|
||||||
│ └──────┬───────┘ └─────────────┘
|
│ └──────┬───────┘ └─────────────┘
|
||||||
│ │
|
┌────────▼────────┐ │ (Error notifications)
|
||||||
┌────────▼────────┐ │
|
│ POP3 Server N │ ▼
|
||||||
│ POP3 Server N │ │
|
└─────────────────┘ ┌─────────────────┐
|
||||||
└─────────────────┘ │
|
|
||||||
│ (Error notifications)
|
|
||||||
▼
|
|
||||||
┌─────────────────┐
|
|
||||||
│ Postmarkapp │
|
│ Postmarkapp │
|
||||||
└─────────────────┘
|
└─────────────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
|
1. **Polling** — checks POP3 mailboxes at the configured interval
|
||||||
|
2. **Fetching** — retrieves new emails from each account
|
||||||
|
3. **Forwarding** — delivers to Gmail with original metadata preserved
|
||||||
|
4. **Cleanup** — deletes from POP3 after successful forwarding
|
||||||
|
5. **Throttling** — respects rate limits to avoid quota issues
|
||||||
|
6. **Error Handling** — sends notifications if something goes wrong
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install dependencies
|
||||||
|
make install-dev
|
||||||
|
|
||||||
|
# Run linting & formatting
|
||||||
|
make lint
|
||||||
|
make format
|
||||||
|
|
||||||
|
# Run tests
|
||||||
|
make test
|
||||||
|
|
||||||
|
# Start backend in dev mode
|
||||||
|
make run-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [Testing Guide](docs/TESTING_GUIDE.md) for the full test workflow.
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
Detailed documentation lives in the [`docs/`](docs/) directory:
|
||||||
|
|
||||||
|
| Document | Description |
|
||||||
|
|----------|-------------|
|
||||||
|
| [Architecture](docs/ARCHITECTURE.md) | System design and component overview |
|
||||||
|
| [Quick Start](docs/QUICKSTART.md) | Step-by-step setup guide |
|
||||||
|
| [Migration Guide](docs/MIGRATION_GUIDE.md) | Upgrading from v1 to v2 |
|
||||||
|
| [Deployment Checklist](docs/DEPLOYMENT_CHECKLIST.md) | Production deployment guide |
|
||||||
|
| [Roadmap](docs/ROADMAP.md) | Planned features and milestones |
|
||||||
|
| [Testing Guide](docs/TESTING_GUIDE.md) | How to run and write tests |
|
||||||
|
| [Coding Patterns](docs/CODING_PATTERNS.md) | Code style and conventions |
|
||||||
|
| [SaaS README](docs/README_SAAS.md) | Multi-tenant SaaS platform details |
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Contributions are welcome! Please:
|
Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on:
|
||||||
|
|
||||||
1. Fork the repository
|
- Reporting bugs and suggesting features
|
||||||
2. Create a feature branch
|
- Development setup and code style
|
||||||
3. Make your changes
|
- Pull request process
|
||||||
4. Submit a pull request
|
|
||||||
|
## Security
|
||||||
|
|
||||||
|
To report a vulnerability, please see [SECURITY.md](SECURITY.md). **Do not open public issues for security concerns.**
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT License - See LICENSE file for details
|
This project is licensed under the MIT License — see [LICENSE](LICENSE) for details.
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
- **Issues**: https://github.com/christianlouis/pop_puller_to_gmail/issues
|
- [Issue Tracker](https://github.com/christianlouis/pop_puller_to_gmail/issues)
|
||||||
- **Discussions**: https://github.com/christianlouis/pop_puller_to_gmail/discussions
|
- [Discussions](https://github.com/christianlouis/pop_puller_to_gmail/discussions)
|
||||||
|
|
||||||
## Acknowledgments
|
|
||||||
|
|
||||||
Built to replace Gmail's discontinued POP3 import feature. Uses industry-standard Python libraries for email handling and Docker for easy deployment.
|
|
||||||
|
|||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
|---------|--------------------|
|
||||||
|
| 2.x | ✅ Yes |
|
||||||
|
| 1.x | ❌ No |
|
||||||
|
| < 1.0 | ❌ No |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
**Please do NOT open public issues for security vulnerabilities.**
|
||||||
|
|
||||||
|
If you discover a security vulnerability, please report it responsibly:
|
||||||
|
|
||||||
|
1. **Email**: Send details to the repository maintainer via the email listed on the [GitHub profile](https://github.com/christianlouis).
|
||||||
|
2. **GitHub Private Vulnerability Reporting**: Use [GitHub's security advisory feature](https://github.com/christianlouis/pop_puller_to_gmail/security/advisories/new) to report privately.
|
||||||
|
|
||||||
|
### What to Include
|
||||||
|
|
||||||
|
- A description of the vulnerability
|
||||||
|
- Steps to reproduce the issue
|
||||||
|
- Potential impact
|
||||||
|
- Suggested fix (if any)
|
||||||
|
|
||||||
|
### Response Timeline
|
||||||
|
|
||||||
|
- **Acknowledgment**: Within 48 hours
|
||||||
|
- **Initial Assessment**: Within 1 week
|
||||||
|
- **Fix & Disclosure**: Coordinated with the reporter
|
||||||
|
|
||||||
|
## Security Best Practices for Users
|
||||||
|
|
||||||
|
- **Never commit `.env` files** containing credentials
|
||||||
|
- **Use App Passwords** for Gmail instead of your main password
|
||||||
|
- **Enable 2FA** on all email accounts
|
||||||
|
- **Rotate credentials** regularly
|
||||||
|
- **Use SSL/TLS** for all mail connections
|
||||||
|
- **Run containers as non-root** (default in provided Dockerfile)
|
||||||
|
- **Keep dependencies updated** — Dependabot is enabled on this repository
|
||||||
@@ -316,9 +316,9 @@ alembic downgrade -1
|
|||||||
## 📚 Additional Documentation
|
## 📚 Additional Documentation
|
||||||
|
|
||||||
- [API Documentation](http://localhost:8000/api/docs) - Interactive API docs
|
- [API Documentation](http://localhost:8000/api/docs) - Interactive API docs
|
||||||
- [CONTRIBUTING.md](CONTRIBUTING.md) - Contribution guidelines
|
- [CONTRIBUTING.md](../CONTRIBUTING.md) - Contribution guidelines
|
||||||
- [ROADMAP.md](ROADMAP.md) - Future development plans
|
- [ROADMAP.md](ROADMAP.md) - Future development plans
|
||||||
- [SECURITY.md](SECURITY.md) - Security policies
|
- [SECURITY.md](../SECURITY.md) - Security policies
|
||||||
|
|
||||||
## 🤝 Contributing
|
## 🤝 Contributing
|
||||||
|
|
||||||
@@ -331,7 +331,7 @@ Contributions welcome! Please:
|
|||||||
|
|
||||||
## 📄 License
|
## 📄 License
|
||||||
|
|
||||||
MIT License - See [LICENSE](LICENSE) file
|
MIT License - See [LICENSE](../LICENSE) file
|
||||||
|
|
||||||
## 🆘 Support
|
## 🆘 Support
|
||||||
|
|
||||||
@@ -312,7 +312,7 @@ Helm charts and Kubernetes manifests will be provided for production deployment.
|
|||||||
|
|
||||||
## 🤝 Contributing
|
## 🤝 Contributing
|
||||||
|
|
||||||
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
Contributions are welcome! Please see [CONTRIBUTING.md](../CONTRIBUTING.md) for guidelines.
|
||||||
|
|
||||||
### Areas for Contribution
|
### Areas for Contribution
|
||||||
|
|
||||||
@@ -325,7 +325,7 @@ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for gui
|
|||||||
|
|
||||||
## 📜 License
|
## 📜 License
|
||||||
|
|
||||||
MIT License - See [LICENSE](LICENSE) file for details.
|
MIT License - See [LICENSE](../LICENSE) file for details.
|
||||||
|
|
||||||
## 🆘 Support
|
## 🆘 Support
|
||||||
|
|
||||||
@@ -357,16 +357,19 @@ Built with these amazing open-source projects:
|
|||||||
| Background Jobs | ✅ Complete | 100% |
|
| Background Jobs | ✅ Complete | 100% |
|
||||||
| Documentation | ✅ Complete | 100% |
|
| Documentation | ✅ Complete | 100% |
|
||||||
| Stripe Integration | 🚧 In Progress | 60% |
|
| Stripe Integration | 🚧 In Progress | 60% |
|
||||||
| Frontend Dashboard | 📋 Planned | 0% |
|
| Frontend Dashboard | 🚧 In Progress | 70% |
|
||||||
| Notification System | 📋 Planned | 40% |
|
| Notification System | 🚧 In Progress | 40% |
|
||||||
| Testing Suite | 📋 Planned | 20% |
|
| Testing Suite | 🚧 In Progress | 30% |
|
||||||
|
|
||||||
|
> **Note:** The frontend pages and components are implemented but the API client
|
||||||
|
> layer (`lib/api.ts`) is not yet wired up, so the dashboard does not function
|
||||||
|
> end-to-end yet.
|
||||||
|
|
||||||
## 🔮 Roadmap
|
## 🔮 Roadmap
|
||||||
|
|
||||||
See [ROADMAP.md](ROADMAP.md) for detailed future plans, including:
|
See [ROADMAP.md](ROADMAP.md) for detailed future plans, including:
|
||||||
|
|
||||||
- Complete web dashboard
|
- Complete web dashboard
|
||||||
- Mobile app (iOS/Android)
|
|
||||||
- Advanced email filtering
|
- Advanced email filtering
|
||||||
- Email archiving
|
- Email archiving
|
||||||
- Multi-destination forwarding
|
- Multi-destination forwarding
|
||||||
@@ -374,12 +377,6 @@ See [ROADMAP.md](ROADMAP.md) for detailed future plans, including:
|
|||||||
- Kubernetes deployment
|
- Kubernetes deployment
|
||||||
- High availability setup
|
- High availability setup
|
||||||
|
|
||||||
## ⭐ Star History
|
|
||||||
|
|
||||||
If you find this project useful, please consider giving it a star! ⭐
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Version**: 2.0.0 | **Status**: Production Ready (Backend) | **Updated**: 2026-02-01
|
**Status**: In Development | **Backend**: Production-ready | **Frontend**: In Progress
|
||||||
|
|
||||||
Made with ❤️ for the community
|
|
||||||
@@ -243,7 +243,7 @@ We welcome contributions! Areas where help is needed:
|
|||||||
5. **Performance**: Optimize slow operations
|
5. **Performance**: Optimize slow operations
|
||||||
6. **Security**: Security audits and improvements
|
6. **Security**: Security audits and improvements
|
||||||
|
|
||||||
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
See [CONTRIBUTING.md](../CONTRIBUTING.md) for guidelines.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ def get_or_create_user_salt(user_id: int) -> bytes:
|
|||||||
## Related Decisions
|
## Related Decisions
|
||||||
|
|
||||||
- See ADR-006 for key management in production
|
- See ADR-006 for key management in production
|
||||||
- See SECURITY_REPORT.md for security analysis
|
- See ../SECURITY_REPORT.md for security analysis
|
||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user