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

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

  • $msg->message_id

  • $msg->caller_name

  • $msg->caller_uid

  • $msg->caller_gid

  • $msg->return_path

  • $msg->time_received

  • $msg->warning_count

  • $msg->aclc*

  • $msg->aclm*

  • $msg->opt_active_hostname

  • $msg->opt_allow_unqualified_recipient

  • $msg->opt_allow_unqualified_sender

  • $msg->opt_auth_id

  • $msg->opt_auth_sender

  • $msg->opt_body_linecount

  • $msg->opt_body_zerocount

  • $msg->opt_deliver_firsttime

  • $msg->opt_frozen

  • $msg->opt_helo_name

  • $msg->opt_host_address

  • $msg->opt_host_auth

  • $msg->opt_host_lookup_failed

  • $msg->opt_host_name

  • $msg->opt_ident

  • $msg->opt_interface_address

  • $msg->opt_local

  • $msg->opt_localerror

  • $msg->opt_local_scan

  • $msg->opt_manual_thaw

  • $msg->opt_received_protocol

  • $msg->opt_sender_set_untrusted

  • $msg->opt_spam_score_int

  • $msg->opt_tls_certificate_verified

  • $msg->opt_tls_cipher

  • $msg->opt_tls_peerdn

  • $msg->recipients

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.