NAME Mail::SPF::Publish - Assist in the creation of DNS records for the SPF standard. SYNOPSIS use Mail::SPF::Publish my $spf = Mail::SPF::Publish->new( ttl => 86400 ); $spf->mailserver( "mail_one", "mail1.example.com", "10.0.0.1" ); $spf->mailserver( "mail_two", "mail2.example.com", "10.0.0.2" ); $spf->domainservers( "example.com", "mail_one", "mail_two" ); $spf->domainincludes( "myvanity.com", "myisp.com", "myschool.edu" ); print $spf->output( format => 'bind4' ); DESCRIPTION This module and it's associated sample code are intended to be used to generate DNS zone files for SPF under tinydns and bind4-9, including any explicit wildcard recursion if necessary. Most people will want to use the supplied scripts for automatic generation of a zone, 'autospf' and 'spf2zone'. USAGE new Usage my $spf = Mail::SPF::Publish->new(); Purpose Creates a new SPF publishing module Returns The object it just created. Arguments explicit_wildcards Sets whether explicit wildcards are to be generated (Default: 1) format Sets the type of output you want, currently only two possible values: 'bind4' and 'tinydns'. (Default: 'bind4' ) ttl Sets the ttl for all entires in the generated DNS heirarchy. (Default: 86400) default Sets the default response for domains (but not on individual machines). You may set 'deny', 'softdeny', or 'accept'. (Default: 'deny') Please don't set 'accept'. mailserver Usage $spf->mailserver( alias, hostname, address ); Purpose Defines a mail server alias, and creates the SPF records for HELO lookups. Returns Nothing yet Arguments alias string alias for this entry hostname fully qualified domain name this mail server, and hostname name supplied at HELO phase. address network address of this mail server (currently only an ipv4 address is supported) domainservers Usage $spf->domainservers( domain, alias, ... ) Purpose Create SPF records to indicate that servers identified by 'alias, ...' are allowed to send from 'domain'. All others are subject to the policy defined by softhard() Returns Nothing Yet Arguments domain Domain name to which you are adding mail servers to for SPF record generation. alias, ... List of server aliases, defined with the mailserver() function. domainincludes Usage $spf->domainincludes( my_domain, other_domain, ... ) Purpose Creates 'SPFinclude=other_domain' TXT records for my_domain; this allows my_domain to designate mailservers belonging to other_domain. Arguments my_domain Domain under our control. other_domain, ... List of domains which SPFinclude records will point to. These domains are not under our control, but we want to designate their servers. Notes If the other_domains are under your control, use domainservers() to create full-fledged entries for them directly; this improves query time and saves traffic. output Usage print $spf->output(); or my $output = $spf->output(); Purpose Compiles domain information collected by all the previous method calls, and produces an output suitable for use in the specified (or default, if you didn't specify) name server. Returns A multi-line string containing the output. Arguments This function will take an 'explicit_wildcards' and 'format' option as documented under the new() function. The supplied values will be used to override the default provided in the new() function for the current run only. BUGS Undoubtably some, tests are the next thing on the list to be written. SUPPORT Please contact the author with any comments or questions. AUTHOR Jonathan Steinert hachi@cpan.org COPYRIGHT This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. SEE ALSO http://spf.pobox.com/ Mail::SPF::Query