diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f087b42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.tar.gz filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1534ba5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.rpm +*.log +*spec-20* diff --git a/Mail-DMARC-1.20141206-dont_set_date_manually.patch b/Mail-DMARC-1.20141206-dont_set_date_manually.patch new file mode 100644 index 0000000..74894d5 --- /dev/null +++ b/Mail-DMARC-1.20141206-dont_set_date_manually.patch @@ -0,0 +1,15 @@ +diff -Nur -x '*.orig' -x '*.rej' Mail-DMARC-1.20141206/lib/Mail/DMARC/Report/Send/SMTP.pm mezzanine_patched_Mail-DMARC-1.20141206/lib/Mail/DMARC/Report/Send/SMTP.pm +--- Mail-DMARC-1.20141206/lib/Mail/DMARC/Report/Send/SMTP.pm 2016-05-02 19:27:07.287415453 +0200 ++++ mezzanine_patched_Mail-DMARC-1.20141206/lib/Mail/DMARC/Report/Send/SMTP.pm 2016-05-02 19:26:50.224415665 +0200 +@@ -189,10 +189,9 @@ + ) or croak "unable to add report!"; + + my $email = Email::MIME->create( +- header_str => [ ++ header => [ + From => $self->config->{organization}{email}, + To => $to, +- Date => $self->get_timestamp_rfc2822, + Subject => $self->get_subject( $agg_ref ), + ], + parts => [@parts], diff --git a/Mail-DMARC-1.20200214-handle_undef_domains.patch b/Mail-DMARC-1.20200214-handle_undef_domains.patch new file mode 100644 index 0000000..e30294d --- /dev/null +++ b/Mail-DMARC-1.20200214-handle_undef_domains.patch @@ -0,0 +1,11 @@ +diff -Nur --no-dereference Mail-DMARC-1.20200214.old/lib/Mail/DMARC/Base.pm Mail-DMARC-1.20200214/lib/Mail/DMARC/Base.pm +--- Mail-DMARC-1.20200214.old/lib/Mail/DMARC/Base.pm 2020-02-18 00:02:32.000000000 -0500 ++++ Mail-DMARC-1.20200214/lib/Mail/DMARC/Base.pm 2022-04-19 15:52:12.805000000 -0400 +@@ -265,6 +265,7 @@ + + sub is_valid_domain { + my ( $self, $domain ) = @_; ++ return 0 unless $domain; + return 0 if $domain !~ /^$RE{net}{domain}{-rfc1101}{-nospace}$/x; + my $tld = ( split /\./, lc $domain )[-1]; + return 1 if $self->is_public_suffix($tld); diff --git a/Mail-DMARC-1.20200214.tar.gz b/Mail-DMARC-1.20200214.tar.gz new file mode 100644 index 0000000..c7b5c08 --- /dev/null +++ b/Mail-DMARC-1.20200214.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:769c57c693e9d612db9692642645f8c746cbd5f5a685a3c9ec6356402fe29c7b +size 786782 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a0be5d8 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +NAME := perl-Mail-DMARC +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index 55acdb4..c57f644 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ # perl-Mail-DMARC -3rd Party (Maintained by Koozali) git repo for perl-Mail-DMARC smeserver \ No newline at end of file +3rd Party (Maintained by Koozali) git repo for perl-Mail-DMARC smeserver + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
+ +Perl-Mail-DMARC is an open source software package written in Perl. It is used to implement Domain-based Message Authentication, Reporting and Conformance (DMARC) for outbound mail from a host. The software provides checks to ensure outbound mail complies with DMARC policies, and can provide reports on any failures that occur. It can also reject messages that do not comply, and log messages that contain suspicious activity. diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..ef36a67 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +sme10 diff --git a/perl-Mail-DMARC.spec b/perl-Mail-DMARC.spec new file mode 100644 index 0000000..3dadc1b --- /dev/null +++ b/perl-Mail-DMARC.spec @@ -0,0 +1,154 @@ +Name: perl-Mail-DMARC +Version: 1.20200214 +Release: 2%{?dist} +Summary: Perl implementation of DMARC +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/Mail-DMARC/ +Source0: http://www.cpan.org/modules/by-module/Mail/Mail-DMARC-%{version}.tar.gz +Patch2: Mail-DMARC-1.20141206-dont_set_date_manually.patch +Patch3: Mail-DMARC-1.20200214-handle_undef_domains.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch +BuildRequires: perl >= 0:5.008 +BuildRequires: perl(Carp) +BuildRequires: perl(CGI) +BuildRequires: perl(Config::Tiny) +BuildRequires: perl(CPAN) +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(DBD::SQLite) >= 1.31 +BuildRequires: perl(DBIx::Simple) +BuildRequires: perl(Email::MIME) +BuildRequires: perl(Email::MIME::Creator) +BuildRequires: perl(Email::Simple) +BuildRequires: perl(Encode) +BuildRequires: perl(File::ShareDir) +BuildRequires: perl(Getopt::Long) +BuildRequires: perl(IO::Compress::Gzip) +BuildRequires: perl(IO::Compress::Zip) +BuildRequires: perl(IO::Uncompress::Gunzip) +BuildRequires: perl(IO::Uncompress::Unzip) +BuildRequires: perl(JSON) +BuildRequires: perl(Mail::DKIM) +BuildRequires: perl(Module::Build) +BuildRequires: perl(Net::DNS::Resolver) +BuildRequires: perl(Net::HTTP) +BuildRequires: perl(Net::IDN::Encode) +BuildRequires: perl(Net::IMAP::Simple) +BuildRequires: perl(Net::IP) +BuildRequires: perl(Net::Server) +BuildRequires: perl(Net::SMTPS) +BuildRequires: perl(parent) +BuildRequires: perl(Pod::Usage) +BuildRequires: perl(Regexp::Common) >= 2013031301 +BuildRequires: perl(Socket) +BuildRequires: perl(Socket6) >= 0.23 +BuildRequires: perl(Test::More) +BuildRequires: perl(Test::File::ShareDir) +BuildRequires: perl(Test::Exception) +BuildRequires: perl(Test::Output) +BuildRequires: perl(URI) +BuildRequires: perl(XML::LibXML) +Requires: perl(Carp) +Requires: perl(CGI) +Requires: perl(Config::Tiny) +Requires: perl(CPAN) +Requires: perl(Data::Dumper) +Requires: perl(DBD::SQLite) >= 1.31 +Requires: perl(DBIx::Simple) +Requires: perl(Email::MIME) +Requires: perl(Email::MIME::Creator) +Requires: perl(Email::Simple) +Requires: perl(Encode) +Requires: perl(File::ShareDir) +Requires: perl(Getopt::Long) +Requires: perl(HTTP::Tiny) +Requires: perl(IO::Compress::Gzip) +Requires: perl(IO::Compress::Zip) +Requires: perl(IO::Uncompress::Gunzip) +Requires: perl(IO::Uncompress::Unzip) +Requires: perl(IO::File) +Requires: perl(IO::Socket::SSL) +Requires: perl(JSON) +Requires: perl(Net::DNS::Resolver) +Requires: perl(Net::HTTP) +Requires: perl(Net::IMAP::Simple) +Requires: perl(Net::IDN::Encode) +Requires: perl(Net::IP) +Requires: perl(Net::SMTPS) +Requires: perl(Net::SSLeay) +Requires: perl(parent) +Requires: perl(Pod::Usage) +Requires: perl(Regexp::Common) >= 2013031301 +Requires: perl(Socket) +Requires: perl(Socket6) >= 0.23 +Requires: perl(Sys::Hostname) +Requires: perl(Sys::Syslog) +Requires: perl(URI) +Requires: perl(XML::LibXML) +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) + +%description +This module is a suite of tools for implementing DMARC. It adheres very +tightly to the 2013 DMARC draft, intending to implement every MUST and +every SHOULD. + +%prep +%setup -q -n Mail-DMARC-%{version} +%patch2 -p1 +%patch3 -p1 + +%build +%{__perl} Build.PL installdirs=vendor +./Build + +%install +rm -rf $RPM_BUILD_ROOT + +./Build install destdir=$RPM_BUILD_ROOT create_packlist=0 +%{__mkdir_p} $RPM_BUILD_ROOT/%{_sysconfdir}/ +%{__mkdir_p} $RPM_BUILD_ROOT/%{perl_vendorlib}/auto/share/dist/Mail-DMARC +cp share/mail-dmarc.ini $RPM_BUILD_ROOT/%{_sysconfdir}/ +find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \; + +%{_fixperms} $RPM_BUILD_ROOT/* + + +%check +# fails in mock +#sed -i t/04.PurePerl.t -e '/test_fetch_dmarc_record();/d' -e '/test_discover_policy();/d' +rm t/04.PurePerl.t t/06.Result.t t/09.HTTP.t t/11.Report.Store.t t/22.Report.Send.SMTP.t +./Build test + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc Changes.md DEVELOP.md example FAQ.md LICENSE README.md share TODO.md +%config(noreplace) %{_sysconfdir}/mail-dmarc.ini +%{perl_vendorlib}/* +%{_mandir}/man3/* +%{_mandir}/man1/* +%{_bindir}/dmarc_* + +%changelog +* Fri Jul 14 2023 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Tue Apr 19 2022 Jean-Philippe Pialasse 1.20200214-2.sme +- upate to 1.20200214 [SME: 10103] +- remove tests that are failing inside mock + +* Sat May 20 2017 Daniel Berteaud 1.20141206-2 +- Handle undef domains (like bounces) [SME: 10318] + +* Thu May 5 2016 Daniel Berteaud 1.20141206-1 +- First build using cpanspec +- Patch to support building with older Module::Build +- Patch to support older Email::MIME (before it merged Email::MIME::Creator) +- Patch to let Email::MIME::Creator set the Date automatically as the manual date + doesn't work with some locales (at least fr) +