- Previous thread: matching IP ranges in headers
- Next thread: slow link
- Threads sorted by date: postfix 200906
Here's the completed script (the IP/CIDR extract worked perfectly --
thanks Barney!):
---
#!/bin/sh
ORIGINAL=/usr/local/etc/postfix/tables/client_access_maps.cidr
NEW=/tmp/postfix_clients.tmp
dig +short senderdomain.net TXT | grep 'v=spf1' | egrep -o
'ip4:[0-9./]+' | sed 's/^ip4://' | sed 's/$/ OK/' > $NEW
ORIGINAL_CK=`cksum $ORIGINAL | awk '{print $1}'`
NEW_CK=`cksum $NEW | awk '{print $1}'`
if [ -s $NEW ] ; then
if [ $ORIGINAL_CK != $NEW_CK ] ; then
cp -f $NEW $ORIGINAL
postfix reload > /dev/null
fi
fi
rm $NEW
exit 0
---
It works except that the Postfix refresh message
("postfix/postfix-script: refreshing the Postfix mail system") is
displayed despite of the attempt to redirect it to /dev/null? Any
idea how I could hide it?
Ville
thanks Barney!):
---
#!/bin/sh
ORIGINAL=/usr/local/etc/postfix/tables/client_access_maps.cidr
NEW=/tmp/postfix_clients.tmp
dig +short senderdomain.net TXT | grep 'v=spf1' | egrep -o
'ip4:[0-9./]+' | sed 's/^ip4://' | sed 's/$/ OK/' > $NEW
ORIGINAL_CK=`cksum $ORIGINAL | awk '{print $1}'`
NEW_CK=`cksum $NEW | awk '{print $1}'`
if [ -s $NEW ] ; then
if [ $ORIGINAL_CK != $NEW_CK ] ; then
cp -f $NEW $ORIGINAL
postfix reload > /dev/null
fi
fi
rm $NEW
exit 0
---
It works except that the Postfix refresh message
("postfix/postfix-script: refreshing the Postfix mail system") is
displayed despite of the attempt to redirect it to /dev/null? Any
idea how I could hide it?
Ville
Conversations: Tip: Restricting mail reception using a remote service's SPF records
- Tip: Restricting mail reception using a remote service's SPF records by Ville Walveranta on 2009-06-25T07:47:47+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by Barney Desmond on 2009-06-25T09:54:48+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by Ville Walveranta on 2009-06-25T10:48:50+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by Ville Walveranta on 2009-06-25T20:34:23+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by J.P. Trosclair on 2009-06-25T20:40:21+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by Roderick A. Anderson on 2009-06-25T20:41:33+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by Gerardo Herzig on 2009-06-25T20:42:15+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by Ville Walveranta on 2009-06-25T20:50:46+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by LuKreme on 2009-06-26T01:19:09+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by mouss on 2009-06-26T22:18:11+00:00
- Re: Tip: Restricting mail reception using a remote service's SPF records by Ville Walveranta on 2009-06-27T05:46:29+00:00
Related Threads
- PATCH: ni_labpc.c - kernel
- [ruby-core:28420] [Bug #2834] Matrix/Vector should be rewritten in C to improve speed - ruby
- [PATCH 04/14] mshtml: Allow post data and headers to be passed to create_channelbsc. - wine
- (View) How to check a fields value in a foreach loop? - cakephp
- Re: [squid-users] Ignore requests from certain hosts in access_log - squid
- Proposal for a new camel-bean-validation component based on jsr 303 - apachecamel
- UPDATE: audio/xmp - openbsd
- [users@httpd] RFC5789 and PATCH HTTP method - httpd
- Issue in combine pass. - gcc
- [ruby-core:28981] [Bug #3012] update file list in sample/README - ruby
- [GIT] Networking - kernel