Skip to content

OpenSMTPD 6.6+ filter for rewriting From address

License

Notifications You must be signed in to change notification settings

jirutka/opensmtpd-filter-rewrite-from

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenSMTPD filter-rewrite-from

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.

Requirements

Installation

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.

Configuration

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 [email protected]"

listen on socket filter "rewrite-from"

License

This project is licensed under ISC License. For the full text of the license, see the LICENSE file.


1. This implementation doesn’t support any conditions or different rewrite addresses based on the source. It’s really trivial, just for my current needs.

About

OpenSMTPD 6.6+ filter for rewriting From address

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages