Re: Writing the 'From ' line
Mark Overmeer <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Organization | MARKOV Solutions |
| Message-ID | <[email protected]> |
* Bill Moseley ([email protected]) [040118 01:41]: > My goal is to get a mbox file with the messages sorted by > $msg->timestamp. > > I'm reading message from one mailbox, sorting by $msg->timestamp, and > adding the messages to an outbox with: > > $outbox->addMessage( $message ); > > But the resulting mbox file is not is the same order as I add the > messages. Mail::Box is *not* changing the order of the messages, so this cannot be true. The only thing is that I can think of, is that you have double message-Ids, because than one of both will not be written, which may give you an order you do not expect. Have you removed the destination folder before you add the messages to it? There is a difference between file-open-write and mailbox-open-write: the latter does not clear the opened item. > So, I thought about writing the mbox manually using > > $message->write; > > so the output would include the 'From ', but it's not being output. > How do I get the 'From ' line included in the message output? If your message is a Mail::Box::Mbox::Message it will, but other folder types do not use that line. -- MarkOv ------------------------------------------------------------------------ drs Mark A.C.J. Overmeer MARKOV Solutions [email protected] [email protected] http://Mark.Overmeer.net http://solutions.overmeer.net