This project fetches emails from a specified mailbox and generates an RSS feed for each sender.
- Connects to an Email account using IMAP
- Fetches emails from the last 10 days (configurable)
- Groups emails by sender
- Generates an RSS feed for each sender
- Saves each RSS feed to a file
- Handles errors and logs them
- Internal RSS Reader - Optional web-based reader to view full email content directly
- Serves RSS feeds via built-in HTTP server
You can configure your email account to connect to and the number of days to fetch emails from by saving lines in .env:
imap_server=imap.gmail.com_or_some_other_imap_server
userid=[email protected]
userpw=your_password_here
mailbox=your_mailbox_name_to_fetch_emails_from
port=8000
refresh_seconds=300
data_dir=data
max_item_per_feed=100
server_baseurl=http://localhost:8000
# Internal RSS Reader (optional)
# Set to 'true' to enable internal article viewer
# When enabled, RSS links point to /article/{feed}/{guid} instead of external websites
enable_internal_reader=false| Option | Description | Default |
|---|---|---|
imap_server |
IMAP server address | Required |
userid |
Email account username | Required |
userpw |
Email account password or app password | Required |
mailbox |
Mailbox/folder to fetch emails from | INBOX |
port |
HTTP server port | 8000 |
refresh_seconds |
Interval between email fetches | 300 |
data_dir |
Directory for database and RSS files | data |
max_item_per_feed |
Maximum items per RSS feed | 100 |
server_baseurl |
Base URL for RSS feed links | Optional |
enable_internal_reader |
Enable internal article viewer | false |
The internal RSS reader is an optional feature that allows you to read email content directly on your server instead of following links to external websites.
Default Behavior (Internal Reader Disabled):
- RSS feed links point to the sender's domain (e.g.,
https://tailscale.com) - Clicking an item in your RSS reader opens the sender's website
- Best for newsletters with web versions
Internal Reader Enabled:
- RSS feed links point to your server:
/article/{feed}/{guid} - Clicking an item displays the full email HTML content in a clean, readable format
- No external requests needed - all content served from your database
- Ideal for email-only content or when you want to read everything in one place
Set the environment variable in your .env file:
enable_internal_reader=trueAfter enabling, regenerate your RSS feeds for the changes to take effect.
- Server-side rendering - Minimal resource usage on client and server
- Responsive design - Works on mobile and desktop
- Dark mode support - Automatically adapts to system preferences
- Full HTML content - Displays emails exactly as received
- Lightweight - ~2KB CSS, minimal JavaScript
Articles are accessed via: http://your-server:8000/article/{feed}/{guid}
Example: http://localhost:8000/article/hello_tailscale_com/4e939412d854ceb79b21f011d93e2ec7
Where:
{feed}= Sanitized sender email (e.g.,hello_tailscale_com){guid}= Unique article identifier (MD5 hash)
If you want to use your own domain and have a SSL certificate, you can use lets encrypt to get a free SSL certificate.
- Install certbot on your server. The command to do this depends on your Linux distribution. For Ubuntu, you can use:
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx- Run certbot to obtain the certificates. Replace your-domain.com with your actual domain:
sudo certbot --nginx -d your-domain.com- now add certfile and keyfile to the .env file
Final .env file should look like this:
imap_server=imap.gmail.com_or_some_other_imap_server
userid=[email protected]
userpw=your_password_here
mailbox=your_mailbox_name_to_fetch_emails_from
port=8000
certfile="/etc/letsencrypt/live/your-domain.com/fullchain.pem"
keyfile="/etc/letsencrypt/live/your-domain.com/privkey.pem"
server_baseurl=https://your-domain.com
enable_internal_reader=false- Clone this repository.
- Run
make allto build the docker container. - Copy
.env.oauth.exampleto.envand configure your email account settings. - Run
make runto start the container. - Browse to
http://localhost:8000to see the generated RSS feeds.
- RSS Feeds:
http://localhost:8000/{sender_email}.xml- Example:
http://localhost:8000/hello_tailscale_com.xml
- Example:
- OPML Subscription File:
http://localhost:8000/subscriptions.opml- Import this into your RSS reader to subscribe to all feeds at once
- Internal Reader (when enabled):
http://localhost:8000/article/{feed}/{guid}- Click article links in your RSS reader to view content directly
# Install dependencies
poetry install
# Configure your .env file
cp .env.oauth.example .env
# Edit .env with your settings
# Run the application
poetry run python start.pyYou might want to use Tailscale's funnel to serve your local server to the internet. This way you can access your RSS feeds from anywhere.
tailscale funnel 8000If you face problems installing on Raspberry Pi, try:
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring poetry installWhen you change the enable_internal_reader setting:
- Update your
.envfile - Restart the application (it will regenerate feeds automatically)
- Existing RSS feeds will be updated with new links on the next refresh cycle
- You may need to refresh your RSS reader to see the updated links
If CSS/JS files aren't loading with the internal reader:
- Verify the
static/directory exists and containsreader.cssandreader.js - Check Docker logs:
docker logs <container-name> - Ensure the
static/directory is copied in your Dockerfile (already configured inDockerfile.serve)
The SQLite database and RSS feeds are stored in the data/ directory by default. When running in Docker, mount this directory as a volume to persist data between container restarts.
MIT