preserving "From " lines in mail messages
Mark Senn <[email protected]> Sat, 04 Dec 2004 23:03:54 -0500
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <[email protected]> |
Below is a "e.pl" program listing, "mail99" test input file,
and the output from running the program. Everything works
as expected except the first line of the mail messages,
the "From " lines, are not preserved. In the mail message
below the "From " lines may be prefixed with a ">", those
">" characters aren't in the test file. What do I need to
do to preserve the "From " lines? (I looked and didn't
notice the answer in the documentation---sorry if I missed
it.) Thanks. Mark Senn
1 % cat e.pl
#!/usr/local/bin/perl
use Mail::Box::Manager;
my $mgr = Mail::Box::Manager->new;
my $folder = $mgr->open(folder => $ARGV[0]);
foreach $msg ($folder->messages) {
print $msg->head;
print $msg->body;
print "============================== divider ==============================\n";
}
2 % cat mail99
From [email protected] Tue Nov 30 16:21:02 2004
X-Envelope-From: [email protected]
This is the first message.
From [email protected] Tue Nov 30 17:23:39 2004
X-Envelope-From: [email protected]
Date: Tue, 30 Nov 2004 17:22:58 -0500
From: Sun Expert Exchange <[email protected]>
Subject: Register Today: Sun Cluster: What Can it Make Available Now?
To: [email protected]
This is the second message.
3 % e.pl mail99
X-Envelope-From: [email protected]
This is the first message.
============================== divider ==============================
X-Envelope-From: [email protected]
Date: Tue, 30 Nov 2004 17:22:58 -0500
From: Sun Expert Exchange <[email protected]>
Subject: Register Today: Sun Cluster: What Can it Make Available Now?
To: [email protected]
This is the second message.
============================== divider ==============================
4 % ^D