Test::Smoke::Mailer - Wrapper to send the report.


Test-Smoke documentation  | view source Contained in the Test-Smoke distribution.

Index


NAME

Top

Test::Smoke::Mailer - Wrapper to send the report.

SYNOPSIS

Top

    use Test::Smoke::Mailer;

    my %args = ( mhowto => 'smtp', mserver => 'smtp.your.domain' );
    my $mailer = Test::Smoke::Mailer->new( $ddir, %args );

    $mailer->mail or die "Problem in mailing: " . $mailer->error;

DESCRIPTION

Top

This little wrapper still allows you to use the sendmail, mail or mailx programs, but prefers to use the Mail::Sendmail module (which comes with this distribution) to send the reports.

METHODS

Top

Test::Smoke::Mailer->new( $mailer[, %args] )

Can we provide sensible defaults for the mail stuff?

    mhowto  => [Module::Name|sendmail|mail|mailx]
    mserver => an SMTP server || localhost
    mbin    => the full path to the mail binary
    mto     => list of addresses (comma separated!)
    mfrom   => single address
    mcc     => list of addresses (coma separated!)

$mailer->fetch_report( )

fetch_report() reads mktest.rpt from {ddir} and return the subject line for the mail-message.

$mailer->error( )

error() returns the value of $mailer->{error}.

$self->_get_cc( $subject )

_get_cc() implements the --ccp5p_onfail option. It looks at the subject to see if the smoke FAILed and then adds the perl5-porters mailing-list to the Cc: field unless it is already part of To: or Cc:.

The new behaviour is to only return Cc: on fail. This is determined by the new global regex kept in $Test::Smoke::Mailer::NOCC_RE.

Test::Smoke::Mailer->config( $key[, $value] )

config() is an interface to the package lexical %CONFIG, which holds all the default values for the new() arguments.

With the special key all_defaults this returns a reference to a hash holding all the default values.

Test::Smoke::Mailer::Sendmail

Top

This handles sending the message by piping it to the sendmail program.

Test::Smoke::Mailer::Sendmail->new( %args )

Keys for %args:

  * ddir
  * sendmailbin
  * to
  * from
  * cc
  * v

$mailer->mail( )

mail() sets up a header and body and pipes them to the sendmail program.

Test::Smoke::Mailer::Mail_X

Top

This handles sending the message with either the mail or mailx program.

Test::Smoke::Mailer::Mail_X->new( %args )

Keys for %args:

  * ddir
  * mailbin/mailxbin
  * to
  * cc
  * v

$mailer->mail( )

mail() sets up the commandline and body and pipes it to either the mail or the mailx program.

Test::Smoke::Mailer::Mail_Sendmail

Top

This handles sending the message using the Mail::Sendmail module.

Test::Smoke::Mailer::Mail_Sendmail->new( %args )

Keys for %args:

  * ddir
  * mserver
  * to
  * from
  * cc
  * v

$mailer->mail( )

mail() sets up the message to be send by Mail::Sendmail.

Test::Smoke::Mailer::MIME_Lite

Top

This handles sending the message using the MIME::Lite module.

Test::Smoke::Mailer::MIME_Lite->new( %args )

Keys for %args:

  * ddir
  * mserver
  * to
  * from
  * cc
  * v

$mailer->mail( )

mail() sets up the message to be send by MIME::Lite.

COPYRIGHT

Top


Test-Smoke documentation  | view source Contained in the Test-Smoke distribution.