- Previous thread: matching IP ranges in headers
- Next thread: slow link
- Threads sorted by date: postfix 200906
> The following is "concept"; I don't have the script yet ready, but
> it'll be easy to write with your favorite scripting language:
>
> -------
> 1. get your remote sender's current SPF record:
>
> dig yourremotesender.com txt =C2=A0> tempfile
>
> 2. parse the result in tempfile with regex:
>
> /.*?ANSWER\sSECTION:.*?yourremotesender\.com*.\s+?\d+?\s+?IN\s+?TXT\s+?"v=
=3Dspf1\s+?([^)]+?)\s+?.all"/
The implementation seems a little fragile, but the concept should be
workable. On dig (at least the versions I've used), you can use +short
for parseable output. Example:
dig +short example.com TXT | grep 'v=3Dspf1' | egrep -o 'ip4:[0-9./]+' |
sed 's/^ip4://' | sed 's/$/ OK/' > tempfile
Something like that, anyway.
> it'll be easy to write with your favorite scripting language:
>
> -------
> 1. get your remote sender's current SPF record:
>
> dig yourremotesender.com txt =C2=A0> tempfile
>
> 2. parse the result in tempfile with regex:
>
> /.*?ANSWER\sSECTION:.*?yourremotesender\.com*.\s+?\d+?\s+?IN\s+?TXT\s+?"v=
=3Dspf1\s+?([^)]+?)\s+?.all"/
The implementation seems a little fragile, but the concept should be
workable. On dig (at least the versions I've used), you can use +short
for parseable output. Example:
dig +short example.com TXT | grep 'v=3Dspf1' | egrep -o 'ip4:[0-9./]+' |
sed 's/^ip4://' | sed 's/$/ OK/' > tempfile
Something like that, anyway.
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
- Raid level suggestions for mysql-server - mysql
- [PATCH] BKL: Remove BKL from Squashfs - kernel
- [Red5] Desktop sharing - osflash
- [jira] Created: (OFBIZ-3173) Better supportability for products of type MARKETING_PKG_AUTO in order processing and fulfillment p - ofbiz
- Ext firewire drive not mounted after update - freebsd
- [opensuse] No Mails from Cronjobs or root - opensuse
- [Samba] TOSHARG-Printing.xml translate finished and some bug found - samba
- [PHP] securing php pages - php
- Can't build 2.6.31.6 64bit kernel under Fedora11 - fedora
- KirbyBase : replacing string exceptions - python
- [gccgo] Don't force SSE2 - gcc
- [jquery-ui] SlickGrid updates - jquery