Sietima

 view release on metacpan or  search on metacpan

lib/Sietima.pm  view on Meta::CPAN

=item L<< C<NoSpoof>|Sietima::Role::NoSpoof >>

replaces the C<From> address with the list's own address

=item L<< C<NoSpoof::DMARC>|Sietima::Role::NoSpoof::DMARC >>

replaces the C<From> address with the list's own address, if the
sender's domain requires it

=item L<< C<ReplyTo>|Sietima::Role::ReplyTo >>

optionally sets the C<Reply-To> header to the mailing list address

=item L<< C<StripHeaders>|Sietima::Role::StripHeaders >>

removes some headers from all messages

=item L<< C<SubjectTag>|Sietima::Role::SubjectTag >>

prepends a C<[tag]> to the subject header of outgoing messages that
aren't already tagged

=item L<< C<SubscriberOnly::Drop>|Sietima::Role::SubscriberOnly::Drop >>

silently drops all messages coming from addresses not subscribed to
the list

=item L<< C<SubscriberOnly::Moderate>|Sietima::Role::SubscriberOnly::Moderate >>

holds messages coming from addresses not subscribed to the list for
moderation, and provides commands to manage the moderation queue

=back

The only "configuration mechanism" currently supported is to
initialise a C<Sietima> object in your driver script, passing all the
needed values to the constructor. L<< C<Sietima::CmdLine> >> is the
recommended way of doing that: it adds command-line parsing capability
to Sietima.

=head1 ATTRIBUTES

=head2 C<return_path>

A L<< C<Email::Address> >> instance, coerced from string if
necessary. This is the address that Sietima will send messages
I<from>.

=head2 C<subscribers>

An array-ref of L<< C<Sietima::Subscriber> >> objects, defaults to the
empty array.

Each item can be coerced from a string or a L<< C<Email::Address> >>
instance, or a hashref of the form

  { primary => $string, %other_attributes }

The base Sietima class only uses the address of subscribers, but some
roles use the other attributes (L<< C<NoMail>|Sietima::Role::NoMail
>>, for example, uses the C<prefs> attribute, and L<<
C<SubscriberOnly> >> uses C<aliases> via L<<
C<match>|Sietima::Subscriber/match >>)

=head2 C<transport>

A L<< C<Email::Sender::Transport> >> instance, which will be used to
send messages. If not passed in, Sietima uses L<<
C<Email::Sender::Simple> >>'s L<<
C<default_transport>|Email::Sender::Simple/default_transport >>.

=head1 METHODS

=head2 C<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 L<< C<Email::MIME> >> object out of the standard input,
then pass it to L<< /C<handle_mail> >> for processing.

=head2 C<handle_mail>

  $sietima->handle_mail($email_mime);

Main driver method: converts the given email message into a list of
L<< C<Sietima::Message> >> objects by calling L<< /C<munge_mail> >>,
then sends each of them by calling L<< /C<send_message> >>.

=head2 C<subscribers_to_send_to>

  my $subscribers_aref = $sietima->subscribers_to_send_to($email_mime);

Returns an array-ref of L<< C<Sietima::Subscriber> >> objects that
should receive copies of the given email message.

In this base class, it just returns the value of the L<<
/C<subscribers> >> attribute. Roles such as L<<
C<AvoidDups>|Sietima::Role::AvoidDups >> modify this method to exclude
some subscribers.

=head2 C<munge_mail>

  my @messages = $sietima->munge_mail($email_mime);

Returns a list of L<< C<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 L<< /C<subscribers_to_send_to> >>, containing exactly the given
email message.

Roles such as L<< C<SubjectTag>|Sietima::Role::SubjectTag >> modify
this method to alter the message.

=head2 C<send_message>

  $sietima->send_message($sietima_message);

Sends the given L<< C<Sietima::Message> >> object via the L<<
/C<transport> >>, but only if the message's



( run in 1.957 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )