mastodon_email_bridge/README.md

60 lines
2.7 KiB
Markdown
Raw Permalink Normal View History

2024-08-02 17:06:21 +02:00
# mastodon_email_bridge
2024-08-02 19:07:20 +02:00
Simple script to forward your Mastodon Home timeline to your email.
2024-08-02 17:06:21 +02:00
## Requirements
2024-08-02 19:07:20 +02:00
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.
2024-08-02 17:06:21 +02:00
## Installation
### Linux
```bash
2024-08-02 19:07:20 +02:00
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/"
2024-08-02 17:06:21 +02:00
```
## Usage
2024-08-02 19:16:34 +02:00
Customize the templates (if you know HTML, CSS and Jinja2) and run the command.
2024-08-02 19:07:20 +02:00
```
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.
2024-08-03 09:32:03 +02:00
-R, --limit-per-request INTEGER
Mastodon token with read access.
2024-08-02 19:07:20 +02:00
-w, --wait INTEGER Seconds to wait between requests to avoid
rate limits.
2024-08-03 14:13:50 +02:00
-r, --recipient TEXT Recipient email to get the posts. This can be a Jinja2 template.
2024-08-02 19:07:20 +02:00
[required]
2024-08-03 14:13:50 +02:00
-S, --sender TEXT Sender email thant send the posts. This can be a Jinja2 template.
2024-08-02 19:07:20 +02:00
-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.
2024-08-10 17:03:31 +02:00
-t, --subjet-template TEXT Jinja2 template for the subject of the
emails.
2024-08-02 19:07:20 +02:00
-l, --log-file TEXT File to store all debug messages.
--config FILE Read configuration from FILE.
--help Show this message and exit.
2024-08-02 17:06:21 +02:00
```
2024-08-03 09:27:05 +02:00
## 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.