Кирилл Мязин > Exim-SpoolMessage > Exim::SpoolMessage

Download:
Exim-SpoolMessage-0.04.tgz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Exim::SpoolMessage - Read and parse Exim spool files.

SYNOPSIS ^

Exim::SpoolMessage provides access to the messages stored in Exim's spool directory.

The format of the Exim spool files is described in section 53 of the Exim specification document.

    use Exim::SpoolMessage;

    my $msg = Exim::SpoolMessage->load('/var/spool/exim/input',
                                       '1N4toN-000G2Z-6M');
    print "Return-path: <", $msg->return_path, ">\n";
    print $msg->head->as_string(), "\n", @{$msg->body};

The module was written in order to be able to provide external commands access to the contents of the message during message filtering process.

CONSTRUCTOR ^

Exim::SpoolMessage->load($input_dir, $message_id)

Takes to parameters - location of the input directory where spool files are located and the message id of the desired message.

NOTE: $input_dir has to be location of the directory where spool files are located. If split_spool_directory it will not equal to the spool directory.

Returns an object with a lot of methods, please see below for details.

The constructor croaks on errors.

METHODS ^

$msg->head

Mail::Header object with the message headers.

$msg->body

Reference to an array with the contents of the message body. Each item represents a line of the body.

Other methods

In addition, there are many other mehotds that will provide access to various details related to the message. Please consult the Exim documentation.

Available methods (not all may be present and there may be other as well):

AUTHOR ^

Kirill Miazine <km@krot.org>

COPYRIGHT & LICENSE ^

Copyright 2009 Kirill Miazine.

This software is distributed under an ISC style license, please see <http://km.krot.org/code/license.txt> for details.

syntax highlighting: