Improvements to forwarding hosts in Postfix
- No more premature EOF and no more leaking of bash processes
- Log result
- Correctly treat non-CIDR entries
- Adapt to schema change from df71e97
- Correctly report SQL failure
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
while true; do
|
||||
read QUERY
|
||||
while read QUERY; do
|
||||
QUERY=($QUERY)
|
||||
if [ "${QUERY[0]}" != "get" ]; then
|
||||
echo "500 dunno"
|
||||
continue
|
||||
fi
|
||||
echo $(curl -s http://172.22.1.251:8081/forwardinghosts.php?host=${QUERY[1]})
|
||||
result=$(curl -s http://172.22.1.251:8081/forwardinghosts.php?host=${QUERY[1]})
|
||||
logger -t whitelist_forwardinghosts -p mail.info "Look up ${QUERY[1]} on whitelist, result $result"
|
||||
echo $result
|
||||
done
|
||||
|
Reference in New Issue
Block a user