Bug 157107 - conflict between mail/p5-Mail-SPF and mail/libspf2
Summary: conflict between mail/p5-Mail-SPF and mail/libspf2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Stefan Walter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 10:10 UTC by mickael.maillot
Modified: 2013-06-16 19:20 UTC (History)
0 users

See Also:


Attachments
p5-Mail-SPF.patch (52.82 KB, patch)
2011-05-24 18:58 UTC, gmc
no flags Details | Diff
p5-Mail-SPF.patch (52.96 KB, patch)
2013-05-06 18:39 UTC, jake.guffey
no flags Details | Diff
file.dat (292 bytes, text/plain; charset=us-ascii)
2013-05-06 18:39 UTC, jake.guffey
no flags Details
file.dat (1 bytes, multipart/mixed; boundary="Apple-Mail=_3F33203E-DC8C-43E0-A031-6801F5C6A45F")
2013-05-14 16:10 UTC, jake.guffey
no flags Details
p5-Mail-SPF.patch (6.14 KB, patch)
2013-05-14 19:41 UTC, Stefan Walter
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mickael.maillot 2011-05-17 10:10:10 UTC
mail/p5-Mail-SPF and mail/libspf2 install the same bin file: bin/spfquery
Comment 1 Edwin Groothuis freebsd_committer 2011-05-17 10:10:24 UTC
Maintainer of mail/p5-Mail-SPF,

Please note that PR ports/157107 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157107

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer 2011-05-17 10:10:26 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 gmc 2011-05-17 16:21:36 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There is no patch in the pr, nor a proposed solution. I will have a look
but am tied up for the moment so it might be a while.

On Tue, May 17, 2011 at 09:10:24AM +0000, Edwin Groothuis wrote:
> Maintainer of mail/p5-Mail-SPF,
> 
> Please note that PR ports/157107 has just been submitted.
> 
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
> 
> The full text of the PR can be found at:
>     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157107
> 
> -- 
> Edwin Groothuis via the GNATS Auto Assign Tool
> edwin@FreeBSD.org
> 
> 

- -- 
http://www.sonologic.nl/
http://koenmartens.nl/
https://www.revspace.nl/
http://hxxfoundation.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk3Skn8ACgkQktDgRrkFPpY5kACgmW0D0qNKMnOOVmWaPF6C/Bax
HZ4AmwWyKXkCP1xy7RwFIr6PZl8VgMJ8
=30Kl
-----END PGP SIGNATURE-----
Comment 4 gmc 2011-05-24 18:58:20 UTC
This patch should fix it.

On Tue, May 17, 2011 at 09:10:24AM +0000, Edwin Groothuis wrote:
> Maintainer of mail/p5-Mail-SPF,
> 
> Please note that PR ports/157107 has just been submitted.
> 
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
> 
> The full text of the PR can be found at:
>     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157107
> 
> -- 
> Edwin Groothuis via the GNATS Auto Assign Tool
> edwin@FreeBSD.org
> 
> 

-- 
http://www.sonologic.nl/
http://koenmartens.nl/
https://www.revspace.nl/
http://hxxfoundation.com/
Comment 5 gmc 2011-05-24 18:59:42 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


diff -Naur p5-Mail-SPF.dist/Makefile p5-Mail-SPF/Makefile
- --- p5-Mail-SPF.dist/Makefile	2009-11-15 10:07:11.000000000 +0100
+++ p5-Mail-SPF/Makefile	2011-05-24 19:52:00.000000000 +0200
@@ -15,6 +15,9 @@
 MAINTAINER=	gmc@sonologic.nl
 COMMENT=	Reference implementation of the RFC 4408 SPF protocol
 
+OPTIONS=	SPFQUERY "Install spfquery command-line tool" on \
+		SPFQUERY_SUFFIX "Add .pl suffix to spfquery" off
+
 RUN_DEPENDS=	p5-Net-DNS-Resolver-Programmable>=0.002.1:${PORTSDIR}/dns/p5-Net-DNS-Resolver-Programmable \
 		p5-Net-DNS>=0.58:${PORTSDIR}/dns/p5-Net-DNS \
 		p5-version>0:${PORTSDIR}/devel/p5-version \
@@ -28,7 +31,6 @@
 PERL_MODBUILD=	5.6.0+
 CONFIGURE_ARGS=	--install_path sbin=${PREFIX}/sbin
 
- -MAN1=		spfquery.1
 MAN3=		Mail::SPF.3 Mail::SPF::Mech::PTR.3 Mail::SPF::Mech.3 \
 		Mail::SPF::SenderIPAddrMech.3 Mail::SPF::MacroString.3 \
 		Mail::SPF::Mech::IP4.3 Mail::SPF::Mech::A.3 \
@@ -45,6 +47,24 @@
 DOCSDIR=	${PREFIX}/share/doc/p5-Mail-SPF
 DOCS=		CHANGES INSTALL LICENSE README TODO
 
+.if defined(WITH_SPFQUERY)
+PLIST_SUB+= SPFQUERY=""
+
+.if defined(WITH_SPFQUERY_SUFFIX)
+PLIST_SUB+= SPFQUERY_SUFFIX=".pl"
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-spfquery-suffix
+MAN1+=		spfquery.pl.1
+.else
+PLIST_SUB+= SPFQUERY_SUFFIX=""
+MAN1+=		spfquery.1
+CONFLICTS+=	libspf2*
+.endif
+
+.else
+PLIST_SUB+= SPFQUERY="@comment "
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-no-spfquery
+.endif
+
 post-install:
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
diff -Naur p5-Mail-SPF.dist/files/extra-patch-no-spfquery p5-Mail-SPF/files/extra-patch-no-spfquery
- --- p5-Mail-SPF.dist/files/extra-patch-no-spfquery	1970-01-01 01:00:00.000000000 +0100
+++ p5-Mail-SPF/files/extra-patch-no-spfquery	2011-05-24 19:30:10.000000000 +0200
@@ -0,0 +1,33 @@
+diff -Naur orig/Build.PL Build.PL
+--- orig/Build.PL	2009-10-31 23:16:14.000000000 +0100
++++ Build.PL	2011-05-24 19:27:19.000000000 +0200
+@@ -66,7 +66,6 @@
+                         => 'v0.002.1',
+     },
+     script_files    => [
+-        'bin/spfquery'
+     ],
+     install_path    => {
+         'sbin'          => '/usr/sbin'
+diff -Naur orig/MANIFEST MANIFEST
+--- orig/MANIFEST	2009-10-31 23:16:14.000000000 +0100
++++ MANIFEST	2011-05-24 19:26:56.000000000 +0200
+@@ -1,4 +1,3 @@
+-bin/spfquery
+ Build.PL
+ CHANGES
+ debian/changelog
+diff -Naur orig/README README
+--- orig/README	2009-10-31 23:16:14.000000000 +0100
++++ README	2011-05-24 19:27:05.000000000 +0200
+@@ -12,9 +12,8 @@
+ This release of Mail::SPF fully conforms to RFC 4408 and passes the 2008.08
+ release of the official test-suite <http://www.openspf.org/Test_Suite>.
+ 
+-The Mail::SPF source package includes the following additional tools:
++The Mail::SPF source package includes the following additional tool:
+ 
+-  * spfquery:  A command-line tool for performing SPF checks.
+   * spfd:      A daemon for services that perform SPF checks frequently.
+ 
+ Mail::SPF is not your mother!
diff -Naur p5-Mail-SPF.dist/files/extra-patch-spfquery-suffix p5-Mail-SPF/files/extra-patch-spfquery-suffix
- --- p5-Mail-SPF.dist/files/extra-patch-spfquery-suffix	1970-01-01 01:00:00.000000000 +0100
+++ p5-Mail-SPF/files/extra-patch-spfquery-suffix	2011-05-24 19:41:56.000000000 +0200
@@ -0,0 +1,1505 @@
+diff -Naur orig/Build.PL Build.PL
+--- orig/Build.PL	2009-10-31 23:16:14.000000000 +0100
++++ Build.PL	2011-05-24 19:40:10.000000000 +0200
+@@ -66,7 +66,7 @@
+                         => 'v0.002.1',
+     },
+     script_files    => [
+-        'bin/spfquery'
++        'bin/spfquery.pl'
+     ],
+     install_path    => {
+         'sbin'          => '/usr/sbin'
+diff -Naur orig/MANIFEST MANIFEST
+--- orig/MANIFEST	2009-10-31 23:16:14.000000000 +0100
++++ MANIFEST	2011-05-24 19:40:36.000000000 +0200
+@@ -1,4 +1,4 @@
+-bin/spfquery
++bin/spfquery.pl
+ Build.PL
+ CHANGES
+ debian/changelog
+diff -Naur orig/README README
+--- orig/README	2009-10-31 23:16:14.000000000 +0100
++++ README	2011-05-24 19:40:54.000000000 +0200
+@@ -14,8 +14,8 @@
+ 
+ The Mail::SPF source package includes the following additional tools:
+ 
+-  * spfquery:  A command-line tool for performing SPF checks.
+-  * spfd:      A daemon for services that perform SPF checks frequently.
++  * spfquery.pl: A command-line tool for performing SPF checks.
++  * spfd:        A daemon for services that perform SPF checks frequently.
+ 
+ Mail::SPF is not your mother!
+ -----------------------------
+diff -Naur orig/bin/spfquery bin/spfquery
+--- orig/bin/spfquery	2009-10-31 23:16:14.000000000 +0100
++++ bin/spfquery	1970-01-01 01:00:00.000000000 +0100
+@@ -1,731 +0,0 @@
+-#!/usr/bin/perl
+-
+-# 
+-# spfquery: Command-line tool for performing SPF queries
+-#
+-# (C) 2005-2008 Julian Mehnle <julian@mehnle.net>
+-#     2004      Wayne Schlitt <wayne@schlitt.net>
+-# $Id: spfquery 138 2006-01-22 18:00:34Z julian $
+-#
+-##############################################################################
+-
+-=head1 NAME
+-
+-spfquery - (Mail::SPF) - Checks if a given set of e-mail parameters matches a
+-domain's SPF policy
+-
+-=head1 VERSION
+-
+-2.501
+-
+-=head1 SYNOPSIS
+-
+-=over
+-
+-=item B<Preferred usage:>
+-
+-B<spfquery> [B<--versions>|B<-v> B<1>|B<2>|B<1,2>] [B<--scope>|B<-s> B<helo>|B<mfrom>|B<pra>]
+-B<--identity>|B<--id> I<identity> B<--ip-address>|B<--ip> I<ip-address>
+-[B<--helo-identity>|B<--helo-id> I<helo-identity>] [I<OPTIONS>]
+-
+-B<spfquery> [B<--versions>|B<-v> B<1>|B<2>|B<1,2>] [B<--scope>|B<-s> B<helo>|B<mfrom>|B<pra>]
+-B<--file>|B<-f> I<filename>|B<-> [I<OPTIONS>]
+-
+-=item B<Legacy usage:>
+-
+-B<spfquery> B<--helo> I<helo-identity> B<--ip-address>|B<--ip> I<ip-address> [I<OPTIONS>]
+-
+-B<spfquery> B<--mfrom> I<mfrom-identity> B<--ip-address>|B<--ip> I<ip-address>
+-[B<--helo> I<helo-identity>] [I<OPTIONS>]
+-
+-B<spfquery> B<--pra> I<pra-identity> B<--ip-address>|B<--ip> I<ip-address> [I<OPTIONS>]
+-
+-=item B<Other usage:>
+-
+-B<spfquery> B<--version>|B<-V>
+-
+-B<spfquery> B<--help>
+-
+-=back
+-
+-=head1 DESCRIPTION
+-
+-B<spfquery> checks if a given set of e-mail parameters (e.g., the SMTP sender's
+-IP address) matches the responsible domain's Sender Policy Framework (SPF)
+-policy.  For more information on SPF see L<http://www.openspf.org>.
+-
+-=head2 Preferred Usage
+-
+-The following usage forms are preferred over the L<legacy forms|/Legacy usage>
+-used by older B<spfquery> versions:
+-
+-The B<--identity> form checks if the given I<ip-address> is an authorized SMTP
+-sender for the given C<helo> hostname, C<mfrom> envelope sender e-mail address,
+-or C<pra> (so-called purported resonsible address) e-mail address, depending
+-on the value of the B<--scope> option (which defaults to B<mfrom> if omitted).
+-
+-The B<--file> form reads "I<ip-address> I<identity> [I<helo-identity>]" tuples
+-from the file with the specified I<filename>, or from standard input if
+-I<filename> is B<->, and checks them against the specified scope (B<mfrom> by
+-default).
+-
+-Both forms support an optional B<--versions> option, which specifies a
+-comma-separated list of the SPF version numbers of SPF records that may be
+-used.  B<1> means that C<v=spf1> records should be used.  B<2> means that
+-C<spf2.0> records should be used.  Defaults to B<1,2>, i.e., uses any SPF
+-records that are available.  Records of a higher version are preferred.
+-
+-=head2 Legacy Usage
+-
+-B<spfquery> versions before 2.500 featured the following usage forms, which are
+-discouraged but still supported for L<backwards compatibility|/COMPATIBILITY>:
+-
+-The B<--helo> form checks if the given I<ip-address> is an authorized SMTP
+-sender for the C<HELO> hostname given as the I<identity> (so-called C<HELO>
+-check).
+-
+-The B<--mfrom> form checks if the given I<ip-address> is an authorized SMTP
+-sender for the envelope sender email-address (or domain) given as the
+-I<identity> (so-called C<MAIL FROM> check).  If a domain is given instead of an
+-e-mail address, C<postmaster> will be substituted for the localpart.
+-
+-The B<--pra> form checks if the given I<ip-address> is an authorized SMTP
+-sender for the PRA (Purported Responsible Address) e-mail address given as the
+-identity.
+-
+-=head2 Other Usage
+-
+-The B<--version> form prints version information of spfquery.  The B<--help>
+-form prints usage information for spfquery.
+-
+-=head1 OPTIONS
+-
+-=head2 Standard Options
+-
+-The preferred and legacy forms optionally take any of the following
+-I<OPTIONS>:
+-
+-=over
+-
+-=item B<--default-explanation> I<string>
+-
+-=item B<--def-exp> I<string>
+-
+-Use the specified I<string> as the default explanation if the authority domain
+-does not specify an explanation string of its own.
+-
+-=item B<--hostname> I<hostname>
+-
+-Use I<hostname> as the host name of the local system instead of auto-detecting
+-it.
+-
+-=item B<--keep-comments>
+-
+-=item B<--no-keep-comments>
+-
+-Do (not) print any comments found when reading from a file or from standard
+-input.
+-
+-=item B<--sanitize> (currently ignored)
+-
+-=item B<--no-sanitize> (currently ignored)
+-
+-Do (not) sanitize the output by condensing consecutive white-space into a
+-single space and replacing non-printable characters with question marks.
+-Enabled by default.
+-
+-=item B<--debug> (currently ignored)
+-
+-Print out debug information.
+-
+-=back
+-
+-=head2 Black Magic Options
+-
+-Several options that were supported by earlier versions of B<spfquery> are
+-considered black magic (i.e. potentially dangerous for the innocent user) and
+-are thus disabled by default.  If the L<B<Mail::SPF::BlackMagic>> Perl module
+-is installed, they may be enabled by specifying B<--enable-black-magic>.
+-
+-=over
+-
+-=item B<--max-dns-interactive-terms> I<n>
+-
+-Evaluate a maximum of I<n> DNS-interactive mechanisms and modifiers per SPF
+-check.  Defaults to B<10>.  Do I<not> override the default unless you know what
+-you are doing!
+-
+-=item B<--max-name-lookups-per-term> I<n>
+-
+-Perform a maximum of I<n> DNS name look-ups per mechanism or modifier.
+-Defaults to B<10>.  Do I<not> override the default unless you know what you are
+-doing!
+-
+-=item B<--authorize-mxes-for> I<email-address>|I<domain>B<,>...
+-
+-Consider all the MXes of the comma-separated list of I<email-address>es and
+-I<domain>s as inherently authorized.
+-
+-=item B<--tfwl>
+-
+-Perform C<trusted-forwarder.org> accreditation checking.
+-
+-=item B<--guess> I<spf-terms>
+-
+-Use I<spf-terms> as a default record if no SPF record is found.
+-
+-=item B<--local> I<spf-terms>
+-
+-Process I<spf-terms> as local policy before resorting to a default result
+-(the implicit or explicit C<all> mechanism at the end of the domain's SPF
+-record).  For example, this could be used for white-listing one's secondary
+-MXes: C<mx:mydomain.example.org>.
+-
+-=item B<--override> I<domain>B<=>I<spf-record>
+-
+-=item B<--fallback> I<domain>B<=>I<spf-record>
+-
+-Set overrides and fallbacks.  Each option can be specified multiple times.  For
+-example:
+-
+-    --override example.org='v=spf1 -all'
+-    --override '*.example.net'='v=spf1 a mx -all'
+-    --fallback example.com='v=spf1 -all'
+-
+-=back
+-
+-=head1 RESULT CODES
+-
+-=over 12
+-
+-=item B<pass>
+-
+-The specified IP address is an authorized SMTP sender for the identity.
+-
+-=item B<fail>
+-
+-The specified IP address is not an authorized SMTP sender for the identity.
+-
+-=item B<softfail>
+-
+-The specified IP address is not an authorized SMTP sender for the identity,
+-however the authority domain is still testing out its SPF policy.
+-
+-=item B<neutral>
+-
+-The identity's authority domain makes no assertion about the status of the IP
+-address.
+-
+-=item B<permerror>
+-
+-A permanent error occurred while evaluating the authority domain's policy
+-(e.g., a syntax error in the SPF record).  Manual intervention is required
+-from the authority domain.
+-
+-=item B<temperror>
+-
+-A temporary error occurred while evaluating the authority domain's policy
+-(e.g., a DNS error).  Try again later.
+-
+-=item B<none>
+-
+-There is no applicable SPF policy for the identity domain.
+-
+-=back
+-
+-=head1 EXIT CODES
+-
+-  Result    | Exit code
+- -----------+-----------
+-  pass      |     0
+-  fail      |     1
+-  softfail  |     2
+-  neutral   |     3
+-  permerror |     4
+-  temperror |     5
+-  none      |     6
+-
+-=head1 EXAMPLES
+-
+-    spfquery --scope mfrom --id user@example.com --ip 1.2.3.4
+-    spfquery --file test_data
+-    echo "127.0.0.1 user@example.com helohost.example.com" | spfquery -f -
+-
+-=head1 COMPATIBILITY
+-
+-B<spfquery> has undergone the following interface changes compared to earlier
+-versions:
+-
+-=over
+-
+-=item B<2.500>
+-
+-=over
+-
+-=item *
+-
+-A new preferred usage style for performing individual SPF checks has been
+-introduced.  The new style accepts a unified B<--identity> option and an
+-optional B<--scope> option that specifies the type (scope) of the identity.  In
+-contrast, the legacy usage style requires a separate usage form for every
+-supported scope.  See L</Preferred usage> and L</Legacy usage> for details.
+-
+-=item *
+-
+-The former C<unknown> and C<error> result codes have been renamed to C<permerror>
+-and C<temperror>, respectively, in order to comply with RFC 4408 terminology.
+-
+-=item *
+-
+-SPF checks with an empty identity are no longer supported.  In the case of an
+-empty C<MAIL FROM> SMTP transaction parameter, perform a check with the C<helo>
+-scope directly.
+-
+-=item *
+-
+-The B<--debug> and B<--(no-)sanitize> options are currently ignored by this
+-version of B<spfquery>.  They will again be supported in the future.
+-
+-=item *
+-
+-Several features that were supported by earlier versions of B<spfquery> are
+-considered black magic and thus are now disabled by default.  See L</Black
+-Magic Options>.
+-
+-=item *
+-
+-Several option names have been deprecated.  This is a list of them and their
+-preferred synonyms:
+-
+-  Deprecated options  | Preferred options
+- ---------------------+-----------------------------
+-  --sender, -s        | --mfrom
+-  --ipv4, -i          | --ip-address, --ip
+-  --name              | --hostname
+-  --max-lookup-count, | --max-dns-interactive-terms
+-    --max-lookup      |
+-  --rcpt-to, -r       | --authorize-mxes-for
+-  --trusted           | --tfwl
+-
+-=back
+-
+-=back
+-
+-=head1 SEE ALSO
+-
+-L<Mail::SPF>, L<spfd(8)>
+-
+-L<http://www.ietf.org/rfc/rfc4408.txt>
+-
+-=head1 AUTHORS
+-
+-This version of B<spfquery> is a complete rewrite by Julian Mehnle
+-<julian@mehnle.net>, based on an earlier version written by Meng Weng Wong
+-<mengwong+spf@pobox.com> and Wayne Schlitt <wayne@schlitt.net>.
+-
+-=cut
+-
+-our $VERSION = '2.501';
+-
+-use warnings;
+-use strict;
+-
+-use IO::File;
+-use Getopt::Long qw(:config gnu_compat no_ignore_case);
+-use Error ':try';
+-use Mail::SPF;
+-
+-use constant TRUE   => (0 == 0);
+-use constant FALSE  => not TRUE;
+-
+-use constant exit_codes_by_result_code => {
+-    pass        => 0,
+-    fail        => 1,
+-    softfail    => 2,
+-    neutral     => 3,
+-    permerror   => 4,
+-    temperror   => 5,
+-    none        => 6
+-};
+-
+-# Helper Functions
+-##############################################################################
+-
+-sub usage {
+-    STDERR->printf(<<'EOT');
+-Preferred Usage:
+-    spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
+-        --identity|--id <identity> --ip-address|--ip <ip-address>
+-        [--helo-identity|--helo-id <helo-identity>] [OPTIONS]
+-    spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
+-        --file|-f <filename>|- [OPTIONS]
+-
+-Legacy Usage:
+-    spfquery --helo <helo-identity> --ip-address|--ip <ip-address> [OPTIONS]
+-    spfquery --mfrom <mfrom-identity> --ip-address|--ip <ip-address>
+-        [--helo <helo-identity>] [OPTIONS]
+-    spfquery --pra <pra-identity> --ip-address|--ip <ip-address> [OPTIONS]
+-
+-Other Usage:
+-    spfquery --version|-V
+-
+-See `spfquery --help` for more information.
+-EOT
+-    return;
+-}
+-
+-sub help {
+-    print(<<'EOT');
+-Preferred Usage:
+-    spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
+-        --identity|--id <identity> --ip-address|--ip <ip-address>
+-        [--helo-identity|--helo-id <helo-identity>] [OPTIONS]
+-    spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
+-        --file|-f <filename>|- [OPTIONS]
+-
+-Legacy Usage:
+-    spfquery --helo <helo-identity> --ip-address|--ip <ip-address> [OPTIONS]
+-    spfquery --mfrom <mfrom-identity> --ip-address|--ip <ip-address>
+-        [--helo <helo-identity>] [OPTIONS]
+-    spfquery --pra <pra-identity> --ip-address|--ip <ip-address> [OPTIONS]
+-
+-Other Usage:
+-    spfquery --version|-V
+-
+-spfquery performs SPF checks based on the command-line arguments or data given
+-in a file or on standard input.
+-
+-Only the preferred and other usage forms are explained here.  See the
+-spfquery(1) man-page for an explanation of the legacy usage forms.
+-
+-The "--identity" form checks if the given <ip-address> is an authorized SMTP
+-sender for the given "helo" hostname, "mfrom" envelope sender e-mail address,
+-or "pra" (purported resonsible address) e-mail address, depending on the value
+-of the "--scope" option (which defaults to "mfrom" if omitted).
+-
+-The "--file" form reads "<ip-address> <identity> [<helo-identity>]" tuples from
+-the file with the specified <filename>, or from standard input if <filename> is
+-"-", and checks them against the specified scope ("mfrom" by default).
+-
+-The "--version" form prints version information of spfquery.
+-
+-Valid OPTIONS (and their defaults) are:
+-    --default-explanation <string>
+-                        Default explanation string to use (sensible default).
+-    --hostname <hostname>
+-                        The name of the system doing the SPF checking (local
+-                        system's configured hostname).
+-    --keep-comments     Print comments found when reading from a file.
+-    --no-sanitize       Do not clean up invalid characters in output.
+-    --debug             Output debugging information.
+-
+-Black-magic OPTIONS are:
+-    --max-dns-interactive-terms <n>
+-                        Maximum number of DNS-interactive mechanisms and
+-                        modifiers (10).
+-    --max-name-lookups-per-term <n>
+-                        Maximum number of DNS name look-ups per mechanism or
+-                        modifier (10).
+-    --authorize-mxes-for <email-address>|<domain>,...
+-                        A comma-separated list of e-mail addresses and domains
+-                        whose MXes will be considered inherently authorized.
+-    --tfwl              Check trusted-forwarder.org white-list.
+-    --guess <spf-terms> Default checks if no SPF record is found.
+-    --local <spf-terms> Local policy to process before default result.
+-    --override <domain>=<spf-record>
+-    --fallback <domain>=<spf-record>
+-                        Set override and fallback SPF records for domains.
+-
+-Examples:
+-    spfquery --scope mfrom --id user@example.com --ip 1.2.3.4
+-    spfquery --file test_data
+-    echo "127.0.0.1 user@example.com helohost.example.com" | spfquery -f -
+-EOT
+-    return;
+-}
+-
+-sub deprecated_option {
+-    my ($old_option, $new_option, $options) = @_;
+-    return FALSE if not exists($options->{$old_option});
+-    STDERR->print(
+-        "Warning: '$old_option' option is deprecated" .
+-        ($new_option ? "; use '$new_option' instead" : '') .
+-        ".\n"
+-    );
+-    $options->{$new_option} = delete($options->{$old_option});
+-    return TRUE;
+-}
+-
+-sub unsupported_option {
+-    my ($option_name, $options) = @_;
+-    return FALSE if not exists($options->{$option_name});
+-    STDERR->print("Error: '$option_name' option is no longer supported.\n");
+-    return TRUE;
+-}
+-
+-sub black_magic_option {
+-    my ($option_name, $options) = @_;
+-    return FALSE if not exists($options->{$option_name});
+-    STDERR->print("Error: '$option_name' option is black magic! Do not use it!\n");
+-    return TRUE;
+-}
+-
+-# Command-line Option Handling
+-##############################################################################
+-
+-my $options = {};
+-my $getopt_result = GetOptions(
+-    $options,
+-    
+-    'file|f=s',
+-    
+-    'versions|v=s',
+-    'scope=s',
+-    's=s',  # Special handling for ambiguous 's' option (formerly a synonym
+-            # for 'sender', now preferredly a synonym for 'scope').
+-    'identity|id=s',
+-    'ip-address|ip=s',
+-    'helo-identity|helo-id=s',
+-    
+-    # Legacy/shortcut options:
+-    'mfrom|mail-from|m=s',
+-    'helo|h=s',
+-    
+-    'default-explanation|def-exp=s',
+-    'hostname=s',
+-    
+-    'keep-comments!',
+-    'debug!',       # TODO Implement!
+-    'sanitize!',    # TODO Implement!
+-    
+-    # Black Magic options:
+-    'enable-black-magic!',
+-    'max-dns-interactive-terms=i',
+-    'max-name-lookups-per-term=i',
+-    'authorize-mxes-for=s',
+-                    # TODO implement!
+-    'tfwl!',        # TODO Implement!
+-    'guess=s',      # TODO Implement!
+-    'local=s',      # TODO Implement!
+-    'override=s%',  # TODO Implement!
+-    'fallback=s%',  # TODO Implement!
+-    
+-    # Meta actions:
+-    'version|V!',
+-    'help!',
+-    
+-    # Deprecated options:
+-    'sender=s',     # Now 'scope'/'identity' or 'mfrom'
+-    'ipv4=s',       # Now 'ip-address'
+-    'i=s',          # Now 'ip-address'
+-    'name=s',       # Now 'hostname'
+-    'max-lookup-count=i',
+-    'max-lookup=i', # Now 'max-dns-interactive-terms'
+-    'rcpt-to=s',    # Now 'authorize-mxes-for'
+-    'r=s',          # Now 'authorize-mxes-for'
+-    'trusted!'      # Now 'tfwl'
+-);
+-
+-if (not $getopt_result) {
+-    usage();
+-    exit(255);
+-}
+-
+-if ($options->{help}) {
+-    help();
+-    exit(0);
+-}
+-
+-if ($options->{version}) {
+-    print("spfquery version $VERSION (using Mail::SPF)\n");
+-    exit(0);
+-}
+-
+-deprecated_option('sender',           'mfrom',                     $options);
+-deprecated_option('ipv4',             'ip-address',                $options);
+-deprecated_option('i',                'ip-address',                $options);
+-deprecated_option('name',             'hostname',                  $options);
+-deprecated_option('max-lookup-count', 'max-dns-interactive-terms', $options);
+-deprecated_option('max-lookup',       'max-dns-interactive-terms', $options);
+-deprecated_option('rcpt-to',          'authorize-mxes-for',        $options);
+-deprecated_option('r',                'authorize-mxes-for',        $options);
+-deprecated_option('trusted',          'tfwl',                      $options);
+-
+-if ($options->{'enable-black-magic'}) {
+-    if (not defined(eval('require Mail::SPF::BlackMagic'))) {
+-        STDERR->print("Error: Cannot enable black magic. Unable to load Mail::SPF::BlackMagic.\n");
+-        exit(255);
+-    }
+-    # else: Black magic enabled!
+-}
+-elsif (
+-    black_magic_option('max-dns-interactive-terms', $options) or
+-    black_magic_option('max-name-lookups-per-term', $options) or
+-    black_magic_option('rcpt-to',                   $options) or
+-    black_magic_option('trusted',                   $options) or
+-    black_magic_option('guess',                     $options) or
+-    black_magic_option('local',                     $options) or
+-    black_magic_option('override',                  $options) or
+-    black_magic_option('fallback',                  $options)
+-) {
+-    exit(255);
+-}
+-
+-my @versions            = split(',', $options->{versions} || '');
+-my $scope               = $options->{scope};
+-my $identity            = $options->{identity};
+-my $ip_address          = $options->{'ip-address'};
+-my $helo_identity       = $options->{'helo-identity'};
+-
+-# Heuristic for distinguishing between 's(cope)' and 's(ender)':
+-if (defined(my $s = $options->{s})) {
+-    if (
+-        not defined($scope) and  # No explicit 'scope' option has been specified, and
+-        $s !~ /[@.]/             # 's' option contains neither an '@' nor a dot,
+-                                 # so it cannot be an e-mail address or a domain.
+-    ) {
+-        # Thus it must be meant as the 'scope' option:
+-        $scope = $s;
+-    }
+-    else {
+-        # Else, it must be meant as the deprecated 'sender' option:
+-        $options->{mfrom} = $s;
+-    }
+-}
+-
+-# Heuristic for when explicit 'scope'/'s(cope)' option is absent:
+-if (not defined($scope)) {
+-    if (defined($identity) or defined($options->{file})) {
+-        # Identity has been specified, or input will be read from file:
+-        # apply the 'scope' option default:
+-        $scope    = 'mfrom';
+-    }
+-    elsif (defined($options->{helo})) {
+-        $scope    = 'helo';
+-        $identity = $options->{helo};
+-    }
+-    elsif (defined($options->{mfrom})) {
+-        $scope    = 'mfrom';
+-        $identity = $options->{mfrom};
+-        $helo_identity ||= $options->{helo};
+-    }
+-    elsif (defined($options->{pra})) {
+-        $scope    = 'pra';
+-        $identity = $options->{pra};
+-    }
+-}
+-
+-my $default_explanation = $options->{'default-explanation'};
+-my $hostname            = $options->{hostname};
+-
+-if (
+-    not defined($scope) or
+-    not (defined($identity) xor defined($options->{file}))
+-) {
+-    usage();
+-    exit(255);
+-}
+-
+-if (defined($identity) and $identity eq '') {
+-    STDERR->print("Error: Empty identities are not supported. See spfquery(1).\n");
+-    exit(255);
+-}
+-
+-# Process the SPF Request(s)
+-##############################################################################
+-
+-try {
+-    my $spf_server = Mail::SPF::Server->new(
+-        default_authority_explanation
+-                        => $default_explanation,
+-        hostname        => $hostname,
+-    #    debug           => $options->{debug},
+-    #    sanitize        => $options->{sanitize},
+-
+-        # Black Magic:
+-        (
+-            exists($options->{'max-dns-interactive-terms'}) ?
+-                (max_dns_interactive_terms  => $options->{'max-dns-interactive-terms'} || undef)
+-            :   ()
+-        ),
+-        (
+-            exists($options->{'max-name-lookups-per-term'}) ?
+-                (max_name_lookups_per_term  => $options->{'max-name-lookups-per-term'} || undef)
+-            :   ()
+-        )
+-    #    rcpt_to         => $options->{'rcpt-to'},
+-    #    trusted         => $options->{trusted},
+-    #    guess           => $options->{guess},
+-    #    local           => $options->{local},
+-    #    override        => $options->{override},
+-    #    fallback        => $options->{fallback},
+-    );
+-
+-    my $exit_code;
+-
+-    if (not defined($options->{file})) {
+-        # Single request:
+-        my $result_code = do_process(
+-            $spf_server,
+-            versions        => @versions ? [@versions] : undef,
+-            scope           => $scope,
+-            identity        => $identity,
+-            ip_address      => $ip_address,
+-            helo_identity   => $helo_identity
+-        );
+-        $exit_code = exit_codes_by_result_code->{$result_code};
+-    }
+-    else {
+-        # File request:
+-        my $file = $options->{file} eq '-' ? \*STDIN : IO::File->new($options->{file})
+-            or die("Could not open: $options->{file}\n");
+-        while (<$file>) {
+-            chomp;
+-            s/^\s*//;
+-            next if /^$/;
+-            if (/^#/) {
+-                print("$_\n") if $options->{'keep-comments'};
+-                next;
+-            }
+-            ($ip_address, $identity, $helo_identity) = split;
+-            my $result_code = do_process(
+-                $spf_server,
+-                versions        => @versions ? [@versions] : undef,
+-                scope           => $scope,
+-                identity        => $identity,
+-                ip_address      => $ip_address,
+-                helo_identity   => $helo_identity
+-            );
+-            $exit_code ||= exit_codes_by_result_code->{$result_code};
+-        }
+-    }
+-
+-    exit($exit_code);
+-}
+-catch Mail::SPF::Exception with {
+-    my ($e) = @_;
+-    STDERR->printf("Error: %s.\n", $e->text);
+-    exit(255);
+-};
+-
+-
+-# Helper Function
+-##############################################################################
+-
+-sub do_process {
+-    my ($spf_server, %request_options) = @_;
+-    my $request = Mail::SPF::Request->new(%request_options);
+-    my $result  = $spf_server->process($request);
+-    printf(
+-        "%s\n%s\n%s\n%s\n",
+-        $result->code,
+-        (
+-            $result->can('authority_explanation') ?
+-                $result->authority_explanation
+-            :   $result->local_explanation
+-        ),
+-        $result->local_explanation,
+-        $result->received_spf_header
+-    );
+-    return $result->code;
+-}
+diff -Naur orig/bin/spfquery.pl bin/spfquery.pl
+--- orig/bin/spfquery.pl	1970-01-01 01:00:00.000000000 +0100
++++ bin/spfquery.pl	2009-10-31 23:16:14.000000000 +0100
+@@ -0,0 +1,731 @@
++#!/usr/bin/perl
++
++# 
++# spfquery: Command-line tool for performing SPF queries
++#
++# (C) 2005-2008 Julian Mehnle <julian@mehnle.net>
++#     2004      Wayne Schlitt <wayne@schlitt.net>
++# $Id: spfquery 138 2006-01-22 18:00:34Z julian $
++#
++##############################################################################
++
++=head1 NAME
++
++spfquery - (Mail::SPF) - Checks if a given set of e-mail parameters matches a
++domain's SPF policy
++
++=head1 VERSION
++
++2.501
++
++=head1 SYNOPSIS
++
++=over
++
++=item B<Preferred usage:>
++
++B<spfquery> [B<--versions>|B<-v> B<1>|B<2>|B<1,2>] [B<--scope>|B<-s> B<helo>|B<mfrom>|B<pra>]
++B<--identity>|B<--id> I<identity> B<--ip-address>|B<--ip> I<ip-address>
++[B<--helo-identity>|B<--helo-id> I<helo-identity>] [I<OPTIONS>]
++
++B<spfquery> [B<--versions>|B<-v> B<1>|B<2>|B<1,2>] [B<--scope>|B<-s> B<helo>|B<mfrom>|B<pra>]
++B<--file>|B<-f> I<filename>|B<-> [I<OPTIONS>]
++
++=item B<Legacy usage:>
++
++B<spfquery> B<--helo> I<helo-identity> B<--ip-address>|B<--ip> I<ip-address> [I<OPTIONS>]
++
++B<spfquery> B<--mfrom> I<mfrom-identity> B<--ip-address>|B<--ip> I<ip-address>
++[B<--helo> I<helo-identity>] [I<OPTIONS>]
++
++B<spfquery> B<--pra> I<pra-identity> B<--ip-address>|B<--ip> I<ip-address> [I<OPTIONS>]
++
++=item B<Other usage:>
++
++B<spfquery> B<--version>|B<-V>
++
++B<spfquery> B<--help>
++
++=back
++
++=head1 DESCRIPTION
++
++B<spfquery> checks if a given set of e-mail parameters (e.g., the SMTP sender's
++IP address) matches the responsible domain's Sender Policy Framework (SPF)
++policy.  For more information on SPF see L<http://www.openspf.org>.
++
++=head2 Preferred Usage
++
++The following usage forms are preferred over the L<legacy forms|/Legacy usage>
++used by older B<spfquery> versions:
++
++The B<--identity> form checks if the given I<ip-address> is an authorized SMTP
++sender for the given C<helo> hostname, C<mfrom> envelope sender e-mail address,
++or C<pra> (so-called purported resonsible address) e-mail address, depending
++on the value of the B<--scope> option (which defaults to B<mfrom> if omitted).
++
++The B<--file> form reads "I<ip-address> I<identity> [I<helo-identity>]" tuples
++from the file with the specified I<filename>, or from standard input if
++I<filename> is B<->, and checks them against the specified scope (B<mfrom> by
++default).
++
++Both forms support an optional B<--versions> option, which specifies a
++comma-separated list of the SPF version numbers of SPF records that may be
++used.  B<1> means that C<v=spf1> records should be used.  B<2> means that
++C<spf2.0> records should be used.  Defaults to B<1,2>, i.e., uses any SPF
++records that are available.  Records of a higher version are preferred.
++
++=head2 Legacy Usage
++
++B<spfquery> versions before 2.500 featured the following usage forms, which are
++discouraged but still supported for L<backwards compatibility|/COMPATIBILITY>:
++
++The B<--helo> form checks if the given I<ip-address> is an authorized SMTP
++sender for the C<HELO> hostname given as the I<identity> (so-called C<HELO>
++check).
++
++The B<--mfrom> form checks if the given I<ip-address> is an authorized SMTP
++sender for the envelope sender email-address (or domain) given as the
++I<identity> (so-called C<MAIL FROM> check).  If a domain is given instead of an
++e-mail address, C<postmaster> will be substituted for the localpart.
++
++The B<--pra> form checks if the given I<ip-address> is an authorized SMTP
++sender for the PRA (Purported Responsible Address) e-mail address given as the
++identity.
++
++=head2 Other Usage
++
++The B<--version> form prints version information of spfquery.  The B<--help>
++form prints usage information for spfquery.
++
++=head1 OPTIONS
++
++=head2 Standard Options
++
++The preferred and legacy forms optionally take any of the following
++I<OPTIONS>:
++
++=over
++
++=item B<--default-explanation> I<string>
++
++=item B<--def-exp> I<string>
++
++Use the specified I<string> as the default explanation if the authority domain
++does not specify an explanation string of its own.
++
++=item B<--hostname> I<hostname>
++
++Use I<hostname> as the host name of the local system instead of auto-detecting
++it.
++
++=item B<--keep-comments>
++
++=item B<--no-keep-comments>
++
++Do (not) print any comments found when reading from a file or from standard
++input.
++
++=item B<--sanitize> (currently ignored)
++
++=item B<--no-sanitize> (currently ignored)
++
++Do (not) sanitize the output by condensing consecutive white-space into a
++single space and replacing non-printable characters with question marks.
++Enabled by default.
++
++=item B<--debug> (currently ignored)
++
++Print out debug information.
++
++=back
++
++=head2 Black Magic Options
++
++Several options that were supported by earlier versions of B<spfquery> are
++considered black magic (i.e. potentially dangerous for the innocent user) and
++are thus disabled by default.  If the L<B<Mail::SPF::BlackMagic>> Perl module
++is installed, they may be enabled by specifying B<--enable-black-magic>.
++
++=over
++
++=item B<--max-dns-interactive-terms> I<n>
++
++Evaluate a maximum of I<n> DNS-interactive mechanisms and modifiers per SPF
++check.  Defaults to B<10>.  Do I<not> override the default unless you know what
++you are doing!
++
++=item B<--max-name-lookups-per-term> I<n>
++
++Perform a maximum of I<n> DNS name look-ups per mechanism or modifier.
++Defaults to B<10>.  Do I<not> override the default unless you know what you are
++doing!
++
++=item B<--authorize-mxes-for> I<email-address>|I<domain>B<,>...
++
++Consider all the MXes of the comma-separated list of I<email-address>es and
++I<domain>s as inherently authorized.
++
++=item B<--tfwl>
++
++Perform C<trusted-forwarder.org> accreditation checking.
++
++=item B<--guess> I<spf-terms>
++
++Use I<spf-terms> as a default record if no SPF record is found.
++
++=item B<--local> I<spf-terms>
++
++Process I<spf-terms> as local policy before resorting to a default result
++(the implicit or explicit C<all> mechanism at the end of the domain's SPF
++record).  For example, this could be used for white-listing one's secondary
++MXes: C<mx:mydomain.example.org>.
++
++=item B<--override> I<domain>B<=>I<spf-record>
++
++=item B<--fallback> I<domain>B<=>I<spf-record>
++
++Set overrides and fallbacks.  Each option can be specified multiple times.  For
++example:
++
++    --override example.org='v=spf1 -all'
++    --override '*.example.net'='v=spf1 a mx -all'
++    --fallback example.com='v=spf1 -all'
++
++=back
++
++=head1 RESULT CODES
++
++=over 12
++
++=item B<pass>
++
++The specified IP address is an authorized SMTP sender for the identity.
++
++=item B<fail>
++
++The specified IP address is not an authorized SMTP sender for the identity.
++
++=item B<softfail>
++
++The specified IP address is not an authorized SMTP sender for the identity,
++however the authority domain is still testing out its SPF policy.
++
++=item B<neutral>
++
++The identity's authority domain makes no assertion about the status of the IP
++address.
++
++=item B<permerror>
++
++A permanent error occurred while evaluating the authority domain's policy
++(e.g., a syntax error in the SPF record).  Manual intervention is required
++from the authority domain.
++
++=item B<temperror>
++
++A temporary error occurred while evaluating the authority domain's policy
++(e.g., a DNS error).  Try again later.
++
++=item B<none>
++
++There is no applicable SPF policy for the identity domain.
++
++=back
++
++=head1 EXIT CODES
++
++  Result    | Exit code
++ -----------+-----------
++  pass      |     0
++  fail      |     1
++  softfail  |     2
++  neutral   |     3
++  permerror |     4
++  temperror |     5
++  none      |     6
++
++=head1 EXAMPLES
++
++    spfquery --scope mfrom --id user@example.com --ip 1.2.3.4
++    spfquery --file test_data
++    echo "127.0.0.1 user@example.com helohost.example.com" | spfquery -f -
++
++=head1 COMPATIBILITY
++
++B<spfquery> has undergone the following interface changes compared to earlier
++versions:
++
++=over
++
++=item B<2.500>
++
++=over
++
++=item *
++
++A new preferred usage style for performing individual SPF checks has been
++introduced.  The new style accepts a unified B<--identity> option and an
++optional B<--scope> option that specifies the type (scope) of the identity.  In
++contrast, the legacy usage style requires a separate usage form for every
++supported scope.  See L</Preferred usage> and L</Legacy usage> for details.
++
++=item *
++
++The former C<unknown> and C<error> result codes have been renamed to C<permerror>
++and C<temperror>, respectively, in order to comply with RFC 4408 terminology.
++
++=item *
++
++SPF checks with an empty identity are no longer supported.  In the case of an
++empty C<MAIL FROM> SMTP transaction parameter, perform a check with the C<helo>
++scope directly.
++
++=item *
++
++The B<--debug> and B<--(no-)sanitize> options are currently ignored by this
++version of B<spfquery>.  They will again be supported in the future.
++
++=item *
++
++Several features that were supported by earlier versions of B<spfquery> are
++considered black magic and thus are now disabled by default.  See L</Black
++Magic Options>.
++
++=item *
++
++Several option names have been deprecated.  This is a list of them and their
++preferred synonyms:
++
++  Deprecated options  | Preferred options
++ ---------------------+-----------------------------
++  --sender, -s        | --mfrom
++  --ipv4, -i          | --ip-address, --ip
++  --name              | --hostname
++  --max-lookup-count, | --max-dns-interactive-terms
++    --max-lookup      |
++  --rcpt-to, -r       | --authorize-mxes-for
++  --trusted           | --tfwl
++
++=back
++
++=back
++
++=head1 SEE ALSO
++
++L<Mail::SPF>, L<spfd(8)>
++
++L<http://www.ietf.org/rfc/rfc4408.txt>
++
++=head1 AUTHORS
++
++This version of B<spfquery> is a complete rewrite by Julian Mehnle
++<julian@mehnle.net>, based on an earlier version written by Meng Weng Wong
++<mengwong+spf@pobox.com> and Wayne Schlitt <wayne@schlitt.net>.
++
++=cut
++
++our $VERSION = '2.501';
++
++use warnings;
++use strict;
++
++use IO::File;
++use Getopt::Long qw(:config gnu_compat no_ignore_case);
++use Error ':try';
++use Mail::SPF;
++
++use constant TRUE   => (0 == 0);
++use constant FALSE  => not TRUE;
++
++use constant exit_codes_by_result_code => {
++    pass        => 0,
++    fail        => 1,
++    softfail    => 2,
++    neutral     => 3,
++    permerror   => 4,
++    temperror   => 5,
++    none        => 6
++};
++
++# Helper Functions
++##############################################################################
++
++sub usage {
++    STDERR->printf(<<'EOT');
++Preferred Usage:
++    spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
++        --identity|--id <identity> --ip-address|--ip <ip-address>
++        [--helo-identity|--helo-id <helo-identity>] [OPTIONS]
++    spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
++        --file|-f <filename>|- [OPTIONS]
++
++Legacy Usage:
++    spfquery --helo <helo-identity> --ip-address|--ip <ip-address> [OPTIONS]
++    spfquery --mfrom <mfrom-identity> --ip-address|--ip <ip-address>
++        [--helo <helo-identity>] [OPTIONS]
++    spfquery --pra <pra-identity> --ip-address|--ip <ip-address> [OPTIONS]
++
++Other Usage:
++    spfquery --version|-V
++
++See `spfquery --help` for more information.
++EOT
++    return;
++}
++
++sub help {
++    print(<<'EOT');
++Preferred Usage:
++    spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
++        --identity|--id <identity> --ip-address|--ip <ip-address>
++        [--helo-identity|--helo-id <helo-identity>] [OPTIONS]
++    spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
++        --file|-f <filename>|- [OPTIONS]
++
++Legacy Usage:
++    spfquery --helo <helo-identity> --ip-address|--ip <ip-address> [OPTIONS]
++    spfquery --mfrom <mfrom-identity> --ip-address|--ip <ip-address>
++        [--helo <helo-identity>] [OPTIONS]
++    spfquery --pra <pra-identity> --ip-address|--ip <ip-address> [OPTIONS]
++
++Other Usage:
++    spfquery --version|-V
++
++spfquery performs SPF checks based on the command-line arguments or data given
++in a file or on standard input.
++
++Only the preferred and other usage forms are explained here.  See the
++spfquery(1) man-page for an explanation of the legacy usage forms.
++
++The "--identity" form checks if the given <ip-address> is an authorized SMTP
++sender for the given "helo" hostname, "mfrom" envelope sender e-mail address,
++or "pra" (purported resonsible address) e-mail address, depending on the value
++of the "--scope" option (which defaults to "mfrom" if omitted).
++
++The "--file" form reads "<ip-address> <identity> [<helo-identity>]" tuples from
++the file with the specified <filename>, or from standard input if <filename> is
++"-", and checks them against the specified scope ("mfrom" by default).
++
++The "--version" form prints version information of spfquery.
++
++Valid OPTIONS (and their defaults) are:
++    --default-explanation <string>
++                        Default explanation string to use (sensible default).
++    --hostname <hostname>
++                        The name of the system doing the SPF checking (local
++                        system's configured hostname).
++    --keep-comments     Print comments found when reading from a file.
++    --no-sanitize       Do not clean up invalid characters in output.
++    --debug             Output debugging information.
++
++Black-magic OPTIONS are:
++    --max-dns-interactive-terms <n>
++                        Maximum number of DNS-interactive mechanisms and
++                        modifiers (10).
++    --max-name-lookups-per-term <n>
++                        Maximum number of DNS name look-ups per mechanism or
++                        modifier (10).
++    --authorize-mxes-for <email-address>|<domain>,...
++                        A comma-separated list of e-mail addresses and domains
++                        whose MXes will be considered inherently authorized.
++    --tfwl              Check trusted-forwarder.org white-list.
++    --guess <spf-terms> Default checks if no SPF record is found.
++    --local <spf-terms> Local policy to process before default result.
++    --override <domain>=<spf-record>
++    --fallback <domain>=<spf-record>
++                        Set override and fallback SPF records for domains.
++
++Examples:
++    spfquery --scope mfrom --id user@example.com --ip 1.2.3.4
++    spfquery --file test_data
++    echo "127.0.0.1 user@example.com helohost.example.com" | spfquery -f -
++EOT
++    return;
++}
++
++sub deprecated_option {
++    my ($old_option, $new_option, $options) = @_;
++    return FALSE if not exists($options->{$old_option});
++    STDERR->print(
++        "Warning: '$old_option' option is deprecated" .
++        ($new_option ? "; use '$new_option' instead" : '') .
++        ".\n"
++    );
++    $options->{$new_option} = delete($options->{$old_option});
++    return TRUE;
++}
++
++sub unsupported_option {
++    my ($option_name, $options) = @_;
++    return FALSE if not exists($options->{$option_name});
++    STDERR->print("Error: '$option_name' option is no longer supported.\n");
++    return TRUE;
++}
++
++sub black_magic_option {
++    my ($option_name, $options) = @_;
++    return FALSE if not exists($options->{$option_name});
++    STDERR->print("Error: '$option_name' option is black magic! Do not use it!\n");
++    return TRUE;
++}
++
++# Command-line Option Handling
++##############################################################################
++
++my $options = {};
++my $getopt_result = GetOptions(
++    $options,
++    
++    'file|f=s',
++    
++    'versions|v=s',
++    'scope=s',
++    's=s',  # Special handling for ambiguous 's' option (formerly a synonym
++            # for 'sender', now preferredly a synonym for 'scope').
++    'identity|id=s',
++    'ip-address|ip=s',
++    'helo-identity|helo-id=s',
++    
++    # Legacy/shortcut options:
++    'mfrom|mail-from|m=s',
++    'helo|h=s',
++    
++    'default-explanation|def-exp=s',
++    'hostname=s',
++    
++    'keep-comments!',
++    'debug!',       # TODO Implement!
++    'sanitize!',    # TODO Implement!
++    
++    # Black Magic options:
++    'enable-black-magic!',
++    'max-dns-interactive-terms=i',
++    'max-name-lookups-per-term=i',
++    'authorize-mxes-for=s',
++                    # TODO implement!
++    'tfwl!',        # TODO Implement!
++    'guess=s',      # TODO Implement!
++    'local=s',      # TODO Implement!
++    'override=s%',  # TODO Implement!
++    'fallback=s%',  # TODO Implement!
++    
++    # Meta actions:
++    'version|V!',
++    'help!',
++    
++    # Deprecated options:
++    'sender=s',     # Now 'scope'/'identity' or 'mfrom'
++    'ipv4=s',       # Now 'ip-address'
++    'i=s',          # Now 'ip-address'
++    'name=s',       # Now 'hostname'
++    'max-lookup-count=i',
++    'max-lookup=i', # Now 'max-dns-interactive-terms'
++    'rcpt-to=s',    # Now 'authorize-mxes-for'
++    'r=s',          # Now 'authorize-mxes-for'
++    'trusted!'      # Now 'tfwl'
++);
++
++if (not $getopt_result) {
++    usage();
++    exit(255);
++}
++
++if ($options->{help}) {
++    help();
++    exit(0);
++}
++
++if ($options->{version}) {
++    print("spfquery version $VERSION (using Mail::SPF)\n");
++    exit(0);
++}
++
++deprecated_option('sender',           'mfrom',                     $options);
++deprecated_option('ipv4',             'ip-address',                $options);
++deprecated_option('i',                'ip-address',                $options);
++deprecated_option('name',             'hostname',                  $options);
++deprecated_option('max-lookup-count', 'max-dns-interactive-terms', $options);
++deprecated_option('max-lookup',       'max-dns-interactive-terms', $options);
++deprecated_option('rcpt-to',          'authorize-mxes-for',        $options);
++deprecated_option('r',                'authorize-mxes-for',        $options);
++deprecated_option('trusted',          'tfwl',                      $options);
++
++if ($options->{'enable-black-magic'}) {
++    if (not defined(eval('require Mail::SPF::BlackMagic'))) {
++        STDERR->print("Error: Cannot enable black magic. Unable to load Mail::SPF::BlackMagic.\n");
++        exit(255);
++    }
++    # else: Black magic enabled!
++}
++elsif (
++    black_magic_option('max-dns-interactive-terms', $options) or
++    black_magic_option('max-name-lookups-per-term', $options) or
++    black_magic_option('rcpt-to',                   $options) or
++    black_magic_option('trusted',                   $options) or
++    black_magic_option('guess',                     $options) or
++    black_magic_option('local',                     $options) or
++    black_magic_option('override',                  $options) or
++    black_magic_option('fallback',                  $options)
++) {
++    exit(255);
++}
++
++my @versions            = split(',', $options->{versions} || '');
++my $scope               = $options->{scope};
++my $identity            = $options->{identity};
++my $ip_address          = $options->{'ip-address'};
++my $helo_identity       = $options->{'helo-identity'};
++
++# Heuristic for distinguishing between 's(cope)' and 's(ender)':
++if (defined(my $s = $options->{s})) {
++    if (
++        not defined($scope) and  # No explicit 'scope' option has been specified, and
++        $s !~ /[@.]/             # 's' option contains neither an '@' nor a dot,
++                                 # so it cannot be an e-mail address or a domain.
++    ) {
++        # Thus it must be meant as the 'scope' option:
++        $scope = $s;
++    }
++    else {
++        # Else, it must be meant as the deprecated 'sender' option:
++        $options->{mfrom} = $s;
++    }
++}
++
++# Heuristic for when explicit 'scope'/'s(cope)' option is absent:
++if (not defined($scope)) {
++    if (defined($identity) or defined($options->{file})) {
++        # Identity has been specified, or input will be read from file:
++        # apply the 'scope' option default:
++        $scope    = 'mfrom';
++    }
++    elsif (defined($options->{helo})) {
++        $scope    = 'helo';
++        $identity = $options->{helo};
++    }
++    elsif (defined($options->{mfrom})) {
++        $scope    = 'mfrom';
++        $identity = $options->{mfrom};
++        $helo_identity ||= $options->{helo};
++    }
++    elsif (defined($options->{pra})) {
++        $scope    = 'pra';
++        $identity = $options->{pra};
++    }
++}
++
++my $default_explanation = $options->{'default-explanation'};
++my $hostname            = $options->{hostname};
++
++if (
++    not defined($scope) or
++    not (defined($identity) xor defined($options->{file}))
++) {
++    usage();
++    exit(255);
++}
++
++if (defined($identity) and $identity eq '') {
++    STDERR->print("Error: Empty identities are not supported. See spfquery(1).\n");
++    exit(255);
++}
++
++# Process the SPF Request(s)
++##############################################################################
++
++try {
++    my $spf_server = Mail::SPF::Server->new(
++        default_authority_explanation
++                        => $default_explanation,
++        hostname        => $hostname,
++    #    debug           => $options->{debug},
++    #    sanitize        => $options->{sanitize},
++
++        # Black Magic:
++        (
++            exists($options->{'max-dns-interactive-terms'}) ?
++                (max_dns_interactive_terms  => $options->{'max-dns-interactive-terms'} || undef)
++            :   ()
++        ),
++        (
++            exists($options->{'max-name-lookups-per-term'}) ?
++                (max_name_lookups_per_term  => $options->{'max-name-lookups-per-term'} || undef)
++            :   ()
++        )
++    #    rcpt_to         => $options->{'rcpt-to'},
++    #    trusted         => $options->{trusted},
++    #    guess           => $options->{guess},
++    #    local           => $options->{local},
++    #    override        => $options->{override},
++    #    fallback        => $options->{fallback},
++    );
++
++    my $exit_code;
++
++    if (not defined($options->{file})) {
++        # Single request:
++        my $result_code = do_process(
++            $spf_server,
++            versions        => @versions ? [@versions] : undef,
++            scope           => $scope,
++            identity        => $identity,
++            ip_address      => $ip_address,
++            helo_identity   => $helo_identity
++        );
++        $exit_code = exit_codes_by_result_code->{$result_code};
++    }
++    else {
++        # File request:
++        my $file = $options->{file} eq '-' ? \*STDIN : IO::File->new($options->{file})
++            or die("Could not open: $options->{file}\n");
++        while (<$file>) {
++            chomp;
++            s/^\s*//;
++            next if /^$/;
++            if (/^#/) {
++                print("$_\n") if $options->{'keep-comments'};
++                next;
++            }
++            ($ip_address, $identity, $helo_identity) = split;
++            my $result_code = do_process(
++                $spf_server,
++                versions        => @versions ? [@versions] : undef,
++                scope           => $scope,
++                identity        => $identity,
++                ip_address      => $ip_address,
++                helo_identity   => $helo_identity
++            );
++            $exit_code ||= exit_codes_by_result_code->{$result_code};
++        }
++    }
++
++    exit($exit_code);
++}
++catch Mail::SPF::Exception with {
++    my ($e) = @_;
++    STDERR->printf("Error: %s.\n", $e->text);
++    exit(255);
++};
++
++
++# Helper Function
++##############################################################################
++
++sub do_process {
++    my ($spf_server, %request_options) = @_;
++    my $request = Mail::SPF::Request->new(%request_options);
++    my $result  = $spf_server->process($request);
++    printf(
++        "%s\n%s\n%s\n%s\n",
++        $result->code,
++        (
++            $result->can('authority_explanation') ?
++                $result->authority_explanation
++            :   $result->local_explanation
++        ),
++        $result->local_explanation,
++        $result->received_spf_header
++    );
++    return $result->code;
++}
diff -Naur p5-Mail-SPF.dist/pkg-plist p5-Mail-SPF/pkg-plist
- --- p5-Mail-SPF.dist/pkg-plist	2008-02-22 22:40:33.000000000 +0100
+++ p5-Mail-SPF/pkg-plist	2011-05-24 19:42:51.000000000 +0200
@@ -1,4 +1,4 @@
- -bin/spfquery
+%%SPFQUERY%%bin/spfquery%%SPFQUERY_SUFFIX%%
 sbin/spfd
 %%SITE_PERL%%/Mail/SPF.pm
 %%SITE_PERL%%/Mail/SPF/MacroString.pm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk3b8gsACgkQktDgRrkFPpZRtwCfXPx95UJnmozGgWS5omw12bQM
JfYAoI8UiHNF4+8Jw52Ms4sv+JRfKYpq
=4nu0
-----END PGP SIGNATURE-----
Comment 6 Michael Scheidell 2011-12-27 14:22:50 UTC
Your patch got corrupted, could you try to upload it again, and someone wil=
l look at it?


--=20
Michael Scheidell, CTO
o: 561-999-5000
d: 561-948-2259
> | SECNAP Network Security Corporation=20
* Best Mobile Solutions Product of 2011
* Best Intrusion Prevention Product
* Hot Company Finalist 2011
* Best Email Security Product
* Certified SNORT Integrator

______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.spammertrap.com/
______________________________________________________________________
Comment 7 Michael Scheidell freebsd_committer 2012-02-20 12:34:33 UTC
State Changed
From-To: feedback->open

Feedback Timeout
Comment 8 Stefan Walter freebsd_committer 2013-04-29 13:08:00 UTC
Hello Mickael, hello Koen,

unfortunately, there hasn't been any activity with this problem report for
net/p5-Mail-SPF (see [1]) for quite a while, and both net/p5-Mail-SPF and
mail/libspf2 have been modified to reflect this conflict in the meantime
and prevent concurrent installation of these two ports.

How should we resolve this situation? Adjust Koen's patch to modify the
current version of net/p5-Mail-SPF, or leave the ports as they are now and
close this PR?

Best regards,
Stefan

[1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157107
Comment 9 Stefan Walter freebsd_committer 2013-04-29 13:08:16 UTC
State Changed
From-To: open->feedback

Awaiting feedback from submitter and maintainer. 


Comment 10 Stefan Walter freebsd_committer 2013-04-29 13:08:16 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stefan

Track this while waiting for feedback.
Comment 11 Stefan Walter freebsd_committer 2013-05-05 11:01:35 UTC
State Changed
From-To: feedback->closed

No reply from either the submitter or the maintainer, and the ports reflect the 
conflict now.
Comment 12 jake.guffey 2013-05-06 16:13:34 UTC
Hi, .*:

Marking the packages as conflicting causes a problem in the scenario where an anti-spam checking toolchain is involved using both libspf and p5-Mail-SPF. I would be glad to look at modifying this patch and test it to get this issue resolved.

Thanks,
Jake Guffey
Network Security Engineer

eProtex
Network medical device security

5451 Lakeview Parkway S Drive
Indianapolis, Indiana 46268, USA
Mobile: 317-220-7100
jake.guffey@eprotex.com
www.eprotex.com
Comment 13 Stefan Walter freebsd_committer 2013-05-06 18:02:57 UTC
State Changed
From-To: closed->open

Re-open, as someone is looking at the issue.
Comment 14 jake.guffey 2013-05-06 18:39:58 UTC
This version of the patch should work without issue. It tested fine on my box using

patch -p <p5-Mail-SPF.patch from within /usr/ports/mail/p5-Mail-SPF
Comment 15 Stefan Walter freebsd_committer 2013-05-10 11:00:48 UTC
Hello Koen,

do you approve the changes in the patch (see [1]) that Jake sent? I would
commit it, then...

Best regards,
Stefan

[1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157107
Comment 16 Stefan Walter freebsd_committer 2013-05-10 11:00:57 UTC
State Changed
From-To: open->feedback

Patch received - awaiting maintainer's feedback.
Comment 17 gmc 2013-05-12 15:47:16 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Stefan,

Yeah sure, commit it. I haven't got the time to check actually, and in fact
had forgotten that I am listed as maintainer for this port completely. Given
my current activities, I no longer can fullfill the duty of maintaining the
port unfortunately.

Thanks,

Koen

On Fri, May 10, 2013 at 12:00:48PM +0200, Stefan Walter wrote:
> Hello Koen,
> 
> do you approve the changes in the patch (see [1]) that Jake sent? I would
> commit it, then...
> 
> Best regards,
> Stefan
> 
> [1]: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157107
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlGPq3QACgkQktDgRrkFPpZOtACdHSpRuOEsJIjBvziI/+OTiT+J
6HAAni5KuOIUkJw0P40XHJ5gZh508D5N
=m9mN
-----END PGP SIGNATURE-----
Comment 18 Stefan Walter freebsd_committer 2013-05-12 16:30:41 UTC
Hi Koen,

Koen Martens, 12.05.13, 16:47h CEST:

> Hi Stefan,
> 
> Yeah sure, commit it. I haven't got the time to check actually, and in fact
> had forgotten that I am listed as maintainer for this port completely. Given
> my current activities, I no longer can fullfill the duty of maintaining the
> port unfortunately.

thanks for the feedback! Does that mean you want to be give up
maintainership of this port, then?

Regards,
Stefan
Comment 19 Stefan Walter freebsd_committer 2013-05-12 16:35:53 UTC
Hi Jake,

Jake Guffey, 06.05.13, 19:50h CEST:

>  This version of the patch should work without issue. It tested fine on =
>  my box using
>  
>  patch -p <p5-Mail-SPF.patch from within /usr/ports/mail/p5-Mail-SPF

thank you for the patch. I have a small issue with it: It renames the
'spfquery' script by applying a patch which, as a result, contains the
whole script twice. I think it would be better to do that in the port's
Makefile. Could you modify your patch in that way?

Regards,
Stefan
Comment 20 jake.guffey 2013-05-13 22:20:39 UTC
Hi, Stefan:

I would love to fix the patch myself but unfortunately I am just not familiar enough with the perl's automake-like modules to be of any use. I did look into it today, and it seems like it would be a simply enough problem to fix, but I wasn't able to do it. Is there some functionality where I can execute a command via system() after the build process or similar?

Thanks,
Jake Guffey
Network Security Engineer

eProtex
Network medical device security

5451 Lakeview Parkway S Drive
Indianapolis, Indiana 46268, USA
Mobile: 317-220-7100
jake.guffey@eprotex.com
www.eprotex.com

On May 12, 2013, at 11:35 AM, Stefan Walter <stefan@FreeBSD.org> wrote:

> Hi Jake,
> 
> Jake Guffey, 06.05.13, 19:50h CEST:
> 
>> This version of the patch should work without issue. It tested fine on =
>> my box using
>> 
>> patch -p <p5-Mail-SPF.patch from within /usr/ports/mail/p5-Mail-SPF
> 
> thank you for the patch. I have a small issue with it: It renames the
> 'spfquery' script by applying a patch which, as a result, contains the
> whole script twice. I think it would be better to do that in the port's
> Makefile. Could you modify your patch in that way?
> 
> Regards,
> Stefan

Comment 21 Stefan Walter freebsd_committer 2013-05-13 22:30:55 UTC
Hi Jake,

Jake Guffey, 13.05.13, 23:20h CEST:

> I would love to fix the patch myself but unfortunately I am just not
> familiar enough with the perl's automake-like modules to be of any use.
> I did look into it today, and it seems like it would be a simply enough
> problem to fix, but I wasn't able to do it. Is there some functionality
> where I can execute a command via system() after the build process or
> similar?

I did not have a closer look at the build process of this particular port,
yet, but I would have suggested renaming the file in the "post-build" or
"pre-install" target of the port's Makefile (see [1]).

Regards,
Stefan

[1]: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#slow-work
Comment 22 jake.guffey 2013-05-14 16:10:56 UTC
Hi, Stefan:

Thanks for the link. I was unaware of the pre/post targets. This makefile should do the trick.



Thanks,
Jake Guffey
Network Security Engineer

eProtex
Network medical device security

5451 Lakeview Parkway S Drive
Indianapolis, Indiana 46268, USA
Mobile: 317-220-7100
jake.guffey@eprotex.com
www.eprotex.com

On May 13, 2013, at 5:30 PM, Stefan Walter <stefan@FreeBSD.org> wrote:

> Hi Jake,
> 
> Jake Guffey, 13.05.13, 23:20h CEST:
> 
>> I would love to fix the patch myself but unfortunately I am just not
>> familiar enough with the perl's automake-like modules to be of any use.
>> I did look into it today, and it seems like it would be a simply enough
>> problem to fix, but I wasn't able to do it. Is there some functionality
>> where I can execute a command via system() after the build process or
>> similar?
> 
> I did not have a closer look at the build process of this particular port,
> yet, but I would have suggested renaming the file in the "post-build" or
> "pre-install" target of the port's Makefile (see [1]).
> 
> Regards,
> Stefan
> 
> [1]: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#slow-work

Comment 23 Stefan Walter freebsd_committer 2013-05-14 19:41:30 UTC
Hi Jake,

Jake Guffey, 14.05.13, 17:10h CEST:

> Hi, Stefan:
> 
> Thanks for the link. I was unaware of the pre/post targets. This makefile should do the trick.

thanks for the patch. I have made a few additional changes to it (see
attachment):

- Use the new way of handling OPTIONS.
- Add the suffix to spfquery by default, since packages are built with
  defaults and this avoids the conflict with libspf2.
- Add DOCS to OPTIONS, too, instead of using NOPORTDOCS.
- Fix a few portlint warnings, mostly about whitespace.

It builds fine on redports.org. Can you verify that this version actually
works for you? (I don't use this port at all...)

Since Koen stated that he cannot maintain the port any more, I will remove
him from the MAINTAINER field in the Makefile. The port will be
unmaintained, then. Do you want to take over maintainership?

Regards,
Stefan
Comment 24 jake.guffey 2013-05-14 19:53:40 UTC
Hi, Stefan:

The patch you sent me builds without issue on my box.

I am unqualified to maintain this port.

Thanks,
Jake Guffey
Network Security Engineer

eProtex
Network medical device security

5451 Lakeview Parkway S Drive
Indianapolis, Indiana 46268, USA
Mobile: 317-220-7100
jake.guffey@eprotex.com
www.eprotex.com
Comment 25 dfilter service freebsd_committer 2013-05-14 20:12:37 UTC
Author: stefan
Date: Tue May 14 19:12:23 2013
New Revision: 318188
URL: http://svnweb.freebsd.org/changeset/ports/318188

Log:
  - Install 'spfquery' as 'spfquery.pl' by default, optionally keeping the
    original name.
  - Reset MAINTAINER.
  
  PR:		157107
  Patch by:	Jake Guffey <jake.guffey@eprotex.com>
  Approved by:	Koen Martens <gmc@sonologic.nl> (former maintainer)

Added:
  head/mail/p5-Mail-SPF/files/
  head/mail/p5-Mail-SPF/files/extra-patch-no-spfquery   (contents, props changed)
  head/mail/p5-Mail-SPF/files/extra-patch-spfquery-suffix   (contents, props changed)
Modified:
  head/mail/p5-Mail-SPF/Makefile
  head/mail/p5-Mail-SPF/pkg-descr
  head/mail/p5-Mail-SPF/pkg-plist

Modified: head/mail/p5-Mail-SPF/Makefile
==============================================================================
--- head/mail/p5-Mail-SPF/Makefile	Tue May 14 19:09:12 2013	(r318187)
+++ head/mail/p5-Mail-SPF/Makefile	Tue May 14 19:12:23 2013	(r318188)
@@ -3,13 +3,13 @@
 
 PORTNAME=	Mail-SPF
 PORTVERSION=	2.007
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	mail perl5
 MASTER_SITES=	CPAN
 PKGNAMEPREFIX=	p5-
 DISTNAME=	${PORTNAME}-v${PORTVERSION}
 
-MAINTAINER=	gmc@sonologic.nl
+MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Reference implementation of the RFC 4408 SPF protocol
 
 RUN_DEPENDS=	p5-Net-DNS-Resolver-Programmable>=0.002.1:${PORTSDIR}/dns/p5-Net-DNS-Resolver-Programmable \
@@ -20,12 +20,11 @@ RUN_DEPENDS=	p5-Net-DNS-Resolver-Program
 		p5-URI>=1.13:${PORTSDIR}/net/p5-URI
 BUILD_DEPENDS:=	${RUN_DEPENDS}
 
-CONFLICTS=	libspf2-[0-9]* p5-Mail-SPF-Query-[0-9]*
+CONFLICTS=	p5-Mail-SPF-Query-[0-9]*
 
 PERL_MODBUILD=	yes
 CONFIGURE_ARGS=	--install_path sbin=${PREFIX}/sbin
 
-MAN1=		spfquery.1
 MAN3=		Mail::SPF.3 Mail::SPF::Mech::PTR.3 Mail::SPF::Mech.3 \
 		Mail::SPF::SenderIPAddrMech.3 Mail::SPF::MacroString.3 \
 		Mail::SPF::Mech::IP4.3 Mail::SPF::Mech::A.3 \
@@ -37,13 +36,38 @@ MAN3=		Mail::SPF.3 Mail::SPF::Mech::PTR.
 		Mail::SPF::Base.3 Mail::SPF::Mech::All.3 Mail::SPF::Term.3 \
 		Mail::SPF::v1::Record.3 Mail::SPF::Mech::Exists.3
 
+OPTIONS_DEFINE=	SPFQUERY SPFQUERY_SUFFIX DOCS
+SPFQUERY_DESC=	Install spfquery command-line tool
+SPFQUERY_SUFFIX_DESC=Add .pl suffix to spfquery
+OPTIONS_DEFAULT=SPFQUERY SPFQUERY_SUFFIX
+
 .include <bsd.port.pre.mk>
 
 DOCSDIR=	${PREFIX}/share/doc/p5-Mail-SPF
 DOCS=		CHANGES INSTALL LICENSE README TODO
 
+.if ${PORT_OPTIONS:MSPFQUERY}
+PLIST_SUB+=	SPFQUERY=""
+
+.if ${PORT_OPTIONS:MSPFQUERY_SUFFIX}
+PLIST_SUB+=	SPFQUERY_SUFFIX=".pl"
+MAN1+=		spfquery.pl.1
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-spfquery-suffix
+post-extract:
+	${MV} ${WRKSRC}/bin/spfquery ${WRKSRC}/bin/spfquery.pl
+.else
+PLIST_SUB+=	SPFQUERY_SUFFIX=""
+MAN1+=		spfquery.1
+CONFLICTS+=	libspf2-[0-9]*
+.endif
+
+.else
+PLIST_SUB+=	SPFQUERY="@comment "
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-no-spfquery
+.endif
+
 post-install:
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
 	@${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/,} ${DOCSDIR}/
 .endif

Added: head/mail/p5-Mail-SPF/files/extra-patch-no-spfquery
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/p5-Mail-SPF/files/extra-patch-no-spfquery	Tue May 14 19:12:23 2013	(r318188)
@@ -0,0 +1,33 @@
+diff -Naur orig/Build.PL Build.PL
+--- orig/Build.PL	2009-10-31 23:16:14.000000000 +0100
++++ Build.PL	2011-05-24 19:27:19.000000000 +0200
+@@ -66,7 +66,6 @@
+                         => 'v0.002.1',
+     },
+     script_files    => [
+-        'bin/spfquery'
+     ],
+     install_path    => {
+         'sbin'          => '/usr/sbin'
+diff -Naur orig/MANIFEST MANIFEST
+--- orig/MANIFEST	2009-10-31 23:16:14.000000000 +0100
++++ MANIFEST	2011-05-24 19:26:56.000000000 +0200
+@@ -1,4 +1,3 @@
+-bin/spfquery
+ Build.PL
+ CHANGES
+ debian/changelog
+diff -Naur orig/README README
+--- orig/README	2009-10-31 23:16:14.000000000 +0100
++++ README	2011-05-24 19:27:05.000000000 +0200
+@@ -12,9 +12,8 @@
+ This release of Mail::SPF fully conforms to RFC 4408 and passes the 2008.08
+ release of the official test-suite <http://www.openspf.org/Test_Suite>.
+ 
+-The Mail::SPF source package includes the following additional tools:
++The Mail::SPF source package includes the following additional tool:
+ 
+-  * spfquery:  A command-line tool for performing SPF checks.
+   * spfd:      A daemon for services that perform SPF checks frequently.
+ 
+ Mail::SPF is not your mother!

Added: head/mail/p5-Mail-SPF/files/extra-patch-spfquery-suffix
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/p5-Mail-SPF/files/extra-patch-spfquery-suffix	Tue May 14 19:12:23 2013	(r318188)
@@ -0,0 +1,35 @@
+diff -Naur orig/Build.PL Build.PL
+--- orig/Build.PL      2009-10-31 23:16:14.000000000 +0100
++++ Build.PL   2011-05-24 19:40:10.000000000 +0200
+@@ -66,7 +66,7 @@
+                         => 'v0.002.1',
+     },
+     script_files    => [
+-        'bin/spfquery'
++        'bin/spfquery.pl'
+     ],
+     install_path    => {
+         'sbin'          => '/usr/sbin'
+diff -Naur orig/MANIFEST MANIFEST
+--- orig/MANIFEST      2009-10-31 23:16:14.000000000 +0100
++++ MANIFEST   2011-05-24 19:40:36.000000000 +0200
+@@ -1,4 +1,4 @@
+-bin/spfquery
++bin/spfquery.pl
+ Build.PL
+ CHANGES
+ debian/changelog
+diff -Naur orig/README README
+--- orig/README        2009-10-31 23:16:14.000000000 +0100
++++ README     2011-05-24 19:40:54.000000000 +0200
+@@ -14,8 +14,8 @@
+ 
+ The Mail::SPF source package includes the following additional tools:
+ 
+-  * spfquery:  A command-line tool for performing SPF checks.
+-  * spfd:      A daemon for services that perform SPF checks frequently.
++  * spfquery.pl: A command-line tool for performing SPF checks.
++  * spfd:        A daemon for services that perform SPF checks frequently.
+ 
+ Mail::SPF is not your mother!
+ -----------------------------

Modified: head/mail/p5-Mail-SPF/pkg-descr
==============================================================================
--- head/mail/p5-Mail-SPF/pkg-descr	Tue May 14 19:09:12 2013	(r318187)
+++ head/mail/p5-Mail-SPF/pkg-descr	Tue May 14 19:12:23 2013	(r318188)
@@ -9,4 +9,4 @@ The Mail::SPF source package includes th
   * spfquery:  A command-line tool for performing SPF checks.
   * spfd:      A daemon for services that perform SPF checks frequently.
 
-WWW:	http://www.openspf.org/
+WWW: http://www.openspf.org/

Modified: head/mail/p5-Mail-SPF/pkg-plist
==============================================================================
--- head/mail/p5-Mail-SPF/pkg-plist	Tue May 14 19:09:12 2013	(r318187)
+++ head/mail/p5-Mail-SPF/pkg-plist	Tue May 14 19:12:23 2013	(r318188)
@@ -1,4 +1,4 @@
-bin/spfquery
+%%SPFQUERY%%bin/spfquery%%SPFQUERY_SUFFIX%%
 sbin/spfd
 %%SITE_PERL%%/Mail/SPF.pm
 %%SITE_PERL%%/Mail/SPF/MacroString.pm
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 26 Stefan Walter freebsd_committer 2013-05-18 21:56:48 UTC
State Changed
From-To: feedback->closed

Patch was committed.
Comment 27 ml 2013-06-12 16:10:16 UTC
Hello.

IMO only half of the problem has been addressed.
While p5-Mail-SPF has been upgraded, mail/libspf2 still (always) 
CONFLICTs with it.

  bye
	av.
Comment 28 jake.guffey 2013-06-14 14:49:18 UTC
I have to agree with Andrea. Until libspf2 is fixed, the pr is only 1/2 solved.

--- Makefile    2013-06-13 18:54:38.000000000 +0000
+++ Makefile.new        2013-06-14 13:46:58.086924317 +0000
@@ -13,7 +13,7 @@
 LICENSE=       BSD LGPL21 LGPL3
 LICENSE_COMB=  dual
 
-CONFLICTS=     ${PORTNAME}-1.0.* p5-Mail-SPF-[0-9]* p5-Mail-SPF-Query-[0-9]*
+CONFLICTS=     ${PORTNAME}-1.0.* p5-Mail-SPF-Query-[0-9]*
 
 GNU_CONFIGURE= yes
 USE_AUTOTOOLS= lib tool

This should fix it, though.

Thanks,
Jake Guffey
Network Security Engineer

eProtex
Network medical device security

5451 Lakeview Parkway S Drive
Indianapolis, Indiana 46268, USA
Mobile: 317-220-7100
jake.guffey@eprotex.com
www.eprotex.com=
Comment 29 Stefan Walter freebsd_committer 2013-06-16 18:11:12 UTC
State Changed
From-To: closed->open

Reopen to look at the second involved port.
Comment 30 Stefan Walter freebsd_committer 2013-06-16 18:24:22 UTC
Hi,

Jake Guffey, 14.06.13, 15:49h CEST:

> I have to agree with Andrea. Until libspf2 is fixed, the pr is only 1/2 solved.
> 
> --- Makefile    2013-06-13 18:54:38.000000000 +0000
> +++ Makefile.new        2013-06-14 13:46:58.086924317 +0000
> @@ -13,7 +13,7 @@
>  LICENSE=       BSD LGPL21 LGPL3
>  LICENSE_COMB=  dual
>  
> -CONFLICTS=     ${PORTNAME}-1.0.* p5-Mail-SPF-[0-9]* p5-Mail-SPF-Query-[0-9]*
> +CONFLICTS=     ${PORTNAME}-1.0.* p5-Mail-SPF-Query-[0-9]*
>  
>  GNU_CONFIGURE= yes
>  USE_AUTOTOOLS= lib tool
> 
> This should fix it, though.

hm...strictly speaking, there is still the case in which p5-Mail-SPF is
installed with a spfquery that is not renamed. I guess it should just be
renamed unconditionally to never conflict...

Best regards,
Stefan
Comment 31 dfilter service freebsd_committer 2013-06-16 19:16:24 UTC
Author: stefan
Date: Sun Jun 16 18:16:16 2013
New Revision: 321065
URL: http://svnweb.freebsd.org/changeset/ports/321065

Log:
  - Let mail/p5-Mail-SPF always install spfquery as spfquery.pl unconditionally to
    avoid conflict with mail/libspf2.
  - Unregister conflict between mail/p5-Mail-SPF and mail/libspf2.
  
  PR:		157107

Added:
  head/mail/p5-Mail-SPF/files/patch-spfquery-suffix
     - copied unchanged from r318188, head/mail/p5-Mail-SPF/files/extra-patch-spfquery-suffix
Deleted:
  head/mail/p5-Mail-SPF/files/extra-patch-no-spfquery
  head/mail/p5-Mail-SPF/files/extra-patch-spfquery-suffix
Modified:
  head/mail/libspf2/Makefile
  head/mail/p5-Mail-SPF/Makefile
  head/mail/p5-Mail-SPF/pkg-plist

Modified: head/mail/libspf2/Makefile
==============================================================================
--- head/mail/libspf2/Makefile	Sun Jun 16 18:06:18 2013	(r321064)
+++ head/mail/libspf2/Makefile	Sun Jun 16 18:16:16 2013	(r321065)
@@ -3,6 +3,7 @@
 
 PORTNAME=	libspf2
 PORTVERSION=	1.2.10
+PORTREVISION=	1
 CATEGORIES=	mail
 MASTER_SITES=	http://www.libspf2.org/spf/ \
 		LOCAL/sunpoet
@@ -13,7 +14,7 @@ COMMENT=	Sender Rewriting Scheme 2 C Imp
 LICENSE=	BSD LGPL21 LGPL3
 LICENSE_COMB=	dual
 
-CONFLICTS=	${PORTNAME}-1.0.* p5-Mail-SPF-[0-9]* p5-Mail-SPF-Query-[0-9]*
+CONFLICTS=	${PORTNAME}-1.0.* p5-Mail-SPF-Query-[0-9]*
 
 GNU_CONFIGURE=	yes
 USE_AUTOTOOLS=	libtool

Modified: head/mail/p5-Mail-SPF/Makefile
==============================================================================
--- head/mail/p5-Mail-SPF/Makefile	Sun Jun 16 18:06:18 2013	(r321064)
+++ head/mail/p5-Mail-SPF/Makefile	Sun Jun 16 18:16:16 2013	(r321065)
@@ -3,7 +3,7 @@
 
 PORTNAME=	Mail-SPF
 PORTVERSION=	2.007
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	mail perl5
 MASTER_SITES=	CPAN
 PKGNAMEPREFIX=	p5-
@@ -25,6 +25,7 @@ CONFLICTS=	p5-Mail-SPF-Query-[0-9]*
 PERL_MODBUILD=	yes
 CONFIGURE_ARGS=	--install_path sbin=${PREFIX}/sbin
 
+MAN1=		spfquery.pl.1
 MAN3=		Mail::SPF.3 Mail::SPF::Mech::PTR.3 Mail::SPF::Mech.3 \
 		Mail::SPF::SenderIPAddrMech.3 Mail::SPF::MacroString.3 \
 		Mail::SPF::Mech::IP4.3 Mail::SPF::Mech::A.3 \
@@ -36,35 +37,15 @@ MAN3=		Mail::SPF.3 Mail::SPF::Mech::PTR.
 		Mail::SPF::Base.3 Mail::SPF::Mech::All.3 Mail::SPF::Term.3 \
 		Mail::SPF::v1::Record.3 Mail::SPF::Mech::Exists.3
 
-OPTIONS_DEFINE=	SPFQUERY SPFQUERY_SUFFIX DOCS
-SPFQUERY_DESC=	Install spfquery command-line tool
-SPFQUERY_SUFFIX_DESC=Add .pl suffix to spfquery
-OPTIONS_DEFAULT=SPFQUERY SPFQUERY_SUFFIX
+OPTIONS_DEFINE=	DOCS
 
 .include <bsd.port.pre.mk>
 
 DOCSDIR=	${PREFIX}/share/doc/p5-Mail-SPF
 DOCS=		CHANGES INSTALL LICENSE README TODO
 
-.if ${PORT_OPTIONS:MSPFQUERY}
-PLIST_SUB+=	SPFQUERY=""
-
-.if ${PORT_OPTIONS:MSPFQUERY_SUFFIX}
-PLIST_SUB+=	SPFQUERY_SUFFIX=".pl"
-MAN1+=		spfquery.pl.1
-EXTRA_PATCHES+=	${FILESDIR}/extra-patch-spfquery-suffix
 post-extract:
 	${MV} ${WRKSRC}/bin/spfquery ${WRKSRC}/bin/spfquery.pl
-.else
-PLIST_SUB+=	SPFQUERY_SUFFIX=""
-MAN1+=		spfquery.1
-CONFLICTS+=	libspf2-[0-9]*
-.endif
-
-.else
-PLIST_SUB+=	SPFQUERY="@comment "
-EXTRA_PATCHES+=	${FILESDIR}/extra-patch-no-spfquery
-.endif
 
 post-install:
 .if ${PORT_OPTIONS:MDOCS}

Copied: head/mail/p5-Mail-SPF/files/patch-spfquery-suffix (from r318188, head/mail/p5-Mail-SPF/files/extra-patch-spfquery-suffix)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/mail/p5-Mail-SPF/files/patch-spfquery-suffix	Sun Jun 16 18:16:16 2013	(r321065, copy of r318188, head/mail/p5-Mail-SPF/files/extra-patch-spfquery-suffix)
@@ -0,0 +1,35 @@
+diff -Naur orig/Build.PL Build.PL
+--- orig/Build.PL      2009-10-31 23:16:14.000000000 +0100
++++ Build.PL   2011-05-24 19:40:10.000000000 +0200
+@@ -66,7 +66,7 @@
+                         => 'v0.002.1',
+     },
+     script_files    => [
+-        'bin/spfquery'
++        'bin/spfquery.pl'
+     ],
+     install_path    => {
+         'sbin'          => '/usr/sbin'
+diff -Naur orig/MANIFEST MANIFEST
+--- orig/MANIFEST      2009-10-31 23:16:14.000000000 +0100
++++ MANIFEST   2011-05-24 19:40:36.000000000 +0200
+@@ -1,4 +1,4 @@
+-bin/spfquery
++bin/spfquery.pl
+ Build.PL
+ CHANGES
+ debian/changelog
+diff -Naur orig/README README
+--- orig/README        2009-10-31 23:16:14.000000000 +0100
++++ README     2011-05-24 19:40:54.000000000 +0200
+@@ -14,8 +14,8 @@
+ 
+ The Mail::SPF source package includes the following additional tools:
+ 
+-  * spfquery:  A command-line tool for performing SPF checks.
+-  * spfd:      A daemon for services that perform SPF checks frequently.
++  * spfquery.pl: A command-line tool for performing SPF checks.
++  * spfd:        A daemon for services that perform SPF checks frequently.
+ 
+ Mail::SPF is not your mother!
+ -----------------------------

Modified: head/mail/p5-Mail-SPF/pkg-plist
==============================================================================
--- head/mail/p5-Mail-SPF/pkg-plist	Sun Jun 16 18:06:18 2013	(r321064)
+++ head/mail/p5-Mail-SPF/pkg-plist	Sun Jun 16 18:16:16 2013	(r321065)
@@ -1,4 +1,4 @@
-%%SPFQUERY%%bin/spfquery%%SPFQUERY_SUFFIX%%
+bin/spfquery.pl
 sbin/spfd
 %%SITE_PERL%%/Mail/SPF.pm
 %%SITE_PERL%%/Mail/SPF/MacroString.pm
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 32 Stefan Walter freebsd_committer 2013-06-16 19:17:08 UTC
State Changed
From-To: open->closed

The mail/p5-Mail-SPF port now always installs spfquery as spfquery.pl. Conflict 
with mail/libspf2 has been removed.