The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::SpamcupNG::Summary - class to summarise SPAM report data

SYNOPSIS

    use App::SpamcupNG::Summary;
    my $summary = App::SpamcupNG::Summary->new;
    $summary->set_age(16);

DESCRIPTION

This class is used internally to store SPAM report data that can latter be saved to generate reports.

This class is also based on Class::Accessor and uses follow_best_practice.

ATTRIBUTES

tracking_id: the SPAM report unique tracking ID.
mailer: the e-mail header X-Mailer, if available. Might be undef.
content_type: the e-mail header Content-Type, if available. Might be undef.
age: the time elapsed since the SPAM e-mail was received.
age_unit: the time elapsed unit since the SPAM e-mail was received.
contacts: an array reference with the "best contacts" found in the report.
receivers: an array reference with App::SpamcupNG::Summary::Receiver instances.

Sometimes the receivers addresses will not real ones, but "counters" that will not be used for the report, but only for Spamcop statistics.

METHODS

new

Creates a new instance. No parameter is required or expected.

as_text

Returns the summary attributes as strings, separated by commas.

If some of attributes are undef, the string not avaialable will be used instead.

tracking_url

Returns the tracking URL of the SPAM report as a string.

to_text

Getter for attributes that returns the value as a string.

If the attribute value is undef, the string return by na() will be used instead.

Expects as parameter the name of the parameter, returns a string.

na

Returns the "not available" string. Can be used as class method.

set_receivers

Setter for the receivers attribute.

Expects as parameter an array reference, with inner array references inside.

Returns "true" (1) if everything goes fine.

SEE ALSO

AUTHOR

Alceu Rodrigues de Freitas Junior, <glasswalk3r@yahoo.com.br>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 of Alceu Rodrigues de Freitas Junior, <glasswalk3r@yahoo.com.br>

This file is part of App-SpamcupNG distribution.

App-SpamcupNG is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

App-SpamcupNG is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with App-SpamcupNG. If not, see <http://www.gnu.org/licenses/>.