All Projects → skx → rss2email

skx / rss2email

Licence: GPL-2.0 License
Convert RSS feeds to emails

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to rss2email

Inbrief
InBrief is a personal briefing app and dashboard powered by Electron and React
Stars: ✭ 90 (+25%)
Mutual labels:  rss, email
Workbase Server
Slack alternative, email integrated, build with Meteor
Stars: ✭ 284 (+294.44%)
Mutual labels:  rss, email
feed2email
RSS/Atom feed updates in your email
Stars: ✭ 37 (-48.61%)
Mutual labels:  rss, rss2email
Mautic Rss To Email Bundle
Mautic plugin to send emails from RSS
Stars: ✭ 69 (-4.17%)
Mutual labels:  rss, email
rss2hook
POST to webhook(s) when new feed-items appear.
Stars: ✭ 33 (-54.17%)
Mutual labels:  rss, golang-application
goeland
An alternative to rss2email written in golang with many filters
Stars: ✭ 78 (+8.33%)
Mutual labels:  rss, rss2email
eventsourcing-go
Event Sourcing + CQRS using Golang Tutorial
Stars: ✭ 75 (+4.17%)
Mutual labels:  rss, golang-application
Email-Spammer
Great script for sending and spaming emails! gmail, yahoo, outlook, hotmail.
Stars: ✭ 79 (+9.72%)
Mutual labels:  email
email-providers
A list of common eMail providers.
Stars: ✭ 17 (-76.39%)
Mutual labels:  email
Maily-Form
Forms on any website
Stars: ✭ 29 (-59.72%)
Mutual labels:  email
SpamgourmetReloaded
SpamgourmetReloaded is a remake of the original spamgourmet.com service - made in Kotlin. The project includes a mailserver and a webinterface.
Stars: ✭ 18 (-75%)
Mutual labels:  email
lttrs-android
No-frills, easy to use, easy to maintain Email client for Android based on the JSON Meta Application Protocol (JMAP).
Stars: ✭ 176 (+144.44%)
Mutual labels:  email
thymeflow
Installer for Thymeflow, a personal knowledge management system.
Stars: ✭ 27 (-62.5%)
Mutual labels:  email
sender policy flattener
Compact large SPF chains into flat blocks of IP addresses
Stars: ✭ 25 (-65.28%)
Mutual labels:  email
nuxt-mail
Adds email sending capability to a Nuxt.js app. Adds a server route, an injected variable, and uses nodemailer to send emails.
Stars: ✭ 62 (-13.89%)
Mutual labels:  email
DANE-for-SMTP
'DANE for SMTP' wiki
Stars: ✭ 28 (-61.11%)
Mutual labels:  email
rss-button-for-safari
Safari web extension for news feed discovery of RSS, Atom, JSON Feed & RDF+RSS.
Stars: ✭ 16 (-77.78%)
Mutual labels:  rss
maildog
🐶 Hosting your own email forwarding service on AWS and managing it with Github Actions
Stars: ✭ 381 (+429.17%)
Mutual labels:  email
trualias
Mentally computable verification codes for email aliases implemented as a postfix tcp table or milter; uses asyncio.
Stars: ✭ 33 (-54.17%)
Mutual labels:  email
tf
Telefeedbot
Stars: ✭ 16 (-77.78%)
Mutual labels:  rss

Go Report Card license Release

Table of Contents

RSS2Email

This project began life as a naive port of the python-based r2e utility to golang.

Over time we've now gained a few more features:

  • The ability to customize the email-templates which are generated and sent.
  • The ability to send email via STMP, or via /usr/sbin/sendmail.

Installation

If you wish you can fetch a binary from our release page.

Build with Go Modules

# make sure to clone outside of GOPATH
git clone https://github.com/skx/rss2email
cd rss2email
go install

Version NOTES:

  • You'll need version 1.16 or higher to build.
    • Because we use go embed to embed our (default) email-template within the binary.
  • If you wish to run the included fuzz-tests against our configuration file parser you'll need at least version 1.18beta1.

bash completion

The binary has integrated support for TAB-completion, for bash. To enable this update your dotfiles to include the following:

source <(./rss2email bash-completion)

Feed Configuration

Once you have installed the application you'll need to configure the feeds to monitor. As of the 2.x release of rss2email the configuration file is:

  • ~/.rss2email/feeds.txt

You can create/edit that file by hand if you wish, however there are several built-in sub-commands for manipulating the feed-list, for example you can add a new feed to monitor via the add sub-command:

 $ rss2email add https://example.com/blog.rss

OPML files can be imported via the import sub-command:

 $ rss2email import feeds.opml

The list of feeds can be displayed via the list subcommand (note that adding the -verbose flag will fetch each of the feeds and that will be slow):

 $ rss2email list [-verbose]

Finally you can remove an entry from the feed-list via the delete sub-command:

 $ rss2email delete https://example.com/foo.rss

The configuration file in its simplest form is nothing more than a list of URLs, one per line. However there is also support for adding per-feed options:

   https://foo.example.com/
    - key:value
   https://foo.example.com/
    - key2:value2

This is documented and explained in the integrated help:

$ rss2email help config

Adding per-feed items allows excluding feed-entries by regular expression, for example this does what you'd expect:

   https://www.filfre.net/feed/rss/
    - exclude-title: The Analog Antiquarian

Usage

Once you've populated your feed list, via a series of rss2email add .. commands, or by editing the configuration file directly, you are now ready to actually launch the application.

To run the application, announcing all new feed-items by email to [email protected] you'd run this:

$ rss2email cron [email protected]

Once the feed-list has been fetched, and items processed, the application will terminate. It is expected that you'll add an entry to your crontab file to ensure this runs regularly. For example you might wish to run the check & email process once every 15 minutes, so you could add this:

 # Announce feed-changes via email four times an hour
 */15 * * * * $HOME/go/bin/rss2email cron [email protected]

When new items appear in the feeds they will then be sent to you via email. Each email will be multi-part, containing both text/plain and text/html versions of the new post(s). There is a default template which should contain the things you care about:

  • A link to the item posted.
  • The subject/title of the new feed item.
  • The HTML and Text content of the new feed item.

If you wish you may customize the template which is used to generate the notification email, see email-customization for details. It is also possible to run in a daemon mode which will leave the process running forever, rather than terminating after walking the feeds once.

The state of feed-entries is recorded beneath ~/.rss2email/state.db, which is a boltdb database.

Daemon Mode

Typically you'd invoke rss2email with the cron sub-command as we documented above. This works in the naive way you'd expect:

  • Read the contents of each URL in the feed-list.
  • For each feed-item which is new generate and send an email.
  • Terminate.

The daemon process does a similar thing, however it does not terminate. Instead the process becomes:

  • Read the contents of each URL in the feed-list.
  • For each feed-item which is new generate and send an email.
  • Sleep for 15 minutes by default.
    • Set the SLEEP environmental variable if you wish to change this.
    • e.g. "export SLEEP=5" will cause a five minute delay between restarts.
  • Begin the process once more.

In short the process runs forever, in the foreground. This is expected to be driven by docker or a systemd-service. Creating the appropriate configuration is left as an exercise, but you might examine the following two files for inspiration:

Initial Run

When you add a new feed all the items contained within that feed will initially be unseen/new, and this means you'll receive a flood of emails if you were to run:

 $ rss2email add https://blog.steve.fi/index.rss
 $ rss2email cron [email protected]

To avoid this you can use the -send=false flag, which will merely record each item as having been seen, rather than sending you emails:

 $ rss2email add https://blog.steve.fi/index.rss
 $ rss2email cron -send=false [email protected]

Assumptions

Because this application is so minimal there are a number of assumptions baked in:

  • We assume that /usr/sbin/sendmail exists and will send email successfully.
    • You can cause emails to be sent via SMTP, see SMTP-setup for details.
  • We assume the recipient and sender email addresses can be the same.
    • i.e. If you mail output to [email protected] that will be used as the sender address.
    • You can change the default sender via the email-customization process described next if you prefer though.

SMTP Setup

By default the outgoing emails we generate are piped to /usr/sbin/sendmail to be delivered. If that is unavailable, or unsuitable, you can instead configure things such that SMTP is used directly.

To configure SMTP you need to setup the following environmental-variables (environmental variables were selected as they're natural to use within Docker and systemd-service files).

Name Example Value
SMTP_HOST smtp.gmail.com
SMTP_PORT 587
SMTP_USERNAME [email protected]
SMTP_PASSWORD secret!value

If those values are present then SMTP will be used, otherwise the email will be sent via the local MTA.

Email Customization

By default the emails are sent using a template file which is embedded in the application. You can override the template by creating the file ~/.rss2email/email.tmpl, if that is present then it will be used instead of the default.

You can copy the default-template to the right location by running the following, before proceeding to edit it as you wish:

$ rss2email list-default-template > ~/.rss2email/email.tmpl

You can view the default template via the following command:

$ rss2email list-default-template

The default template contains a brief header documenting the available fields, and functions, which you can use. As the template uses the standard Golang text/template facilities you can be pretty creative with it!

If you're a developer who wishes to submit changes to the embedded version you should carry out the following two-step process to make your change.

  • Edit template/template.txt, which is the source of the template.
  • Rebuild the application to update the embedded copy.

NOTE: If you read the earlier section on configuration you'll see that it is possible to add per-feed configuration values to the config file. One of the supported options is to setup a feed-specific template-file.

Changing default From address

As noted earlier when sending the notification emails the recipient address is used as the sender-address too. There are no flags for changing the From: address used to send the emails, however using the section above you can use a customized email-template, and simply update the template to read something like this:

From: [email protected]
To: {{.To}}
Subject: [rss2email] {{.Subject}}
X-RSS-Link: {{.Link}}
X-RSS-Feed: {{.Feed}}
  • i.e. Change the {{.From}} to your preferred sender-address.

Implementation Overview

The two main commands are cron and daemon and they work in roughly the same way:

The other subcommands mostly just interact with the feed-list, via the use of configfile/configfile.go to add/delete/list the contents of the feed-list.

Github Setup

This repository is configured to run tests upon every commit, and when pull-requests are created/updated. The testing is carried out via .github/run-tests.sh which is used by the github-action-tester action.

Releases are automated in a similar fashion via .github/build, and the github-action-publish-binaries action.

Steve

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].