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

NAME

CPAN::Testers::WWW::Reports::Mailer - CPAN Testers Reports Mailer

SYNOPSIS

  use CPAN::Testers::WWW::Reports::Mailer;

  my $mailer = CPAN::Testers::WWW::Reports::Mailer->new(
    config => 'myconfig.ini'
  );

  $mailer->check_reports();
  $mailer->check_counts();

DESCRIPTION

The CPAN Testers Reports Mailer takes the preferences set within the CPANPREFS database, and uses them to filter out reports that the author does or does not wish to be made aware of.

New authors are added to the system as a report for their first reported distribution is submitted by a tester. Default settings are applied in the first instance, with the author able to update these via the preferences website.

Initially only a Daily Summary Report is available, in time a Weekly Summary Report and the individual reports will also be available.

CONFIGURATION

Configuration for this application can occur via the command line, the API and the configuration file. Of them all, only the configuration file is required.

The configuration file should be in the INI style, with the section CPANPREFS describing the associated database access required. The general settings section, SETTINGS, is optional, and can be overridden by the command line and the API arguments.

Database Configuration

The CPANPREFS section is required, and should contain the following key/value pairs to describe access to the specific database.

  • driver

  • database

  • dbhost

  • dbport

  • dbuser

  • dbpass

Only 'driver' and 'database' are required for an SQLite database, while the other key/values may need to be completed for other databases.

It is now assumed that only one database connection is require, with other databases held within the same database application. The primary connection must be to the CPAN Preferences databases. The other databases, CPAN Statistics, Articles and Metabase

General Configuration

The following options are available, in the configuration file, on the command line and via the API call to new() as a hash.

  • mode

    Processing mode required. This can be one of three values, 'daily', 'weekly' or 'reports'. 'daily' and 'weekly' create the mails for the Daily Summary and Weekly Summary reports respectively. 'reports' creates individual report mails for authors.

  • verbose

    If set to a true value, will print additional log messages.

  • nomail

    By default this is set to 1, to avoid accidentally running and sending lots of mails :) Set to 0 to allow normal processing.

  • test

    If used, must be set to a single NNTPID, which will then be tested in isolation for the currently set mode. Automatically sets the nomail flag to true.

  • lastmail

    The location of the counter file, that stores the ids of the last reports processed.

  • mailrc

    The location of the 01mailrc.txt file stored locally. By default the location is assumed to be 'data/01mailrc.txt'. If the confirguration is not set, or the file cannot be found, it will be dynamically downloaded from CPAN.

  • logfile

    The location of the logfile. If not provided, logging is disabled.

  • logclean

    By default this is set to 0, append to existing log. If set to 1, will create a new log or overwrite any existing log, on the first call to log a message, then will automatically reset to 0, so as to append any further messages.

INTERFACE

The Constructor

  • new

    Instatiates the object CPAN::WWW::Testers. Requires a hash of parameters, with 'config' being the only mandatory key. Note that 'config' can be anything that Config::IniFiles accepts for the -file option.

Public Methods

  • check_reports

    The core method that analyses the reports and constructs the mails.

  • check_counts

    Prints a summary of the processing.

  • help

    Using the command line option, --help or -h, displays a help screen with instructions of the command line arguments. See the Configuration section for further details.

Accessor Methods

  • lastfile

    Path to the file containing the last NNTPID processed.

  • verbose

    Provides the current verbose configuration setting.

  • nomail

    Provides the current nomail configuration setting.

  • test

    Provides a single test ID, if not all NNTPIDs need testing.

  • logfile

    Path to output log file for progress and debugging messages.

  • logclean

    If set to a true value will create/overwrite the logfile, otherwise will append any messages.

  • mode

    Provides the current mode being executed.

  • mailrc

    Path to the 01mailrc.txt file.

  • tt

    Provides the Template Toolkit object.

  • pause

    Provides the Parse::CPAN::Authors object.

Internal Methods

  • _get_lastid

    Returns the last NNTPID processed for the current mode.

  • _set_lastid

    Sets the given NNTPID for the current mode.

  • _get_author

    Returns the author of a given distribution/version.

  • _get_prefs

    Returns the author preferences.

  • _parse_prefs

    Parse a preferences record and returns a hash instance.

  • _send_report

    Repackages a report as an email for an individual author.

  • _write_mail

    Composes and sends a mail message.

  • _emaildate

    Returns an RFC 2822 compliant formatted date string.

  • _download_mailrc

    Downloads and/or reads a copy of the 01mailrc.txt file.

SEE ALSO

CPAN::Testers::Data::Generator CPAN::Testers::WWW::Statistics

http://prefs.cpantesters.org/, http://www.cpantesters.org/, http://stats.cpantesters.org/, http://wiki.cpantesters.org/, http://blog.cpantesters.org/

BUGS, PATCHES & FIXES

There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties, that is not explained within the POD documentation, please send bug reports and patches to the RT Queue (see below).

Fixes are dependent upon their severity and my availability. Should a fix not be forthcoming, please feel free to (politely) remind me.

RT Queue - http://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Testers-WWW-Reports-Mailer

CPAN TESTERS FUND

CPAN Testers wouldn't exist without the help and support of the Perl community. However, since 2008 CPAN Testers has grown far beyond the expectations of it's original creators. As a consequence it now requires considerable funding to help support the infrastructure.

In early 2012 the Enlightened Perl Organisation very kindly set-up a CPAN Testers Fund within their donatation structure, to help the project cover the costs of servers and services.

If you would like to donate to the CPAN Testers Fund, please follow the link below to the Enlightened Perl Organisation's donation site.

https://members.enlightenedperl.org/drupal/donate-cpan-testers

If your company would like to support us, you can donate financially via the fund link above, or if you have servers or services that we might use, please send an email to admin@cpantesters.org with details.

Our full list of current sponsors can be found at our I <3 CPAN Testers site.

http://iheart.cpantesters.org

AUTHOR

Barbie, <barbie@missbarbell.co.uk> for Miss Barbell Productions, http://www.missbarbell.co.uk/

COPYRIGHT & LICENSE

  Copyright (C) 2008-2016 Barbie for Miss Barbell Productions.

  This distribution is free software; you can redistribute it and/or
  modify it under the Artistic Licence v2.