This is a very simple OpenSMTPD filter for rewriting email address in both MAIL FROM
command and From
header in all [1] messages with the specified email address.
It’s useful when you want to ensure that all the relayed messages will be “send from” some no-reply email address.
This filter is implemented in ~60 lines (LoC) of awk
.
Just copy filter-rewrite-from to some directory, e.g. /usr/local/share/opensmtpd
.
If you have awk
installed in a different directory than /usr/bin
, adjust the shebang.
The filter itself requires no configuration, only the desired From email address as the first argument.
It must be declared in smtpd.conf and attached to a listener:
filter "rewrite-from" proc-exec "/usr/local/share/opensmtpd/filter-rewrite-from no-reply@example.org"
listen on socket filter "rewrite-from"
This project is licensed under ISC License. For the full text of the license, see the LICENSE file.