Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mildis/opensmtpd-go-filter-prepend
OpenSMTPD filter which prepends a string on email's subject if not present
https://github.com/mildis/opensmtpd-go-filter-prepend
go opensmtpd opensmtpd-filter
Last synced: 24 days ago
JSON representation
OpenSMTPD filter which prepends a string on email's subject if not present
- Host: GitHub
- URL: https://github.com/mildis/opensmtpd-go-filter-prepend
- Owner: mildis
- License: gpl-3.0
- Created: 2020-03-29T10:50:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-16T15:09:20.000Z (almost 3 years ago)
- Last Synced: 2024-10-13T14:10:48.261Z (2 months ago)
- Topics: go, opensmtpd, opensmtpd-filter
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - opensmtpd-go-filter-prepend
README
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mildis_opensmtpd-go-filter-prepend&metric=alert_status)](https://sonarcloud.io/dashboard?id=mildis_opensmtpd-go-filter-prepend)
# opensmtpd-go-filter-prepend
OpenSMTPD filter which prepends a string on email's subject if not present.
Works with OpenSMTPD 6.6 and 6.7.## Usage
* build the filter for your target platform
`env GOOS=openbsd GOARCH=amd64 go build filter-prepend.go`
* make OpenSMTPD use the filter
```
filter prepend proc-exec "filter-prepend-go --prefix='[*EXT*]' --extraprefix='[EXT]'"
listen on em0 tls pki "*" filter { senderscore, rspamd, prepend }
```
* default prefix is `[*EXT*]` if not specified on the CLI
* default extraprefix is `[EXT]` if not specified on the CLI
Be warned that a too generic prefix could match legitimate wording and thus it won't be added to the Subject
* option `--encode` forces prefix encoding whether the subject is encoded or not.## Known limitations
1. if Subject is too long and spans between multiple datalines, only the begining will be analyzed for prefix token
2. RFC2047 Subject won't be decoded if 1/ happens inside an encoded string