Unnamed repository; edit this file 'description' to name the repository.
Find a file
2025-04-13 09:36:48 +03:00
config Add initial files 2024-08-02 18:06:21 +03:00
mastodon_email_bridge strip response 2025-02-18 15:10:00 +02:00
templates Remove json 2025-02-19 18:44:23 +02:00
.gitignore Add initial files 2024-08-02 18:06:21 +03:00
Dockerfile Add initial files 2024-08-02 18:06:21 +03:00
install.sh Add wrappers 2025-04-13 09:36:48 +03:00
LICENSE Add license 2024-08-02 19:34:24 +03:00
MANIFEST.in Fix templates in virtualenv 2024-08-02 20:07:20 +03:00
mastodon_email_bridge.sh Add wrappers 2025-04-13 09:36:48 +03:00
podman_build.sh Add initial files 2024-08-02 18:06:21 +03:00
podman_run.sh Add initial files 2024-08-02 18:06:21 +03:00
pyproject.toml Add config for folders 2024-09-20 11:08:51 +03:00
README.md Add template subject 2024-08-10 18:03:31 +03:00
requirements.txt Fix templates in virtualenv 2024-08-02 20:07:20 +03:00
setup.cfg Add config for folders 2024-09-20 11:08:51 +03:00
setup.py Fix templates in virtualenv 2024-08-02 20:07:20 +03:00
wrapper.sh Add wrappers 2025-04-13 09:36:48 +03:00

mastodon_email_bridge

Simple script to forward your Mastodon Home timeline to your email.

Requirements

You need to obtain an application token with read access and provide it with the --token parameter.

Check the requirements.txt file but the installation should take care of everything.

Installation

Linux

python -m venv "${HOME}/pyenvs/mastodon_email_bridge"
source "${HOME}/pyenvs/mastodon_email_bridge/bin/activate"
pip install .
mkdir -p "${HOME}/.config/mastodon_email_bridge"
cp -r templates "${HOME}/.config/mastodon_email_bridge/"

Usage

Customize the templates (if you know HTML, CSS and Jinja2) and run the command.

  Usage: mastodon_email_bridge.py [OPTIONS]

  Options:
    -d, --debug-level [CRITICAL|ERROR|WARNING|INFO|DEBUG|NOTSET]
                                    Set the debug level for the standard output.
    -t, --token TEXT                Mastodon token with read access.  [required]
    -s, --server TEXT               Mastodon server full qualified name.
    -L, --limit INTEGER             Mastodon token with read access.
    -R, --limit-per-request INTEGER
                                    Mastodon token with read access.
    -w, --wait INTEGER              Seconds to wait between requests to avoid
                                    rate limits.
    -r, --recipient TEXT            Recipient email to get the posts. This can be a Jinja2 template.
                                    [required]
    -S, --sender TEXT               Sender email thant send the posts. This can be a Jinja2 template.
    -f, --sent-items-file TEXT      File to store the IDs of post already sent
                                    by email.
    -m, --mail-server TEXT          SMTP Mail server to send emails.
    -u, --mail-user TEXT            Username for SMTP Mail server to send
                                    emails.
    -P, --mail-pass TEXT            User password for SMTP Mail server to send
                                    emails.
    -p, --mail-server-port INTEGER  SMTP Mail server port to send emails.
    -t, --subjet-template TEXT      Jinja2 template for the subject of the
                                  emails.
    -l, --log-file TEXT             File to store all debug messages.
    --config FILE                   Read configuration from FILE.
    --help                          Show this message and exit.

Notes

  • Clean the folder ~/.mastodon_email_bridge_sent_items every now and then, but you can check the generated HTML files to test new templates.
  • The posts that have been sent by email are stored in an SQLite3 database in ~/.mastodon_email_bridge_sent_items.db if you want a post to be sent again you can remove it from there and run again the script.