[wip] Repack mime parts to prepend a custom one
Find a file
2025-05-18 21:20:02 +02:00
cmd/wrap src: remove missing go.schlittermann.de/heiko/update 2024-12-21 19:52:15 +01:00
internal/rfc822 tidy: header type check 2023-05-19 10:34:50 +02:00
testdata test: add more testdata file (compressed) 2023-05-19 09:56:04 +02:00
.gogogo.conf gogogo: enable tests 2025-05-18 21:20:02 +02:00
go.mod go: update dependencies 2025-05-18 21:19:54 +02:00
go.sum go: update dependencies 2025-05-18 21:19:54 +02:00
Jenkinsfile new: Jenkinsfile 2023-04-17 07:50:23 +02:00
Makefile add: Makefile 2023-04-17 07:58:37 +02:00
README.md add: README.md 2023-04-17 21:25:43 +02:00

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 -organization option)

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