procmail
[Top] [All Lists]

Re: Backup in mbox format?

2000-01-17 21:23:02
At 19:55 +0100 17 Jan 2000, Morten Bo Johansen <mojo(_at_)image(_dot_)dk> wrote:
Aaron Schrab <aaron+procmail(_at_)schrab(_dot_)com> said:

Do you definitely want to use mbox format, or do you just want it in a
format that your mailer supports?  As has already been said mbox doesn't
work too well for this type of thing, but mutt supports MH folders.  To
get it to recognize your backup as a MH folder, just create a
.mh_sequences file in your backup directory:

How is this supposed to work..? Following your instructions above leave me
with an emty index. Without the .mh_sequnces file the index looks like this.

1   ../
2   msg.-iE
3   msg.OgE
[..]

Ahh, that's not in MH format.  In MH format, the file names contain only
digits.  I don't use MH mailboxes, so I forgot that procmail will only
use MH format if the folder name ends in "/." (without the quotes):

  :0
  backup/.

To convert your current directory to a real MH mailbox you can use a
script like (untested, but it should work):

#/usr/bin/perl
# run from inside the backup directory
opendir D, '.' or die;
$i = 100;
# Assuming there aren't any files with valid MH formatted names,
# starting at 100 should prevent us from overwriting any messages that
# get delivered while the script is running
foreach (readdir D) {
  next if /^\./; skip dotfiles
  rename $_, $i++;
}

-- 
Aaron Schrab     aaron(_at_)schrab(_dot_)com      http://www.execpc.com/~aarons/
 A debugged program is one for which you have not yet found the
 conditions that make it fail.  -- Jerry Ogdin

<Prev in Thread] Current Thread [Next in Thread>