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



Annotate this POD

View/Report Bugs
Module Version: 0.05   Source  


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


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',
    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.


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.



Mail::Header object with the message headers.


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):


Kirill Miazine <>


Copyright 2009 Kirill Miazine.

This software is distributed under an ISC style license, please see <> for details.

syntax highlighting: