This repository has been archived on 2021-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
mail/postfix/scripts/map-hotplug.sh
Simon Bruder 91387b1559
Some checks reported errors
continuous-integration/drone/push Build was killed
Add option to block specific senders
2019-08-01 12:04:30 +00:00

8 lines
308 B
Bash
Executable file

#!/bin/sh
if [ "$1" == "c" ] && [ "$2" == "/etc/postfix/hotplug.d/" ] && ([ "$3" == "virtual" ] || [ "$3" == "access_sender" ]); then
cp "/etc/postfix/hotplug.d/$3" "/etc/postfix/$3"
chown root:root "/etc/postfix/$3"
postmap "/etc/postfix/$3"
echo "$(date +"%b %d %H:%M:%H"): remapped $3"
fi