Sietima::Role::SubscriberOnly - base role for "closed" lists
version 1.1.2
package Sietima::Role::SubscriberOnly::MyPolicy; use Moo::Role; use Sietima::Policy; sub munge_mail_from_non_subscriber($self,$mail) { ... }
This is a base role; in other words, it's not useable directly.
This role should be used when defining policies for "closed" lists: lists that accept messages from subscribers, but do something special with messages from non-subscribers.
See Sietima::Role::SubscriberOnly::Drop and Sietima::Role::SubscriberOnly::Moderate for useable roles.
Sietima::Role::SubscriberOnly::Drop
Sietima::Role::SubscriberOnly::Moderate
munge_mail_from_non_subscriber
sub munge_mail_from_non_subscriber($self,$mail) { ... }
This method will be invoked from munge_mail whenever an email is processed that does not come from one of the list's subscribers. This method should return a (possibly empty) list of Sietima::Message objects, just like munge_mail, for example to forward the email to the owner of the list. It can also have side-effects, like storing a copy of the message to approve later.
munge_mail
Sietima::Message
ignoring_subscriberonly
$sietima->ignoring_subscriberonly(sub($s) { $s->handle_mail($mail); });
This method provides a way to run Sietima ignoring the "subscriber only" beaviour. Your coderef will be passed a Sietima object that will behave exactly as the invocant of this method, minus this role's modifications.
If the incoming email's From: header contains an address that matches any of the subscribers, the email is processed normally. Otherwise, "munge_mail_from_non_subscriber" is invoked.
From:
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.
To install Sietima, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sietima
CPAN shell
perl -MCPAN -e shell install Sietima
For more information on module installation, please visit the detailed CPAN module installation guide.