aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes11
-rw-r--r--LICENSE18
-rw-r--r--MANIFEST4
-rw-r--r--META.json77
-rw-r--r--META.yml67
-rw-r--r--Makefile.PL120
-rw-r--r--lib/Sietima.pm35
-rw-r--r--lib/Sietima/CmdLine.pm10
-rw-r--r--lib/Sietima/HeaderURI.pm32
-rw-r--r--lib/Sietima/MailStore.pm6
-rw-r--r--lib/Sietima/MailStore/FS.pm62
-rw-r--r--lib/Sietima/Message.pm6
-rw-r--r--lib/Sietima/Policy.pm14
-rw-r--r--lib/Sietima/Role/AvoidDups.pm6
-rw-r--r--lib/Sietima/Role/Debounce.pm6
-rw-r--r--lib/Sietima/Role/Headers.pm8
-rw-r--r--lib/Sietima/Role/ManualSubscription.pm6
-rw-r--r--lib/Sietima/Role/NoMail.pm6
-rw-r--r--lib/Sietima/Role/NoSpoof.pm67
-rw-r--r--lib/Sietima/Role/ReplyTo.pm7
-rw-r--r--lib/Sietima/Role/SubjectTag.pm6
-rw-r--r--lib/Sietima/Role/SubscriberOnly.pm14
-rw-r--r--lib/Sietima/Role/SubscriberOnly/Drop.pm6
-rw-r--r--lib/Sietima/Role/SubscriberOnly/Moderate.pm46
-rw-r--r--lib/Sietima/Role/WithMailStore.pm6
-rw-r--r--lib/Sietima/Role/WithOwner.pm6
-rw-r--r--lib/Sietima/Role/WithPostAddress.pm6
-rw-r--r--lib/Sietima/Runner.pm6
-rw-r--r--lib/Sietima/Subscriber.pm19
-rw-r--r--lib/Sietima/Types.pm6
-rw-r--r--perlcritic.rc2
-rw-r--r--t/author-no-tabs.t2
-rw-r--r--t/author-pod-coverage.t3
-rw-r--r--t/lib/Test/Sietima.pm2
-rw-r--r--t/tests/sietima/role/nospoof.t25
35 files changed, 434 insertions, 289 deletions
diff --git a/Changes b/Changes
index bac938d..ffbe569 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,14 @@
+1.1.0 2023-02-28 11:56:27+00:00 Europe/London
+ - require perl 5.36
+ - new role NoSpoof for better DMARC compliance
+ - bumped all dependencies to latest
+
+1.0.5 2019-04-29 15:44:26+01:00 Europe/London
+ - *really* make it work with App::Spec 0.005
+
+1.0.4 2019-04-29 15:31:45+01:00 Europe/London
+ - make it work with App::Spec 0.005
+
1.0.3 2017-06-22 18:26:22+01:00 Europe/London
- fixed test failures under future Email::MIME
- mark App::Spec 0.004_001 as not suitable (it fails when calling
diff --git a/LICENSE b/LICENSE
index eff077f..92f485e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is Copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software, licensed under:
@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is Copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software, licensed under:
@@ -292,21 +292,21 @@ Definitions:
- "Package" refers to the collection of files distributed by the Copyright
Holder, and derivatives of that collection of files created through
- textual modification.
+ textual modification.
- "Standard Version" refers to such a Package if it has not been modified,
or has been modified in accordance with the wishes of the Copyright
- Holder.
+ Holder.
- "Copyright Holder" is whoever is named in the copyright or copyrights for
- the package.
+ the package.
- "You" is you, if you're thinking about copying or distributing this Package.
- "Reasonable copying fee" is whatever you can justify on the basis of media
cost, duplication charges, time of people involved, and so on. (You will
not be required to justify it to the Copyright Holder, but only to the
- computing community at large as a market that must bear the fee.)
+ computing community at large as a market that must bear the fee.)
- "Freely Available" means that no fee is charged for the item itself, though
there may be fees involved in handling the item. It also means that
recipients of the item may redistribute it under the same conditions they
- received it.
+ received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
@@ -373,7 +373,7 @@ products derived from this software without specific prior written permission.
9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
diff --git a/MANIFEST b/MANIFEST
index fc9c0d8..d507227 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.009.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.030.
Changes
LICENSE
MANIFEST
@@ -19,6 +19,7 @@ lib/Sietima/Role/Debounce.pm
lib/Sietima/Role/Headers.pm
lib/Sietima/Role/ManualSubscription.pm
lib/Sietima/Role/NoMail.pm
+lib/Sietima/Role/NoSpoof.pm
lib/Sietima/Role/ReplyTo.pm
lib/Sietima/Role/SubjectTag.pm
lib/Sietima/Role/SubscriberOnly.pm
@@ -48,6 +49,7 @@ t/tests/sietima/role/debounce.t
t/tests/sietima/role/headers.t
t/tests/sietima/role/manualsubscription.t
t/tests/sietima/role/nomail.t
+t/tests/sietima/role/nospoof.t
t/tests/sietima/role/replyto.t
t/tests/sietima/role/subject-tag.t
t/tests/sietima/role/subscriberonly/drop.t
diff --git a/META.json b/META.json
index 264a4aa..09e8f5e 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
"Gianni Ceccarelli <dakkar@thenautilus.net>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150010",
+ "generated_by" : "Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
@@ -21,58 +21,55 @@
"prereqs" : {
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : "7.30"
+ "ExtUtils::MakeMaker" : "7.66"
}
},
"develop" : {
"requires" : {
- "Pod::Coverage::TrustPod" : "0.100003",
- "Test::More" : "1.302086",
- "Test::NoTabs" : "2.00",
- "Test::Perl::Critic" : "1.03",
- "Test::Pod" : "1.51",
+ "Pod::Coverage::TrustPod" : "0.100006",
+ "Test::More" : "1.302192",
+ "Test::NoTabs" : "2.02",
+ "Test::Perl::Critic" : "1.04",
+ "Test::Pod" : "1.52",
"Test::Pod::Coverage" : "1.10"
}
},
"runtime" : {
"requires" : {
- "App::Spec" : ">= 0.004, != 0.004_001",
- "App::Spec::Run" : ">= 0.004, != 0.004_001",
- "Digest::SHA" : "5.96",
- "Email::Address" : "1.908",
- "Email::MIME" : "1.940",
- "Email::Sender" : "1.300031",
- "Email::Sender::Simple" : "1.300031",
- "Email::Stuffer" : "0.014",
- "List::AllUtils" : "0.14",
- "Moo" : "2.003002",
- "Moo::Role" : "2.003002",
+ "App::Spec" : "0.013",
+ "App::Spec::Run" : "0.013",
+ "Digest::SHA" : "6.04",
+ "Email::Address" : "1.913",
+ "Email::MIME" : "1.953",
+ "Email::Sender::Simple" : "2.600",
+ "Email::Stuffer" : "0.020",
+ "List::AllUtils" : "0.19",
+ "Moo" : "2.005005",
+ "Moo::Role" : "2.005005",
"MooX::Traits" : "0.005",
- "Try::Tiny" : "0.28",
- "Type::Library" : "1.002001",
- "Type::Params" : "1.002001",
- "Type::Utils" : "1.002001",
- "Types::Path::Tiny" : "0.005",
- "Types::Standard" : "1.002001",
- "Types::URI" : "0.006",
- "experimental" : "0.016",
- "feature" : "1.42",
+ "Type::Library" : "2.002001",
+ "Type::Params" : "2.002001",
+ "Type::Utils" : "2.002001",
+ "Types::Path::Tiny" : "0.006",
+ "Types::Standard" : "2.002001",
+ "Types::URI" : "0.007",
+ "feature" : "1.72",
"namespace::clean" : "0.27",
- "perl" : "5.024",
- "strict" : "1.11",
- "warnings" : "1.36"
+ "perl" : "v5.36.0",
+ "strict" : "1.12",
+ "warnings" : "1.58"
}
},
"test" : {
"requires" : {
- "Data::Printer" : "0.39",
- "Email::Sender::Transport::Test" : "1.300031",
+ "Data::Printer" : "1.001000",
+ "Email::Sender::Transport::Test" : "2.600",
"Import::Into" : "1.002005",
- "Path::Tiny" : "0.104",
- "Test2::API" : "1.302086",
- "Test2::V0" : "0.000072",
- "URI" : "1.71",
- "lib" : "0.63"
+ "Path::Tiny" : "0.144",
+ "Test2::API" : "1.302192",
+ "Test2::V0" : "0.000145",
+ "URI" : "5.17",
+ "lib" : "0.65"
}
}
},
@@ -85,7 +82,9 @@
"web" : "https://www.thenautilus.net/cgit/Sietima"
}
},
- "version" : "1.0.3",
- "x_serialization_backend" : "Cpanel::JSON::XS version 3.0233"
+ "version" : "1.1.0",
+ "x_generated_by_perl" : "v5.36.0",
+ "x_serialization_backend" : "Cpanel::JSON::XS version 4.35",
+ "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later"
}
diff --git a/META.yml b/META.yml
index b829e5f..4c6d8fc 100644
--- a/META.yml
+++ b/META.yml
@@ -3,18 +3,18 @@ abstract: 'minimal mailing list manager'
author:
- 'Gianni Ceccarelli <dakkar@thenautilus.net>'
build_requires:
- Data::Printer: '0.39'
- Email::Sender::Transport::Test: '1.300031'
+ Data::Printer: '1.001000'
+ Email::Sender::Transport::Test: '2.600'
Import::Into: '1.002005'
- Path::Tiny: '0.104'
- Test2::API: '1.302086'
- Test2::V0: '0.000072'
- URI: '1.71'
- lib: '0.63'
+ Path::Tiny: '0.144'
+ Test2::API: '1.302192'
+ Test2::V0: '0.000145'
+ URI: '5.17'
+ lib: '0.65'
configure_requires:
- ExtUtils::MakeMaker: '7.30'
+ ExtUtils::MakeMaker: '7.66'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150010'
+generated_by: 'Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,33 +24,32 @@ no_index:
directory:
- t/lib
requires:
- App::Spec: '>= 0.004, != 0.004_001'
- App::Spec::Run: '>= 0.004, != 0.004_001'
- Digest::SHA: '5.96'
- Email::Address: '1.908'
- Email::MIME: '1.940'
- Email::Sender: '1.300031'
- Email::Sender::Simple: '1.300031'
- Email::Stuffer: '0.014'
- List::AllUtils: '0.14'
- Moo: '2.003002'
- Moo::Role: '2.003002'
+ App::Spec: '0.013'
+ App::Spec::Run: '0.013'
+ Digest::SHA: '6.04'
+ Email::Address: '1.913'
+ Email::MIME: '1.953'
+ Email::Sender::Simple: '2.600'
+ Email::Stuffer: '0.020'
+ List::AllUtils: '0.19'
+ Moo: '2.005005'
+ Moo::Role: '2.005005'
MooX::Traits: '0.005'
- Try::Tiny: '0.28'
- Type::Library: '1.002001'
- Type::Params: '1.002001'
- Type::Utils: '1.002001'
- Types::Path::Tiny: '0.005'
- Types::Standard: '1.002001'
- Types::URI: '0.006'
- experimental: '0.016'
- feature: '1.42'
+ Type::Library: '2.002001'
+ Type::Params: '2.002001'
+ Type::Utils: '2.002001'
+ Types::Path::Tiny: '0.006'
+ Types::Standard: '2.002001'
+ Types::URI: '0.007'
+ feature: '1.72'
namespace::clean: '0.27'
- perl: '5.024'
- strict: '1.11'
- warnings: '1.36'
+ perl: v5.36.0
+ strict: '1.12'
+ warnings: '1.58'
resources:
homepage: https://www.thenautilus.net/SW/Sietima/
repository: https://www.thenautilus.net/cgit/Sietima
-version: 1.0.3
-x_serialization_backend: 'YAML::Tiny version 1.70'
+version: 1.1.0
+x_generated_by_perl: v5.36.0
+x_serialization_backend: 'YAML::Tiny version 1.73'
+x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'
diff --git a/Makefile.PL b/Makefile.PL
index 4dc84f8..3c14d60 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,8 +1,8 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.009.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.030.
use strict;
use warnings;
-use 5.024;
+use 5.036000;
use ExtUtils::MakeMaker 7.30;
@@ -10,49 +10,46 @@ my %WriteMakefileArgs = (
"ABSTRACT" => "minimal mailing list manager",
"AUTHOR" => "Gianni Ceccarelli <dakkar\@thenautilus.net>",
"CONFIGURE_REQUIRES" => {
- "ExtUtils::MakeMaker" => "7.30"
+ "ExtUtils::MakeMaker" => "7.66"
},
"DISTNAME" => "Sietima",
"LICENSE" => "perl",
- "MIN_PERL_VERSION" => "5.024",
+ "MIN_PERL_VERSION" => "5.036000",
"NAME" => "Sietima",
"PREREQ_PM" => {
- "App::Spec" => ">= 0.004, != 0.004_001",
- "App::Spec::Run" => ">= 0.004, != 0.004_001",
- "Digest::SHA" => "5.96",
- "Email::Address" => "1.908",
- "Email::MIME" => "1.940",
- "Email::Sender" => "1.300031",
- "Email::Sender::Simple" => "1.300031",
- "Email::Stuffer" => "0.014",
- "List::AllUtils" => "0.14",
- "Moo" => "2.003002",
- "Moo::Role" => "2.003002",
+ "App::Spec" => "0.013",
+ "App::Spec::Run" => "0.013",
+ "Digest::SHA" => "6.04",
+ "Email::Address" => "1.913",
+ "Email::MIME" => "1.953",
+ "Email::Sender::Simple" => "2.600",
+ "Email::Stuffer" => "0.020",
+ "List::AllUtils" => "0.19",
+ "Moo" => "2.005005",
+ "Moo::Role" => "2.005005",
"MooX::Traits" => "0.005",
- "Try::Tiny" => "0.28",
- "Type::Library" => "1.002001",
- "Type::Params" => "1.002001",
- "Type::Utils" => "1.002001",
- "Types::Path::Tiny" => "0.005",
- "Types::Standard" => "1.002001",
- "Types::URI" => "0.006",
- "experimental" => "0.016",
- "feature" => "1.42",
+ "Type::Library" => "2.002001",
+ "Type::Params" => "2.002001",
+ "Type::Utils" => "2.002001",
+ "Types::Path::Tiny" => "0.006",
+ "Types::Standard" => "2.002001",
+ "Types::URI" => "0.007",
+ "feature" => "1.72",
"namespace::clean" => "0.27",
- "strict" => "1.11",
- "warnings" => "1.36"
+ "strict" => "1.12",
+ "warnings" => "1.58"
},
"TEST_REQUIRES" => {
- "Data::Printer" => "0.39",
- "Email::Sender::Transport::Test" => "1.300031",
+ "Data::Printer" => "1.001000",
+ "Email::Sender::Transport::Test" => "2.600",
"Import::Into" => "1.002005",
- "Path::Tiny" => "0.104",
- "Test2::API" => "1.302086",
- "Test2::V0" => "0.000072",
- "URI" => "1.71",
- "lib" => "0.63"
+ "Path::Tiny" => "0.144",
+ "Test2::API" => "1.302192",
+ "Test2::V0" => "0.000145",
+ "URI" => "5.17",
+ "lib" => "0.65"
},
- "VERSION" => "1.0.3",
+ "VERSION" => "1.1.0",
"test" => {
"TESTS" => "t/*.t t/tests/*.t t/tests/sietima/*.t t/tests/sietima/multi-role/*.t t/tests/sietima/role/*.t t/tests/sietima/role/subscriberonly/*.t"
}
@@ -60,38 +57,35 @@ my %WriteMakefileArgs = (
my %FallbackPrereqs = (
- "App::Spec" => ">= 0.004, != 0.004_001",
- "App::Spec::Run" => ">= 0.004, != 0.004_001",
- "Data::Printer" => "0.39",
- "Digest::SHA" => "5.96",
- "Email::Address" => "1.908",
- "Email::MIME" => "1.940",
- "Email::Sender" => "1.300031",
- "Email::Sender::Simple" => "1.300031",
- "Email::Sender::Transport::Test" => "1.300031",
- "Email::Stuffer" => "0.014",
+ "App::Spec" => "0.013",
+ "App::Spec::Run" => "0.013",
+ "Data::Printer" => "1.001000",
+ "Digest::SHA" => "6.04",
+ "Email::Address" => "1.913",
+ "Email::MIME" => "1.953",
+ "Email::Sender::Simple" => "2.600",
+ "Email::Sender::Transport::Test" => "2.600",
+ "Email::Stuffer" => "0.020",
"Import::Into" => "1.002005",
- "List::AllUtils" => "0.14",
- "Moo" => "2.003002",
- "Moo::Role" => "2.003002",
+ "List::AllUtils" => "0.19",
+ "Moo" => "2.005005",
+ "Moo::Role" => "2.005005",
"MooX::Traits" => "0.005",
- "Path::Tiny" => "0.104",
- "Test2::API" => "1.302086",
- "Test2::V0" => "0.000072",
- "Try::Tiny" => "0.28",
- "Type::Library" => "1.002001",
- "Type::Params" => "1.002001",
- "Type::Utils" => "1.002001",
- "Types::Path::Tiny" => "0.005",
- "Types::Standard" => "1.002001",
- "Types::URI" => "0.006",
- "URI" => "1.71",
- "experimental" => "0.016",
- "feature" => "1.42",
- "lib" => "0.63",
+ "Path::Tiny" => "0.144",
+ "Test2::API" => "1.302192",
+ "Test2::V0" => "0.000145",
+ "Type::Library" => "2.002001",
+ "Type::Params" => "2.002001",
+ "Type::Utils" => "2.002001",
+ "Types::Path::Tiny" => "0.006",
+ "Types::Standard" => "2.002001",
+ "Types::URI" => "0.007",
+ "URI" => "5.17",
+ "feature" => "1.72",
+ "lib" => "0.65",
"namespace::clean" => "0.27",
- "strict" => "1.11",
- "warnings" => "1.36"
+ "strict" => "1.12",
+ "warnings" => "1.58"
);
diff --git a/lib/Sietima.pm b/lib/Sietima.pm
index b7a4144..586c9a4 100644
--- a/lib/Sietima.pm
+++ b/lib/Sietima.pm
@@ -1,8 +1,8 @@
package Sietima;
use Moo;
use Sietima::Policy;
-use Types::Standard qw(ArrayRef Object FileHandle Maybe);
-use Type::Params qw(compile);
+use Types::Standard qw(ArrayRef Object);
+use Type::Params -sigs;
use Sietima::Types qw(Address AddressFromStr
EmailMIME Message
Subscriber SubscriberFromAddress SubscriberFromStr SubscriberFromHashRef
@@ -10,12 +10,11 @@ use Sietima::Types qw(Address AddressFromStr
use Sietima::Message;
use Sietima::Subscriber;
use Email::Sender::Simple qw();
-use Email::Sender;
use Email::Address;
use namespace::clean;
with 'MooX::Traits';
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: minimal mailing list manager
@@ -58,9 +57,11 @@ sub handle_mail_from_stdin($self,@) {
}
+signature_for handle_mail => (
+ method => Object,
+ positional => [ EmailMIME ],
+);
sub handle_mail($self,$incoming_mail) {
- state $check = compile(Object,EmailMIME); $check->(@_);
-
my (@outgoing_messages) = $self->munge_mail($incoming_mail);
for my $outgoing_message (@outgoing_messages) {
$self->send_message($outgoing_message);
@@ -69,16 +70,20 @@ sub handle_mail($self,$incoming_mail) {
}
+signature_for subscribers_to_send_to => (
+ method => Object,
+ positional => [ EmailMIME ],
+);
sub subscribers_to_send_to($self,$incoming_mail) {
- state $check = compile(Object,EmailMIME); $check->(@_);
-
return $self->subscribers;
}
+signature_for munge_mail => (
+ method => Object,
+ positional => [ EmailMIME ],
+);
sub munge_mail($self,$incoming_mail) {
- state $check = compile(Object,EmailMIME); $check->(@_);
-
return Sietima::Message->new({
mail => $incoming_mail,
from => $self->return_path,
@@ -87,9 +92,11 @@ sub munge_mail($self,$incoming_mail) {
}
+signature_for send_message => (
+ method => Object,
+ positional => [ Message ],
+);
sub send_message($self,$outgoing_message) {
- state $check = compile(Object,Message); $check->(@_);
-
my $envelope = $outgoing_message->envelope;
if ($envelope->{to} && $envelope->{to}->@*) {
$self->transport->send(
@@ -138,7 +145,7 @@ Sietima - minimal mailing list manager
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -343,7 +350,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/CmdLine.pm b/lib/Sietima/CmdLine.pm
index b4c4ef9..86b8004 100644
--- a/lib/Sietima/CmdLine.pm
+++ b/lib/Sietima/CmdLine.pm
@@ -8,7 +8,7 @@ use App::Spec;
use Sietima::Runner;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: run Sietima as a command-line application
@@ -48,6 +48,10 @@ sub _build_app_spec($self) {
return App::Spec->read({
$spec_data->%*,
$self->extra_spec->%*,
+
+ # App::Spec 0.005 really wants a class name, even when we pass
+ # a pre-build cmd object to the Runner
+ class => ref($self->sietima),
});
}
@@ -79,7 +83,7 @@ Sietima::CmdLine - run Sietima as a command-line application
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -165,7 +169,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/HeaderURI.pm b/lib/Sietima/HeaderURI.pm
index d2acf60..0f6bdd8 100644
--- a/lib/Sietima/HeaderURI.pm
+++ b/lib/Sietima/HeaderURI.pm
@@ -3,12 +3,12 @@ use Moo;
use Sietima::Policy;
use Sietima::Types qw(Address AddressFromStr is_Address);
use Types::Standard qw(Str is_Str ClassName HashRef Optional);
-use Type::Params qw(compile);
+use Type::Params -sigs;
use Types::URI qw(Uri is_Uri);
use Email::Address;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: annotated URI for list headers
@@ -26,10 +26,7 @@ has comment => (
);
-sub _args_from_address {
- my ($address, $query) = @_;
- $query ||= {};
-
+sub _args_from_address($address, $query={}) {
my $uri = URI->new($address->address,'mailto');
$uri->query_form($query->%*);
@@ -44,8 +41,7 @@ sub _args_from_address {
};
}
-around BUILDARGS => sub {
- my ($orig, $class, @args) = @_;
+around BUILDARGS => sub($orig, $class, @args) {
if (@args != 1 or ref($args[0]) eq 'HASH' and $args[0]->{uri}) {
return $class->$orig(@args);
}
@@ -66,21 +62,19 @@ around BUILDARGS => sub {
};
-sub new_from_address {
- state $check = compile(
- ClassName,
+signature_for new_from_address => (
+ method => Str,
+ positional => [
Address->plus_coercions(AddressFromStr),
Optional[HashRef],
- );
- my ($class, $address, $query) = $check->(@_);
-
+ ],
+);
+sub new_from_address($class, $address, $query={}) {
return $class->new(_args_from_address($address,$query));
}
-sub as_header_raw {
- my ($self) = @_;
-
+sub as_header_raw($self) {
my $str = sprintf '<%s>',$self->uri;
if (my $c = $self->comment) {
$str .= sprintf ' (%s)',$c;
@@ -103,7 +97,7 @@ Sietima::HeaderURI - annotated URI for list headers
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -226,7 +220,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/MailStore.pm b/lib/Sietima/MailStore.pm
index b8ace5b..8dda1ea 100644
--- a/lib/Sietima/MailStore.pm
+++ b/lib/Sietima/MailStore.pm
@@ -3,7 +3,7 @@ use Moo::Role;
use Sietima::Policy;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: interface for mail stores
@@ -25,7 +25,7 @@ Sietima::MailStore - interface for mail stores
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 DESCRIPTION
@@ -115,7 +115,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/MailStore/FS.pm b/lib/Sietima/MailStore/FS.pm
index 4046e91..05d6a10 100644
--- a/lib/Sietima/MailStore/FS.pm
+++ b/lib/Sietima/MailStore/FS.pm
@@ -2,13 +2,13 @@ package Sietima::MailStore::FS;
use Moo;
use Sietima::Policy;
use Types::Path::Tiny qw(Dir);
-use Types::Standard qw(Object ArrayRef Str slurpy);
-use Type::Params qw(compile);
+use Types::Standard qw(Object ArrayRef Str Slurpy);
+use Type::Params -sigs;
use Sietima::Types qw(EmailMIME TagName);
use Digest::SHA qw(sha1_hex);
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: filesystem-backed email store
@@ -32,23 +32,31 @@ sub BUILD($self,@) {
}
-sub store($self,$mail,@tags) {
- state $check = compile(Object,EmailMIME,slurpy ArrayRef[TagName]);$check->(@_);
+signature_for store => (
+ method => Object,
+ positional => [
+ EmailMIME,
+ Slurpy[ArrayRef[TagName]],
+ ],
+);
+sub store($self,$mail,$tags) {
my $str = $mail->as_string;
my $id = sha1_hex($str);
$self->_msgdir->child($id)->spew_raw($str);
- $self->_tagdir->child($_)->append("$id\n") for @tags;
+ $self->_tagdir->child($_)->append("$id\n") for $tags->@*;
return $id;
}
+signature_for retrieve_by_id => (
+ method => Object,
+ positional => [ Str ],
+);
sub retrieve_by_id($self,$id) {
- state $check = compile(Object,Str);$check->(@_);
-
my $msg_path = $self->_msgdir->child($id);
return unless -e $msg_path;
return Email::MIME->new($msg_path->slurp_raw);
@@ -61,13 +69,17 @@ sub _tagged_by($self,$tag) {
return $tag_file->lines({chomp=>1});
}
-sub retrieve_ids_by_tags($self,@tags) {
- state $check = compile(Object,slurpy ArrayRef[TagName]);$check->(@_);
-
+signature_for retrieve_ids_by_tags => (
+ method => Object,
+ positional => [
+ Slurpy[ArrayRef[TagName]],
+ ],
+);
+sub retrieve_ids_by_tags($self,$tags) {
# this maps: id -> how many of the given @tags it has
my %msgs;
- if (@tags) {
- for my $tag (@tags) {
+ if ($tags->@*) {
+ for my $tag ($tags->@*) {
$_++ for @msgs{$self->_tagged_by($tag)};
}
}
@@ -79,18 +91,22 @@ sub retrieve_ids_by_tags($self,@tags) {
for my $id (keys %msgs) {
# if this message id does not have all the required tags, we
# won't return it
- next unless $msgs{$id} == @tags;
+ next unless $msgs{$id} == $tags->@*;
push @ret, $id;
}
return \@ret;
}
-sub retrieve_by_tags($self,@tags) {
- state $check = compile(Object,slurpy ArrayRef[TagName]);$check->(@_);
-
+signature_for retrieve_by_tags => (
+ method => Object,
+ positional => [
+ Slurpy[ArrayRef[TagName]],
+ ],
+);
+sub retrieve_by_tags($self,$tags) {
my @ret;
- for my $id ($self->retrieve_ids_by_tags(@tags)->@*) {
+ for my $id ($self->retrieve_ids_by_tags($tags->@*)->@*) {
push @ret, {
id => $id,
mail => $self->retrieve_by_id($id),
@@ -101,9 +117,11 @@ sub retrieve_by_tags($self,@tags) {
}
+signature_for remove => (
+ method => Object,
+ positional => [ Str ],
+);
sub remove($self,$id) {
- state $check = compile(Object,Str);$check->(@_);
-
for my $tag_file ($self->_tagdir->children) {
$tag_file->edit_lines( sub { $_='' if /\A\Q$id\E\n?\z/ } );
}
@@ -132,7 +150,7 @@ Sietima::MailStore::FS - filesystem-backed email store
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -230,7 +248,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Message.pm b/lib/Sietima/Message.pm
index e0efb12..bc2202d 100644
--- a/lib/Sietima/Message.pm
+++ b/lib/Sietima/Message.pm
@@ -10,7 +10,7 @@ use Sietima::Subscriber;
use Email::MIME;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: an email message with an envelope
@@ -64,7 +64,7 @@ Sietima::Message - an email message with an envelope
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -117,7 +117,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Policy.pm b/lib/Sietima/Policy.pm
index 16d66a3..6514b21 100644
--- a/lib/Sietima/Policy.pm
+++ b/lib/Sietima/Policy.pm
@@ -1,11 +1,10 @@
package Sietima::Policy;
-use 5.024;
+use v5.36;
use strict;
use warnings;
-use feature ':5.24';
-use experimental 'signatures';
+use feature ':5.36';
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: pragma for Sietima modules
@@ -14,8 +13,7 @@ sub import {
# so no need for import::into
strict->import;
warnings->import;
- experimental->import('signatures');
- feature->import(':5.24');
+ feature->import(':5.36');
return;
}
@@ -33,7 +31,7 @@ Sietima::Policy - pragma for Sietima modules
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -58,7 +56,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/AvoidDups.pm b/lib/Sietima/Role/AvoidDups.pm
index f75a0a9..4077296 100644
--- a/lib/Sietima/Role/AvoidDups.pm
+++ b/lib/Sietima/Role/AvoidDups.pm
@@ -4,7 +4,7 @@ use Sietima::Policy;
use Email::Address;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: prevent people from receiving the same message multiple times
@@ -39,7 +39,7 @@ Sietima::Role::AvoidDups - prevent people from receiving the same message multip
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -65,7 +65,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/Debounce.pm b/lib/Sietima/Role/Debounce.pm
index df9adc8..7702bb0 100644
--- a/lib/Sietima/Role/Debounce.pm
+++ b/lib/Sietima/Role/Debounce.pm
@@ -3,7 +3,7 @@ use Moo::Role;
use Sietima::Policy;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: avoid mail loops
@@ -36,7 +36,7 @@ Sietima::Role::Debounce - avoid mail loops
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -65,7 +65,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/Headers.pm b/lib/Sietima/Role/Headers.pm
index f209681..f12f2aa 100644
--- a/lib/Sietima/Role/Headers.pm
+++ b/lib/Sietima/Role/Headers.pm
@@ -1,14 +1,12 @@
package Sietima::Role::Headers;
use Moo::Role;
-use Try::Tiny;
use Sietima::Policy;
use Sietima::HeaderURI;
-use Email::Address;
use Types::Standard qw(Str);
use Sietima::Types qw(HeaderUriFromThings);
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: adds standard list-related headers to messages
@@ -89,7 +87,7 @@ Sietima::Role::Headers - adds standard list-related headers to messages
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -174,7 +172,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/ManualSubscription.pm b/lib/Sietima/Role/ManualSubscription.pm
index e5ed6ef..292e8c8 100644
--- a/lib/Sietima/Role/ManualSubscription.pm
+++ b/lib/Sietima/Role/ManualSubscription.pm
@@ -4,7 +4,7 @@ use Sietima::Policy;
use Sietima::HeaderURI;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: adds standard list-related headers to messages
with 'Sietima::Role::WithOwner';
@@ -41,7 +41,7 @@ Sietima::Role::ManualSubscription - adds standard list-related headers to messag
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -74,7 +74,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/NoMail.pm b/lib/Sietima/Role/NoMail.pm
index 0f35eff..5688e31 100644
--- a/lib/Sietima/Role/NoMail.pm
+++ b/lib/Sietima/Role/NoMail.pm
@@ -3,7 +3,7 @@ use Moo::Role;
use Sietima::Policy;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: don't send mail to those who don't want it
@@ -28,7 +28,7 @@ Sietima::Role::NoMail - don't send mail to those who don't want it
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -59,7 +59,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/NoSpoof.pm b/lib/Sietima/Role/NoSpoof.pm
new file mode 100644
index 0000000..f04955b
--- /dev/null
+++ b/lib/Sietima/Role/NoSpoof.pm
@@ -0,0 +1,67 @@
+package Sietima::Role::NoSpoof;
+use Moo::Role;
+use Sietima::Policy;
+use Email::Address;
+use namespace::clean;
+
+our $VERSION = '1.1.0'; # VERSION
+# ABSTRACT: never sends out messages from subscribers' addresses
+
+
+with 'Sietima::Role::WithPostAddress';
+
+around munge_mail => sub ($orig,$self,$incoming_mail) {
+ my $sender = $self->post_address->address;
+ my ($from) = Email::Address->parse($incoming_mail->header_str('From'));
+
+ $from->address($sender);
+
+ $incoming_mail->header_str_set(
+ From => $from,
+ );
+
+ return $self->$orig($incoming_mail);
+};
+
+1;
+
+__END__
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+Sietima::Role::NoSpoof - never sends out messages from subscribers' addresses
+
+=head1 VERSION
+
+version 1.1.0
+
+=head1 SYNOPSIS
+
+ my $sietima = Sietima->with_traits('NoSpoof')->new(\%args);
+
+=head1 DESCRIPTION
+
+A L<< C<Sietima> >> list with this role applied will replace the
+`From` address with its own L<<
+C<post_address>|Sietima::Role::WithPostAddress >> (this is a
+"sub-role" of L<< C<WithPostAddress>|Sietima::Role::WithPostAddress
+>>).
+
+This will make the list DMARC-compliant.
+
+=head1 AUTHOR
+
+Gianni Ceccarelli <dakkar@thenautilus.net>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
diff --git a/lib/Sietima/Role/ReplyTo.pm b/lib/Sietima/Role/ReplyTo.pm
index 7bd6fa4..fc2f5f5 100644
--- a/lib/Sietima/Role/ReplyTo.pm
+++ b/lib/Sietima/Role/ReplyTo.pm
@@ -2,11 +2,10 @@ package Sietima::Role::ReplyTo;
use Moo::Role;
use Sietima::Policy;
use Types::Standard qw(Bool);
-use Sietima::Types qw(Address AddressFromStr);
use List::AllUtils qw(part);
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: munge the C<Reply-To> header
@@ -77,7 +76,7 @@ Sietima::Role::ReplyTo - munge the C<Reply-To> header
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -142,7 +141,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/SubjectTag.pm b/lib/Sietima/Role/SubjectTag.pm
index a913d5a..8b13a11 100644
--- a/lib/Sietima/Role/SubjectTag.pm
+++ b/lib/Sietima/Role/SubjectTag.pm
@@ -4,7 +4,7 @@ use Sietima::Policy;
use Types::Standard qw(Str);
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: add a tag to messages' subjects
@@ -40,7 +40,7 @@ Sietima::Role::SubjectTag - add a tag to messages' subjects
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -80,7 +80,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/SubscriberOnly.pm b/lib/Sietima/Role/SubscriberOnly.pm
index b064fa7..0c08fd2 100644
--- a/lib/Sietima/Role/SubscriberOnly.pm
+++ b/lib/Sietima/Role/SubscriberOnly.pm
@@ -4,10 +4,10 @@ use Sietima::Policy;
use Email::Address;
use List::AllUtils qw(any);
use Types::Standard qw(Object CodeRef);
-use Type::Params qw(compile);
+use Type::Params -sigs;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: base role for "closed" lists
@@ -28,9 +28,11 @@ around munge_mail => sub ($orig,$self,$mail) {
};
+signature_for ignoring_subscriberonly => (
+ method => Object,
+ positional => [ CodeRef ],
+);
sub ignoring_subscriberonly($self,$code) {
- state $check = compile(Object,CodeRef); $check->(@_);
-
local $let_it_pass = 1;
return $code->($self);
}
@@ -49,7 +51,7 @@ Sietima::Role::SubscriberOnly - base role for "closed" lists
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -111,7 +113,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/SubscriberOnly/Drop.pm b/lib/Sietima/Role/SubscriberOnly/Drop.pm
index 41052ce..aa771af 100644
--- a/lib/Sietima/Role/SubscriberOnly/Drop.pm
+++ b/lib/Sietima/Role/SubscriberOnly/Drop.pm
@@ -3,7 +3,7 @@ use Moo::Role;
use Sietima::Policy;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: drop messages from non-subscribers
@@ -26,7 +26,7 @@ Sietima::Role::SubscriberOnly::Drop - drop messages from non-subscribers
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -55,7 +55,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/SubscriberOnly/Moderate.pm b/lib/Sietima/Role/SubscriberOnly/Moderate.pm
index 663d5c1..ba58c5b 100644
--- a/lib/Sietima/Role/SubscriberOnly/Moderate.pm
+++ b/lib/Sietima/Role/SubscriberOnly/Moderate.pm
@@ -2,10 +2,9 @@ package Sietima::Role::SubscriberOnly::Moderate;
use Moo::Role;
use Sietima::Policy;
use Email::Stuffer;
-use Email::MIME;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: moderate messages from non-subscribers
@@ -72,6 +71,16 @@ sub show_mail_from_moderation_queue ($self,$runner,@) {
}
+sub resume_mail_from_moderation_queue ($self,$runner,@) {
+ $self->resume($runner->parameters->{'mail-id'});
+}
+
+
+sub drop_mail_from_moderation_queue ($self,$runner,@) {
+ $self->drop($runner->parameters->{'mail-id'});
+}
+
+
around command_line_spec => sub ($orig,$self) {
my $spec = $self->$orig();
@@ -104,15 +113,11 @@ around command_line_spec => sub ($orig,$self) {
$etc->('show'),
};
$spec->{subcommands}{'resume-held'} = {
- op => sub ($self,$runner,$args) {
- $self->resume($runner->parameters->{'mail-id'});
- },
+ op => 'resume_mail_from_moderation_queue',
$etc->('resume'),
};
$spec->{subcommands}{'drop-held'} = {
- op => sub ($self,$runner,$args) {
- $self->drop($runner->parameters->{'mail-id'});
- },
+ op => 'drop_mail_from_moderation_queue',
$etc->('drop'),
};
@@ -133,7 +138,7 @@ Sietima::Role::SubscriberOnly::Moderate - moderate messages from non-subscribers
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -207,6 +212,27 @@ out|App::Spec::Runner/out> via the L<< C<Sietima::Runner> >> object.
This method is usually invoked from the command line, see L<<
/C<command_line_spec> >>.
+=head2 C<resume_mail_from_moderation_queue>
+
+ $sietima->resume_mail_from_moderation_queue($sietima_runner);
+
+This method L<retrieves the email|Sietima::MailStore/retrieve_by_id>
+of the message requested from the command line, and L<resumes|/resume>
+it.
+
+This method is usually invoked from the command line, see L<<
+/C<command_line_spec> >>.
+
+=head2 C<drop_mail_from_moderation_queue>
+
+ $sietima->drop_mail_from_moderation_queue($sietima_runner);
+
+This method L<retrieves the email|Sietima::MailStore/retrieve_by_id>
+of the message requested from the command line, and L<drops|/drop> it.
+
+This method is usually invoked from the command line, see L<<
+/C<command_line_spec> >>.
+
=head1 MODIFIED METHODS
=head2 C<command_line_spec>
@@ -253,7 +279,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/WithMailStore.pm b/lib/Sietima/Role/WithMailStore.pm
index ec3ce14..ea25486 100644
--- a/lib/Sietima/Role/WithMailStore.pm
+++ b/lib/Sietima/Role/WithMailStore.pm
@@ -4,7 +4,7 @@ use Sietima::Policy;
use Sietima::Types qw(MailStore MailStoreFromHashRef);
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: role for lists with a store for messages
@@ -29,7 +29,7 @@ Sietima::Role::WithMailStore - role for lists with a store for messages
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -65,7 +65,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/WithOwner.pm b/lib/Sietima/Role/WithOwner.pm
index 2373b32..35dc4c4 100644
--- a/lib/Sietima/Role/WithOwner.pm
+++ b/lib/Sietima/Role/WithOwner.pm
@@ -4,7 +4,7 @@ use Sietima::Policy;
use Sietima::Types qw(Address AddressFromStr);
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: role for lists with an owner
@@ -37,7 +37,7 @@ Sietima::Role::WithOwner - role for lists with an owner
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -74,7 +74,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Role/WithPostAddress.pm b/lib/Sietima/Role/WithPostAddress.pm
index 4006a62..4fe9e7d 100644
--- a/lib/Sietima/Role/WithPostAddress.pm
+++ b/lib/Sietima/Role/WithPostAddress.pm
@@ -4,7 +4,7 @@ use Sietima::Policy;
use Sietima::Types qw(Address AddressFromStr);
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: role for lists with a posting address
@@ -36,7 +36,7 @@ Sietima::Role::WithPostAddress - role for lists with a posting address
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 SYNOPSIS
@@ -69,7 +69,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Runner.pm b/lib/Sietima/Runner.pm
index e252307..25be790 100644
--- a/lib/Sietima/Runner.pm
+++ b/lib/Sietima/Runner.pm
@@ -3,7 +3,7 @@ use Moo;
use Sietima::Policy;
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: C<App::Spec::Run> for Sietima
@@ -32,7 +32,7 @@ Sietima::Runner - C<App::Spec::Run> for Sietima
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 DESCRIPTION
@@ -52,7 +52,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Subscriber.pm b/lib/Sietima/Subscriber.pm
index 468080b..c483892 100644
--- a/lib/Sietima/Subscriber.pm
+++ b/lib/Sietima/Subscriber.pm
@@ -2,13 +2,13 @@ package Sietima::Subscriber;
use Moo;
use Sietima::Policy;
use Types::Standard qw(ArrayRef HashRef Object);
-use Type::Params qw(compile);
+use Type::Params -sigs;
use Sietima::Types qw(Address AddressFromStr);
use Email::Address;
use List::AllUtils qw(any);
use namespace::clean;
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: a subscriber to a mailing list
@@ -41,12 +41,11 @@ has prefs => (
);
-sub match {
- # we can't use the sub signature here, because we need the
- # coercion
- state $check = compile(Object,Address->plus_coercions(AddressFromStr));
- my ($self,$addr) = $check->(@_);
-
+signature_for match => (
+ method => Object,
+ positional => [ Address->plus_coercions(AddressFromStr) ],
+);
+sub match($self,$addr) {
return any { $addr->address eq $_->address }
$self->primary, $self->aliases->@*;
}
@@ -66,7 +65,7 @@ Sietima::Subscriber - a subscriber to a mailing list
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 DESCRIPTION
@@ -127,7 +126,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Sietima/Types.pm b/lib/Sietima/Types.pm
index 8273b40..30e69d1 100644
--- a/lib/Sietima/Types.pm
+++ b/lib/Sietima/Types.pm
@@ -13,7 +13,7 @@ use Type::Library
Subscriber SubscriberFromAddress SubscriberFromStr SubscriberFromHashRef
Transport MailStore MailStoreFromHashRef);
-our $VERSION = '1.0.3'; # VERSION
+our $VERSION = '1.1.0'; # VERSION
# ABSTRACT: type library for Sietima
@@ -85,7 +85,7 @@ Sietima::Types - type library for Sietima
=head1 VERSION
-version 1.0.3
+version 1.1.0
=head1 DESCRIPTION
@@ -194,7 +194,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2017 by Gianni Ceccarelli <dakkar@thenautilus.net>.
+This software is copyright (c) 2023 by Gianni Ceccarelli <dakkar@thenautilus.net>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/perlcritic.rc b/perlcritic.rc
index f060909..80ab046 100644
--- a/perlcritic.rc
+++ b/perlcritic.rc
@@ -410,7 +410,7 @@ severity = 1
[ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator]
# Don't use strings like `v1.4' or `1.4.5' when including other modules.
-[ValuesAndExpressions::ProhibitVersionStrings]
+[-ValuesAndExpressions::ProhibitVersionStrings]
# Require $VERSION to be a constant rather than a computed value.
[ValuesAndExpressions::RequireConstantVersion]
diff --git a/t/author-no-tabs.t b/t/author-no-tabs.t
index 169b4c9..8005d5e 100644
--- a/t/author-no-tabs.t
+++ b/t/author-no-tabs.t
@@ -27,6 +27,7 @@ my @files = (
'lib/Sietima/Role/Headers.pm',
'lib/Sietima/Role/ManualSubscription.pm',
'lib/Sietima/Role/NoMail.pm',
+ 'lib/Sietima/Role/NoSpoof.pm',
'lib/Sietima/Role/ReplyTo.pm',
'lib/Sietima/Role/SubjectTag.pm',
'lib/Sietima/Role/SubscriberOnly.pm',
@@ -51,6 +52,7 @@ my @files = (
't/tests/sietima/role/headers.t',
't/tests/sietima/role/manualsubscription.t',
't/tests/sietima/role/nomail.t',
+ 't/tests/sietima/role/nospoof.t',
't/tests/sietima/role/replyto.t',
't/tests/sietima/role/subject-tag.t',
't/tests/sietima/role/subscriberonly/drop.t',
diff --git a/t/author-pod-coverage.t b/t/author-pod-coverage.t
index 243340f..09473df 100644
--- a/t/author-pod-coverage.t
+++ b/t/author-pod-coverage.t
@@ -8,7 +8,8 @@ BEGIN {
}
# This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests.
-
+use strict;
+use warnings;
use Test::Pod::Coverage 1.08;
use Pod::Coverage::TrustPod;
diff --git a/t/lib/Test/Sietima.pm b/t/lib/Test/Sietima.pm
index 79f3b7a..e20aacf 100644
--- a/t/lib/Test/Sietima.pm
+++ b/t/lib/Test/Sietima.pm
@@ -171,7 +171,7 @@ sub run_cmdline_sub($sietima,$method,$options={},$parameters={}) {
cmd => $sietima,
op => $method,
});
- $r->response(App::Spec::Run::Response->new);
+ $r->response(App::Spec::Run::Response->new(buffered=>1));
ok(
lives { $sietima->$method($r) },
"calling $method should live",
diff --git a/t/tests/sietima/role/nospoof.t b/t/tests/sietima/role/nospoof.t
new file mode 100644
index 0000000..6f30635
--- /dev/null
+++ b/t/tests/sietima/role/nospoof.t
@@ -0,0 +1,25 @@
+#!perl
+use lib 't/lib';
+use Test::Sietima;
+
+my $s = make_sietima(
+ with_traits => ['NoSpoof'],
+ subscribers => [
+ 'one@users.example.com',
+ 'two@users.example.com',
+ ],
+);
+
+test_sending(
+ sietima => $s,
+ mail => {
+ from => 'a user <one@users.example.com>',
+ },
+ mails => [
+ object {
+ call [ header_str => 'from' ] => '"a user" <'.$s->return_path->address.'>';
+ },
+ ],
+);
+
+done_testing;