hack to split huge mbx-format mail spool files?

hack to split huge mbx-format mail spool files?

Post by Bruce Hamilto » Sat, 12 Aug 2000 04:00:00



Is there a hack available somewhere to split huge (tens or hundreds of
MB) mbx-format mailboxes such as sendmail creates in /var/mail/? I've
done a Google search and looked at a few things at http://www.ugu.com/
but I haven't found anything useful.

It would need to be smart enough to handle large MIME-encoded
attachments.

Thanks,

--Bruce (Bruce Hamilton, Redondo Beach, CA)

http://home.earthlink.net/~bhami/

 
 
 

hack to split huge mbx-format mail spool files?

Post by Ken Pizzi » Mon, 14 Aug 2000 04:00:00



>Is there a hack available somewhere to split huge (tens or hundreds of
>MB) mbx-format mailboxes such as sendmail creates in /var/mail/? I've
>done a Google search and looked at a few things at http://www.ugu.com/
>but I haven't found anything useful.

perl -pe 'BEGIN {$out="aaaa";}
          if (/^From /) {
            open(STDOUT, "> $out") || die "cannot open $out: $!\n";
            ++$out;
          }' /var/mail/my_big_mailbox

                --Ken Pizzini

 
 
 

hack to split huge mbx-format mail spool files?

Post by Gerald Pfeif » Tue, 22 Aug 2000 04:00:00



Quote:>          if (/^From /) {

No, NO, NOO! This certainly is not an appropriate way to separate mbox
messages.

formail, which is part of the procmail package, does this properly.
Recommended.

Gerald

 
 
 

hack to split huge mbx-format mail spool files?

Post by Ken Pizzi » Wed, 23 Aug 2000 04:00:00




>>          if (/^From /) {

>No, NO, NOO! This certainly is not an appropriate way to separate mbox
>messages.

Would you care to elaborate on that?  When does this fail with mbox format?

Quote:>formail, which is part of the procmail package, does this properly.
>Recommended.

Yes, that is definitely a better tool for the job.

                --Ken Pizzini

 
 
 

hack to split huge mbx-format mail spool files?

Post by Janne Johansso » Wed, 23 Aug 2000 04:00:00



> >>          if (/^From /) {

> >No, NO, NOO! This certainly is not an appropriate way to separate mbox
> >messages.

> Would you care to elaborate on that?  When does this fail with mbox format?

I had exactly this problem, ran that script, and it did fine for me.
This doesn't mean there can't be problems, but to move a
pop3-leave-mail-on-server users mbox from /var/mail to the new
cyrus-imap system, it worked like a charm.

Your mailage may vary. ;-)

--
"Surfa inte p? internet - Var en del av v?gen." -Lars Aronsson Aug-94.

Http://www.it.kth.se/~jj

 
 
 

hack to split huge mbx-format mail spool files?

Post by Chuck Swige » Wed, 23 Aug 2000 04:00:00




>> No, NO, NOO! This certainly is not an appropriate way to separate mbox
>> messages.

> Would you care to elaborate on that?  When does this fail with mbox format?

Some people use the word 'From' at the start of a line.

-Chuck


        -------------+-------------------+--------------------
        "Pavlovian slaver at the cash till ring of success..."

 
 
 

hack to split huge mbx-format mail spool files?

Post by Ken Pizzi » Thu, 24 Aug 2000 14:35:17





>>> No, NO, NOO! This certainly is not an appropriate way to separate mbox
>>> messages.

>> Would you care to elaborate on that?  When does this fail with mbox format?

>Some people use the word 'From' at the start of a line.

Yes, and mbox format requires that this be munged; historically
a > was inserted at the beginning of such lines, though I think
a space would have been a better choice.

                --Ken Pizzini

 
 
 

hack to split huge mbx-format mail spool files?

Post by Chuck Swige » Thu, 24 Aug 2000 04:00:00



[ ... ]

Quote:>>Some people use the word 'From' at the start of a line.

> Yes, and mbox format requires that this be munged; historically
> a > was inserted at the beginning of such lines, though I think
> a space would have been a better choice.

Really?  Under Solaris 2.6:

% cat /var/mail/chuck
From chuck Wed Aug 23 12:55:28 2000

        by bjork.codefab.com (8.11.0/8.11.0) id e7NGtRH15063
        for chuck; Wed, 23 Aug 2000 12:55:27 -0400 (EDT)
Date: Wed, 23 Aug 2000 12:55:27 -0400 (EDT)



Subject: test
Content-Length: 18

A test.
From me.

-Chuck


        -------------+-------------------+--------------------
        "Pavlovian slaver at the cash till ring of success..."

 
 
 

hack to split huge mbx-format mail spool files?

Post by jeff godd » Thu, 24 Aug 2000 04:00:00




>[ ... ]
>>>Some people use the word 'From' at the start of a line.

>> Yes, and mbox format requires that this be munged; historically
>> a > was inserted at the beginning of such lines, though I think
>> a space would have been a better choice.

>Really?  Under Solaris 2.6:

>% cat /var/mail/chuck
>From chuck Wed Aug 23 12:55:28 2000

>        by bjork.codefab.com (8.11.0/8.11.0) id e7NGtRH15063
>        for chuck; Wed, 23 Aug 2000 12:55:27 -0400 (EDT)
>Date: Wed, 23 Aug 2000 12:55:27 -0400 (EDT)



>Subject: test
>Content-Length: 18

>A test.
>From me.

>-Chuck

>        -------------+-------------------+--------------------

whereas, under Irix 6.4:
-------------------------------


Subject: a test of From stuff

Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.4i

This is

Quote:>From me
and not
>From someone else

--
j
-------------------------------
one's mileage apparently does vary.
--
j
 
 
 

hack to split huge mbx-format mail spool files?

Post by Janne Johansso » Fri, 25 Aug 2000 04:00:00




> [ ... ]
> >>Some people use the word 'From' at the start of a line.

> > Yes, and mbox format requires that this be munged; historically
> > a > was inserted at the beginning of such lines, though I think
> > a space would have been a better choice.

> Really?  Under Solaris 2.6:

> % cat /var/mail/chuck
> From chuck Wed Aug 23 12:55:28 2000

>         by bjork.codefab.com (8.11.0/8.11.0) id e7NGtRH15063
>         for chuck; Wed, 23 Aug 2000 12:55:27 -0400 (EDT)
> Date: Wed, 23 Aug 2000 12:55:27 -0400 (EDT)



> Subject: test
> Content-Length: 18

> A test.
> From me.

As said above, I was under the impression that the mbox-format
specifically specified that the occurence of the word "From " first on
a line would be munged to ">From " and that "everyone" knew this and
demunged that while reading mboxes. So exactly how do you produce such
an mbox-file in /var/mail ?

--
"Surfa inte p? internet - Var en del av v?gen." -Lars Aronsson Aug-94.

Http://www.it.kth.se/~jj

 
 
 

hack to split huge mbx-format mail spool files?

Post by ynots.. » Sat, 26 Aug 2000 04:00:00




Quote:> Is there a hack available somewhere to split huge (tens or hundreds of
> MB) mbx-format mailboxes such as sendmail creates in /var/mail/? I've
> done a Google search and looked at a few things at http://www.ugu.com/
> but I haven't found anything useful.

> It would need to be smart enough to handle large MIME-encoded
> attachments.

...

If the mbox content spans month boundaries, use mms.pl (Mailbox Monthly
Splitter) from http://www.netrus.net/users/troc/perl.html

-   tony

-

Sent via Deja.com http://www.deja.com/
Before you buy.