| cmd/wrap | ||
| internal/rfc822 | ||
| testdata | ||
| .gogogo.conf | ||
| go.mod | ||
| go.sum | ||
| Jenkinsfile | ||
| Makefile | ||
| README.md | ||
Wrap (better name required)
Wrap acts as a pipe for message modification. It prepends a preamble to the body of the message.
Usage
Wrap is a pipe. E.g. it can be integrated into the Exim MTA as a transport pipe:
begin transports
local_delivery:
driver = appendfile
file = /var/mail/$local_part_data
transport_filter = /usr/bin/wrap
Wrap understand a small set of options. Use wrap -h to learn more.
Templates
Most important is probalby use of templates for the preamble. A builtin set set of preambles (txt, html) is available out of the box. If you want to customize the preambles, start with the existing ones:
This creates a directory templates/ and drops there two files
preamble.txt and preamble.html.
wrap -populate templates
Now you edit these files. The possible placeholders are
.Date: the current date.Org: the organization (as set by the-organizationoption)
To use these customized templates, use the -templates option, e.g. as
in:
transport_filter = /usr/bin/wrap -templates $config_dir/templates
Build and install
Choose one of the following options (in ascending complexity):
- Install the ready built binary: navigate to the Package repo and download the binary.
- Install a recent Go (1.19 should do) and then use the Go installer:
GOBIN=/usr/local/bin go install go.schlittermann.de/ius/wrap/cmd/wrap@latest - Clone the Git repo and build from within the repo:
git clone --depth=1 https://gitea.schlittermann.de/ius/wrap cd wrap GOBIN=/usr/local/bin go install ./cmd/wrap
Updates
If you've Go installed, you can update the binary by simply doing re-download and rebuild it from the repository:
wrap -update