Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

nnml2mbox

by mikeirw (Pilgrim)
on Jun 11, 2002 at 15:45 UTC ( [id://173524]=sourcecode: print w/replies, xml ) Need Help??
Category: Utility Scripts
Author/Contact Info Mike Irwin - mikeirw@pobox.com
Description:

I needed to view the contents of a nnml mail directory, but didn't have access to Emacs or Gnus, so I whipped up this simple script to allow me to use mail -f instead. I must say that I'm a Perl newbie, so it may need some work. If so, I'll appreciate any comments.

A quick note: I did not include any code to match Gcc'ed emails (which doesn't generate a From header), so you may need to add that before running.

#!/usr/bin/perl -w
#
# Turn a Gnus nnml file into mbox format.  Prints to STDOUT.
# Usage: nnml2mbox files ...

use strict;
use File::Find;

my @nnml_files;
find sub {
    push @nnml_files, $File::Find::name
      if /^\d+/;
}, @ARGV;
@ARGV = @nnml_files;
while (<>) {
    s/^X-From-Line:/\nFrom/;
    print;
}
Replies are listed 'Best First'.
Re: nnml2mbox
by fundflow (Chaplain) on Jun 15, 2002 at 09:57 UTC
    Just to be on the safe side, you might do the following change:
    s/^X-From-Line:/\nFrom/;
      Good suggestion, fundflow. I went ahead and updated the code.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: sourcecode [id://173524]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2025-12-09 17:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (90 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.