Alceu Rodrigues de Freitas Junior > Test-Reporter-Transport-Outlook > Test::Reporter::Transport::Outlook

Download:
Test-Reporter-Transport-Outlook-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Test::Reporter::Transport::Outlook - MS Outlook as transport for Test::Reporter

SYNOPSIS ^

        use warnings;
        use strict;
        use Test::Reporter;
        use Test::Reporter::Transport::Outlook;

        my $reporter = Test::Reporter->new(
                grade        => 'fail',
                distribution => 'Mail-Freshmeat-1.20',
                from         => 'whoever@wherever.net (Whoever Wherever)',
                comments     => 'output of a failed make test goes here...',
                via          => 'CPANPLUS X.Y.Z',
        );

        my $sender = Test::Reporter::Transport::Outlook->new(0);

        $sender->send($reporter);

DESCRIPTION ^

If you want to test Perl modules for CPAN but is located in a very restricted environment, without HTTP or SMTP access outside the network and can count only with an Outlook and Exchange server to send emails, this module is for you.

This module will use Win32::OLE module with MS Outlook to create a new email message. This message will contain all information regarding the test report and would be ready to be sent if new security patches of Outlook didn't forbid that.

As an alternative, the message can be saved on the "Drafts" (or whatever is called in your computer) or can be displayed so you will only need to click (or review before clicking) the report. Default behavior is to save the email so you can avoid having lot's of new email messages being opened if you're testing real hard new distributions.

Of course, this module expects that you're in a MS Windows machine with MS Outlook installed. This module will not work in other operational systems.

USAGE ^

See Test::Reporter and Test::Reporter::Transport for general usage information.

Transport Arguments

    $report->transport_args( 1 );

See new method to understand this parameter.

METHODS ^

These methods are only for internal use by Test::Reporter.

new

    my $sender = Test::Reporter::Transport::Outlook->new( 0 ); 

The new method is the object constructor.

There is an optional parameter that is related if the email will be saved in the Drafts folder (the default behavior) or displayed to the user executing this module. The valid values are true (1) or false (0) respectivally. Anything else will generate an exception.

To save the message, nothing needs to be passed. To display the message, pass 0 as an argument.

The message will be saved or displayed upon invocation of the method send.

get_outlook

Returns the Mail::Outlook object that represents the MS Outlook application.

send

Display or save the message in the Outlook, depends on the values defined during object creation. See the method new for more details.

Expects as a parameter a Test::Reporter object. Returns true in case of success or false in failure (1 or 0);

CONFIGURATION ^

Test::Reporter::Transport::Outlook can be configured with CPAN::Reporter as described in CPAN::Reporter::Config.

In the config.ini file, include the line

        transport=Outlook

to enable using of Test::Reporter::Transport::Outlook as the method of transport for reports. If you want to create new messages like drafts, nothing else needs to be done. But if you want the messages to pop up before sending them, then it's necessary to disable the default behaviour by using the line

        transport=Outlook 0

in the config.ini file.

CAVEATS ^

Even by saving the messages as drafts, sending lot's of reports by clicking "Send" message by message can be a pain. Due to the security patches on Microsoft Outlook, the only alternative is to use the Redemption DLL to avoid the patches applied by Microsoft and send the messages directly.

Test::Reporter::Transport::Outlook uses Mail::Outlook to create and send emails messages with Outlook. This issue is better documented there.

There is a good change that Redemption DLL may be included in Mail::Outlook distribution and once this is done, then it will be possible to send reports of tests without user intervention.

Another issue is the customized header (X-Reported-Via) used by CPAN::Reporter emails to help the CPAN testers identify which transport was used to send the received report. While sending this header is not a mandatory feature, do not sending it makes the life of CPAN testers more difficult to identify issues. Once again, there is not way to set this header by using only Outlook. To be able to send such header, it's necessary:

1. Redemption DLL using
2. The Exchange server which Outlook will use to send the message must allow the specified header to be sent.

Even if the Redemption DLL is used, there is no guarantee that the message will have the specified header by Outlook side. You will need to check it with your Exchange server administrator to enable that.

SEE ALSO ^

AUTHOR ^

 Alceu Rodrigues de Freitas Junior <arfreitas@cpan.org>.

COPYRIGHT ^

 Copyright (C) 2009 Alceu Rodrigues de Freitas Junior

 All rights reserved.

LICENSE ^

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: