Last active
November 22, 2016 22:09
-
-
Save MattMencel/3de8ed5de4d59c75a8acf6455ead9311 to your computer and use it in GitHub Desktop.
Get SPF Info From Google
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spf/query' | |
# regular metadata stuff below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# postfix recipe | |
q = SPF::Query::Record.query('_spf.google.com') | |
nets = [] | |
q.include.each do |inc| | |
ips = SPF::Query::Record.query(inc.value) | |
ips.ip4.each do |ip| | |
nets << ip.value.to_s | |
end | |
end | |
node.set['google_spf'] = nets | |
include_recipe 'postfix' | |
# other recipe stuff below |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment