Email::Simple::Test::TraceHeaders - generate sample trace headers for testing
version 0.091702
my $header_strings = Email::Simple::Test::TraceHeaders->trace_headers(\%arg);
This returns an arrayref of "Received" header strings.
At present, all headers are produced in Postfix style.
At present the only valid argument is hops, which is an arrayref of hashrefs describing hops. Each hashref should have the following entries:
hops
from_helo - the hostname given in the sending host's HELO from_rdns - the hostname found by looking up the PTR for the sender's ip from_ip - the IP addr of the sending host by_name - the hostname of the receiving host queue_id - the id of the mail queue entry created upon receipt env_to - the recipient of the message (an email addr) time - the timestamp on the header
At present, these are all required. In the future they may have more flexible semantics, and more formats for output of hops may be supported.
my $email_simple = Email::Simple::Test::TraceHeaders->create_email( \%trace_arg );
This creates and returns an Email::Simple message with trace headers created by "trace_headers".
"trace_headers"
Some routines can be exported to make it easier to set up trace headers.
You can get them all with:
use Email::Simple::Test::TraceHeaders -helpers;
This helper gets a value from the previous hop. So, given these hops:
{ ..., by_name => 'mx.example.com', ... }, { ..., from_rdns => prev('by_name'), ... },
...the second hop will have mx.example.com as its from_rdns parameter.
from_rdns
Ricardo Signes <rjbs@cpan.org>
This software is copyright (c) 2013 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Email::Simple::Test::TraceHeaders, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Email::Simple::Test::TraceHeaders
CPAN shell
perl -MCPAN -e shell install Email::Simple::Test::TraceHeaders
For more information on module installation, please visit the detailed CPAN module installation guide.