May 102016
 

required: inotify-tools

first create this bash script, let’s name it as transport.sh

#!/bin/bash
while true; do
	inotifywait -e modify /etc/postfix/transport
	postmap hash:/etc/postfix/transport
done

make it executable

chmod 755 transport.sh

run the script

./transport.sh > /dev/null 2>&1&

this script will stay on background proccess.

try modify transport file

dd.com smtp:[x.x.x.x]:25
ee.com smtp:[x.x.x.x]:25

save it, and test it

postmap -q ee.com hash:/etc/postfix/transport
smtp:[x.x.x.x]:25

enjoy

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*