2020-08-24 18:13:33 +02:00
|
|
|
# Spamotron
|
|
|
|
|
|
|
|
Simple mailing script.
|
|
|
|
|
|
|
|
**Table of content**
|
|
|
|
|
|
|
|
- [Installation](#installation)
|
2020-08-25 09:02:02 +02:00
|
|
|
- [Input format](#input-format)
|
2020-08-24 18:13:33 +02:00
|
|
|
- [Licence](#licence)
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
### Requirements
|
|
|
|
|
|
|
|
On a Debian-based host running at least Debian Stretch, you will need the
|
|
|
|
following packages:
|
|
|
|
- git (recommended for getting the source)
|
|
|
|
- python3
|
2020-08-24 21:06:21 +02:00
|
|
|
- python3-jinja2
|
2020-08-24 18:13:33 +02:00
|
|
|
|
|
|
|
### Manual installation
|
|
|
|
|
|
|
|
1. Clone repo
|
|
|
|
|
|
|
|
$ git clone https://forge.april.org/adminsys/spamotron
|
2020-08-24 21:40:26 +02:00
|
|
|
$ cd spamotron
|
|
|
|
$ chmod a+x mailing.py
|
2020-08-24 18:13:33 +02:00
|
|
|
|
|
|
|
2. Try it
|
|
|
|
|
2020-08-24 21:40:26 +02:00
|
|
|
$ ./mailing.py --help
|
|
|
|
$ ./mailing.py -t test-recipients-data -b test-emailling --dry-run --verbose
|
2020-08-24 18:13:33 +02:00
|
|
|
|
2020-08-25 09:02:02 +02:00
|
|
|
## Input format
|
|
|
|
|
|
|
|
### CSV
|
|
|
|
|
|
|
|
The « to-file » is expected to be csv with the [default
|
|
|
|
dialect](https://docs.python.org/3/library/csv.html?highlight=csv#dialects-and-formatting-parameters)
|
|
|
|
(delimiter = `,` and char delimiter =`"`).
|
|
|
|
|
|
|
|
The first line declare columns headers. The `from` and `to` headers are
|
|
|
|
expected the be found. Headers are lower cased.
|
|
|
|
|
|
|
|
To avoid boring repetition it is possible to declare a default column value
|
|
|
|
using `:` in header. The default value is considered when the column is lacking,
|
|
|
|
not when the column is empty.
|
|
|
|
|
|
|
|
### Templates
|
|
|
|
|
|
|
|
The templates files are expected to be [jinja2
|
|
|
|
templates](https://jinja.palletsprojects.com/en/2.11.x/templates/). The csv
|
|
|
|
values are accessible using the column name, i.e. one can insert the recipient
|
|
|
|
address anywhere in template using `{{ to }}`.
|
|
|
|
|
|
|
|
Don't worry about escaping: HTML templates are auto escaped.
|
|
|
|
|
2020-08-24 18:13:33 +02:00
|
|
|
## License
|
|
|
|
|
|
|
|
Spamotron is developed by April and licensed under the [GPLv2+](LICENSE).
|