Sietima - minimal mailing list manager
version 1.0.0
use Sietima; Sietima->new({ return_path => 'the-list@the-domain.tld', subscribers => [ 'person@some.were', @etc ], })->handle_mail_from_stdin;
Sietima is a minimal mailing list manager written in modern Perl. It aims to be the spiritual successor of Siesta.
The base Sietima class does very little: it just puts the email message from STDIN into a new envelope using "return_path" as sender and all the "subscribers" addresses as recipients, and sends it.
Sietima
STDIN
return_path
subscribers
Additional behaviour is provided via traits / roles. This class consumes MooX::Traits to simplify composing roles:
MooX::Traits
Sietima->with_traits(qw(AvoidDups NoMail))->new(\%args);
These are the traits provided with the default distribution:
AvoidDups
prevents the sender from receiving copies of their own messages
Debounce
avoids mail-loops using a X-Been-There header
X-Been-There
Headers
adds List-* headers to all outgoing messages
List-*
ManualSubscription
specifies that to (un)subscribe, people should write to the list owner
NoMail
avoids sending messages to subscribers who don't want them
ReplyTo
optionally sets the Reply-To header to the mailing list address
Reply-To
SubjectTag
prepends a [tag] to the subject header of outgoing messages that aren't already tagged
[tag]
SubscriberOnly::Drop
silently drops all messages coming from addresses not subscribed to the list
SubscriberOnly::Moderate
holds messages coming from addresses not subscribed to the list for moderation, and provides commands to manage the moderation queue
The only "configuration mechanism" currently supported is to initialise a Sietima object in your driver script, passing all the needed values to the constructor. Sietima::CmdLine is the recommended way of doing that: it adds command-line parsing capability to Sietima.
Sietima::CmdLine
A Email::Address instance, coerced from string if necessary. This is the address that Sietima will send messages from.
Email::Address
An array-ref of Sietima::Subscriber objects, defaults to the empty array.
Sietima::Subscriber
Each item can be coerced from a string or a Email::Address instance, or a hashref of the form
{ address => $string, %other_attributes }
The base Sietima class only uses the address of subscribers, but some roles use the other attributes (NoMail, for example, uses the prefs attribute, and SubscriberOnly uses aliases via match)
prefs
SubscriberOnly
aliases
match
transport
A Email::Sender::Transport instance, which will be used to send messages. If not passed in, Sietima uses Email::Sender::Simple's default_transport.
Email::Sender::Transport
Email::Sender::Simple
default_transport
handle_mail_from_stdin
$sietima->handle_mail_from_stdin();
This is the main entry-point when Sietima is invoked from a MTA. It will parse a Email::MIME object out of the standard input, then pass it to "handle_mail" for processing.
Email::MIME
handle_mail
$sietima->handle_mail($email_mime);
Main driver method: converts the given email message into a list of Sietima::Message objects by calling "munge_mail", then sends each of them by calling "send_message".
Sietima::Message
munge_mail
send_message
subscribers_to_send_to
my $subscribers_aref = $sietima->subscribers_to_send_to($email_mime);
Returns an array-ref of Sietima::Subscriber objects that should receive copies of the given email message.
In this base class, it just returns the value of the "subscribers" attribute. Roles such as AvoidDups modify this method to exclude some subscribers.
my @messages = $sietima->munge_mail($email_mime);
Returns a list of Sietima::Message objects representing the messages to send to subscribers, based on the given email message.
In this base class, this method returns a single instance to send to all "subscribers_to_send_to", containing exactly the given email message.
Roles such as SubjectTag modify this method to alter the message.
$sietima->send_message($sietima_message);
Sends the given Sietima::Message object via the "transport", but only if the message's envelope specifies some recipients.
list_addresses
my $addresses_href = $sietima->list_addresses;
Returns a hashref of Email::Address instances or strings, that declare various addresses related to this list.
This base class declares only the "return_path", and does not use this method at all.
The Headers role uses this to populate the various List-* headers.
command_line_spec
my $app_spec_data = $sietima->command_line_spec;
Returns a hashref describing the command line processing for App::Spec. Sietima::CmdLine uses this to build the command line parser.
App::Spec
This base class declares a single sub-command:
send
Invokes the "handle_mail_from_stdin" method.
For example, in a .qmail file:
.qmail
|/path/to/sietima send
Roles can extend this to provide additional sub-commands and options.
Gianni Ceccarelli <dakkar@thenautilus.net>
This software is copyright (c) 2017 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.