The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Sietima::Role::SubscriberOnly - base role for "closed" lists

VERSION

version 1.1.2

SYNOPSIS

  package Sietima::Role::SubscriberOnly::MyPolicy;
  use Moo::Role;
  use Sietima::Policy;

  sub munge_mail_from_non_subscriber($self,$mail) { ... }

DESCRIPTION

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.

REQUIRED METHODS

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.

METHODS

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.

MODIFIED METHODS

munge_mail

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.

AUTHOR

Gianni Ceccarelli <dakkar@thenautilus.net>

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.