See METHODS in Mail::Reporter
Messages in file-based folders use the following options for creation:
Option | Defined in | Default |
---|---|---|
body | Mail::Message | undef |
body_type | Mail::Box::Message | <from folder> |
deleted | Mail::Message | <false> |
field_type | Mail::Message | undef |
folder | Mail::Box::Message | <required> |
from_line | undef | |
head | Mail::Message | undef |
head_type | Mail::Message | |
labels | Mail::Message | {} |
log | Mail::Reporter |
|
messageId | Mail::Message | undef |
modified | Mail::Message | <false> |
size | Mail::Box::Message | undef |
trace | Mail::Reporter |
|
trusted | Mail::Message | <false> |
Mbox folders contain multiple messages in one file, using a separator line to keep them apart. Typically, these lines start with "From ". Lines within the message could interfere with this separator, and should therefore be translated.
This method will return the escaped text of the body as reference.
Many people detest file-style folders because they store messages all in
one file, where a line starting with From
leads the header. If we
receive a message from a file-based folder, we store that line. If we write
to such a file, but there is no such line stored, then we try to generate
one.
If LINE is provided, then the starting line is set to this value.
Write one message to a file handle. It is the message including the leading 'From ' line and trailing blank. The From-line may interfere with lines in the body: those lines are escaped with an extra '>'.
$msg->write(\*FILE); # print the message with encaps to FILE $msg->write; # message with encaps to selected filehandle $msg->print(\*FILE); # the message without encaps.
Returns the location of the whole message including the from-line. In LIST context, both begin and end are returned. In SCALAR context, only the begin is passed back.
The message is relocated in the file, being moved over DISTANCE bytes. Setting a new location will update the according information in the header and body.
Read one message from a Mail::Box::File based folder, including the leading message separator.