Community Discussions and Support
Index corruption?

Yes for Barius .  And I get errors I don't know how to correct.  space between pattern & following words; missing operators, barewood where operator expected, etc. 

The C++ program contains no EXE  .  Don't know what to do with it.

<p>Yes for Barius .  And I get errors I don't know how to correct.  space between pattern & following words; missing operators, barewood where operator expected, etc.  </p><p>The C++ program contains no EXE  .  Don't know what to do with it. </p>

Background:  User running Pegasus v4.41 with a >8gb mailbox. 

WinNT5.1 SP2 ("XP SP2") on FAT32.  Multiple mail folders store

legally-important information back to 1997(?).  No individual mail

folder should be exceeding 1.5gb at this time.

Our only Pegasus user (in another state, sadly) is experiencing index corruption in her mailbox.  She reports a variety of symptoms:

  1. Opening a message from the in-folder list ("Foo" from "Bar", body "abcd") returns the wrong message ("Apples" from "Fred", body "1234").
  2. Opening a message returns nothing (i.e. blank e-mail)
  3. Opening a message returns hex garbage (i.e. middle of an attachment in another e-mail)
  4. Pegasus complains that the indexes may be corrupted

She has re-indexed but has not confirmed if it helped at all.  The problems are continuing.

What is causing this?  Can it be corrected?  Is there a way to tell if the raw folder file is still OK?  Have we pushed Pegasus too far?  What other information would be helpful in diagnosing or correcting the problem?  Am I asking too many questions?

This user, above all others in this company, needs her e-mail to be rock-solid.  Are there any recommendations from the community for improving the arrangement?  I'm giving serious thought to moving her data to an IMAP server and letting Pegasus cache it.

 
Daniel Johnson
Computer Resources
C. H. Guernsey & Company

 


 

<p>Background:  User running Pegasus v4.41 with a >8gb mailbox.  WinNT5.1 SP2 ("XP SP2") on FAT32.  Multiple mail folders store legally-important information back to 1997(?).  No individual mail folder should be exceeding 1.5gb at this time. </p> <p>Our only Pegasus user (in another state, sadly) is experiencing index corruption in her mailbox.  She reports a variety of symptoms:</p> <ol> <li>Opening a message from the in-folder list ("Foo" from "Bar", body "abcd") returns the wrong message ("Apples" from "Fred", body "1234").</li> <li>Opening a message returns nothing (i.e. blank e-mail)</li> <li>Opening a message returns hex garbage (i.e. middle of an attachment in another e-mail)</li> <li>Pegasus complains that the indexes may be corrupted </li> </ol> <p>She has re-indexed but has not confirmed if it helped at all.  The problems are continuing.</p> <p>What is causing this?  Can it be corrected?  Is there a way to tell if the raw folder file is still OK?  Have we pushed Pegasus too far?  What other information would be helpful in diagnosing or correcting the problem?  Am I asking too many questions?</p> <p>This user, above all others in this company, needs her e-mail to be rock-solid.  Are there any recommendations from the community for improving the arrangement?  I'm giving serious thought to moving her data to an IMAP server and letting Pegasus cache it.</p> <p>  Daniel Johnson Computer Resources C. H. Guernsey & Company  </p> <p>  </p>

[quote user="chguernsey"]

Background:  User running Pegasus v4.41 with a >8gb mailbox. 

WinNT5.1 SP2 ("XP SP2") on FAT32.  Multiple mail folders store

legally-important information back to 1997(?).  No individual mail

folder should be exceeding 1.5gb at this time.

Should not be any particular problem with the size of the folders or total size of the mailbox. Mine's a lot larger, many others  are as well. 
 

Our only Pegasus user (in another state, sadly) is experiencing index corruption in her mailbox.  She reports a variety of symptoms:

  1. Opening a message from the in-folder list ("Foo" from "Bar", body "abcd") returns the wrong message ("Apples" from "Fred", body "1234").
  2. Opening a message returns nothing (i.e. blank e-mail)
  3. Opening a message returns hex garbage (i.e. middle of an attachment in another e-mail)
  4. Pegasus complains that the indexes may be corrupted

If Pegasus Mail complains about the indexes they are probably corrupted.  There is fact may be something wrong with a particular folder as well.  Here's a way to fix a folder when the re-indexing does not solve the problem.

1.  Move all the messages you want to save to a temp folder and
    delete all the messages in the original folder.

2.  Use the right click "recover deleted space" to remove all
    messages form the folder.

3.  If step 2 works then simply move all of the messages from the
    temp folder back to the original folder and delete the temp
    folder.

4.  If step 2 fails then delete the original folder and rename the
    temp folder to match the original name.  Reset the filter
    pointing to this folder.


She has re-indexed but has not confirmed if it helped at all.  The problems are continuing.

What is causing this?  Can it be corrected?  Is there a way to tell if the raw folder file is still OK?  Have we pushed Pegasus too far?  What other information would be helpful in diagnosing or correcting the problem?  Am I asking too many questions?

 Personally I alway suspect that something is fighting WinPMail for the folder access.  The first thing that come to mind and one that can always cause this sort of problem is an anti-virus program with auto protect turned on grabbing the files when WinPMail accesses them.  The a-v program should not be working the WinPMail directories; the viruses should either be caught at the mail server or they should be using the extension VirScan to check the mail when read.  This extension will use most any a-v software.

Name of Program: VIRSCAN: Virus Scanning Extension for Pegasus Mail
Location/Filename <URL:mailto:Martin.Ireland@gov.ab.ca?Subject=send_virscan>
<URL:ftp://risc.ua.edu/pegasus/misc/virscan.zip>

Author/email contact: Martin Ireland <Martin.Ireland@gov.ab.ca>
Status: Freeware
Documentation: Included in zip file, Virscan.zip
Features: Extension to invoke virus scanning program of user choice when Pegasus Mail saves or views mail message attachments.
Comments: Available for Windows PCs. 16 and 32 bit versions available and tested on Windows 95, 98, and Windows NT Workstation 4.0.
Defaults to NAI's VirusScan engine. Multi-language support included.  


This user, above all others in this company, needs her e-mail to be

rock-solid.  Are there any recommendations from the community for

improving the arrangement?  I'm giving serious thought to moving her

data to an IMAP server and letting Pegasus cache it.

If these data are so critical to the company then moving it to IMAP4 might be a good idea anyway.  This way you'll have all the data on your server where it will be protected and backed up on a regular basis.   If anything goes wrong you'll always be able to restore it from your daily backup.

 
Daniel Johnson
Computer Resources
C. H. Guernsey & Company

[/quote]
[quote user=&quot;chguernsey&quot;]&lt;p&gt;Background:&amp;nbsp; User running Pegasus v4.41 with a &amp;gt;8gb mailbox.&amp;nbsp; WinNT5.1 SP2 (&quot;XP SP2&quot;) on FAT32.&amp;nbsp; Multiple mail folders store legally-important information back to 1997(?).&amp;nbsp; No individual mail folder should be exceeding 1.5gb at this time. &lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;Should not be any particular problem with the size of the folders or total size of the mailbox. Mine&#039;s a lot larger, many others&amp;nbsp; are as well.&amp;nbsp;&lt;/b&gt;&lt;/i&gt; &amp;nbsp;&lt;/p&gt; &lt;p&gt;Our only Pegasus user (in another state, sadly) is experiencing index corruption in her mailbox.&amp;nbsp; She reports a variety of symptoms:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Opening a message from the in-folder list (&quot;Foo&quot; from &quot;Bar&quot;, body &quot;abcd&quot;) returns the wrong message (&quot;Apples&quot; from &quot;Fred&quot;, body &quot;1234&quot;).&lt;/li&gt; &lt;li&gt;Opening a message returns nothing (i.e. blank e-mail)&lt;/li&gt; &lt;li&gt;Opening a message returns hex garbage (i.e. middle of an attachment in another e-mail)&lt;/li&gt; &lt;li&gt;Pegasus complains that the indexes may be corrupted&lt;/li&gt; &lt;/ol&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;If Pegasus Mail complains about the indexes they are probably corrupted.&amp;nbsp; There is fact may be something wrong with a particular folder as well.&amp;nbsp; Here&#039;s a way to fix a folder when the re-indexing does not solve the problem. &lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;1.&amp;nbsp; Move all the messages you want to save to a temp folder and &amp;nbsp;&amp;nbsp;&amp;nbsp; delete all the messages in the original folder. 2.&amp;nbsp; Use the right click &quot;recover deleted space&quot; to remove all &amp;nbsp;&amp;nbsp;&amp;nbsp; messages form the folder. 3.&amp;nbsp; If step 2 works then simply move all of the messages from the &amp;nbsp;&amp;nbsp;&amp;nbsp; temp folder back to the original folder and delete the temp &amp;nbsp;&amp;nbsp;&amp;nbsp; folder. 4.&amp;nbsp; If step 2 fails then delete the original folder and rename the &amp;nbsp;&amp;nbsp;&amp;nbsp; temp folder to match the original name.&amp;nbsp; Reset the filter &amp;nbsp;&amp;nbsp;&amp;nbsp; pointing to this folder. &lt;/b&gt;&lt;/i&gt; &lt;/p&gt;&lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;p&gt;She has re-indexed but has not confirmed if it helped at all.&amp;nbsp; The problems are continuing.&lt;/p&gt; &lt;p&gt;What is causing this?&amp;nbsp; Can it be corrected?&amp;nbsp; Is there a way to tell if the raw folder file is still OK?&amp;nbsp; Have we pushed Pegasus too far?&amp;nbsp; What other information would be helpful in diagnosing or correcting the problem?&amp;nbsp; Am I asking too many questions?&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;i&gt;&lt;b&gt;Personally I alway suspect that something is fighting WinPMail for the folder access.&amp;nbsp; The first thing that come to mind and one that can always cause this sort of problem is an anti-virus program with auto protect turned on grabbing the files when WinPMail accesses them.&amp;nbsp; The a-v program should not be working the WinPMail directories; the viruses should either be caught at the mail server or they should be using the extension VirScan to check the mail when read.&amp;nbsp; This extension will use most any a-v software. &lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;i&gt;&lt;b&gt;Name of Program: VIRSCAN: Virus Scanning Extension for Pegasus Mail Location/Filename &amp;lt;URL:mailto:Martin.Ireland@gov.ab.ca?Subject=send_virscan&amp;gt; &amp;lt;URL:ftp://risc.ua.edu/pegasus/misc/virscan.zip&amp;gt; Author/email contact: Martin Ireland &amp;lt;Martin.Ireland@gov.ab.ca&amp;gt; Status: Freeware Documentation: Included in zip file, Virscan.zip Features: Extension to invoke virus scanning program of user choice when Pegasus Mail saves or views mail message attachments. Comments: Available for Windows PCs. 16 and 32 bit versions available and tested on Windows 95, 98, and Windows NT Workstation 4.0. Defaults to NAI&#039;s VirusScan engine. Multi-language support included. &amp;nbsp;&lt;/b&gt;&lt;/i&gt; &lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt; &lt;p&gt;This user, above all others in this company, needs her e-mail to be rock-solid.&amp;nbsp; Are there any recommendations from the community for improving the arrangement?&amp;nbsp; I&#039;m giving serious thought to moving her data to an IMAP server and letting Pegasus cache it.&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;If these data are so critical to the company then moving it to IMAP4 might be a good idea anyway.&amp;nbsp; This way you&#039;ll have all the data on your server where it will be protected and backed up on a regular basis. &amp;nbsp;&lt;/b&gt;&lt;/i&gt; &lt;i&gt;&lt;b&gt;If anything goes wrong you&#039;ll always be able to restore it from your daily backup.&lt;/b&gt;&lt;/i&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp; Daniel Johnson Computer Resources C. H. Guernsey &amp;amp; Company &lt;/p&gt;[/quote]

Problem #1 and #3 are likely the result of that particular email

'folder' (actually the underlying .pmm file) growing beyond 2Gb in

size.  Pegasus doesn't seem to be able to cope with files larger than

2Gb on 32bit Windows.  Tell your employee/client/whatever that she needs to break up her email into more folders so they don't grow too big.

Problem #1 and  #2 are sometimes caused by having more than 65k emails in a single folder.  See above.

Problem

#4 can be fixed by selecting and moving/copying all emails from the

corrupted folder to a new folder.  Then delete the original folder and

rename the new one.  NOTE BENE: if the .pmm file for this folder is

over the 2Gb limit, then this *will* result in loss of data.  The only

way I have found to recover such files is to use a perl script that

splits the file into separate emails, then move those emails back into the

Pegasus newmail folder (in Windows Explorer) and then use Pegasus to move them into multiple mail folders.  The perl script I wrote is below, just copy it into a text file (e.g. pmmsplit.pl) and call it as so: pmmsplit.pl <input file path.pmm> <output filepath/prefix>

Note that you will need to install Perl if you are running Windows.  If you happen to have a Linux or Mac machine around, Perl should be installed there by default. 

------------------------- 

#!/usr/bin/perl

$thefile = $ARGV[0];
$outfile = $ARGV[1];

if(!$thefile || !$outfile){
        die('Usage: pmmsplit.pl < input file path/file.pmm > < output directory path/prefix >');
}

open (READ,"<$thefile") || die('The input file cannot be opened');
$count = 0;
while(<READ>){ //Loop through each line of the file
        if(/^Z/){
                //if this line contains '^Z' then it is a boundary between emails.
                //First, split the line using ^Z to get any data that might be on the same line
                @linesplit = split(/^Z/,$_);
                if($#linesplit > 1){
                         //there was some data before the ^Z, print it out to file.
                        print OUT @linesplit[0];
                }
                close(OUT);//Close the current output file, it now contains a complete MIME message (assuming a ^Z delimiter)

                $count=$count+1;//increment counter
                open(OUT, ">$outfile".$count.".cnm");//Open a new output file
                print OUT @linesplit[1];//Print any data that came after ^Z
        }
        else{
                print OUT $_;//This line does not contain the delimiter, just print it directly to the current output file.
        }
}

close(READ);
------------------------------

&lt;p&gt;Problem #1 and #3 are likely the result of that particular email &#039;folder&#039; (actually the underlying .pmm file) growing beyond 2Gb in size.&amp;nbsp; Pegasus doesn&#039;t seem to be able to cope with files larger than 2Gb on 32bit Windows.&amp;nbsp; Tell your employee/client/whatever that she needs to break up her email into more folders so they don&#039;t grow too big. &lt;/p&gt;&lt;p&gt;Problem #1 and&amp;nbsp; #2 are sometimes caused by having more than 65k emails in a single folder.&amp;nbsp; See above. &lt;/p&gt;&lt;p&gt;Problem #4 can be fixed by selecting and moving/copying all emails from the corrupted folder to a new folder.&amp;nbsp; Then delete the original folder and rename the new one.&amp;nbsp; NOTE BENE: if the .pmm file for this folder is over the 2Gb limit, then this *will* result in loss of data.&amp;nbsp; The only way I have found to recover such files is to use a perl script that splits the file into separate emails, then move those emails back into the Pegasus newmail folder (in Windows Explorer) and then use Pegasus to move them into multiple mail folders.&amp;nbsp; The perl script I wrote is below, just copy it into a text file (e.g. pmmsplit.pl) and call it as so: pmmsplit.pl &amp;lt;input file path.pmm&amp;gt; &amp;lt;output filepath/prefix&amp;gt;&lt;/p&gt;&lt;p&gt;Note that you will need to install Perl if you are running Windows.&amp;nbsp; If you happen to have a Linux or Mac machine around, Perl should be installed there by default.&amp;nbsp;&lt;/p&gt;&lt;p&gt;-------------------------&amp;nbsp;&lt;/p&gt;&lt;p&gt;#!/usr/bin/perl $thefile = $ARGV[0]; $outfile = $ARGV[1]; if(!$thefile || !$outfile){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; die(&#039;Usage: pmmsplit.pl &amp;lt; input file path/file.pmm &amp;gt; &amp;lt; output directory path/prefix &amp;gt;&#039;); } open (READ,&quot;&amp;lt;$thefile&quot;) || die(&#039;The input file cannot be opened&#039;); $count = 0; while(&amp;lt;READ&amp;gt;){ //Loop through each line of the file &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(/^Z/){ &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; //if this line contains &#039;^Z&#039; then it is a boundary between emails. &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; //First, split the line using ^Z to get any data that might be on the same line &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @linesplit = split(/^Z/,$_); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if($#linesplit &amp;gt; 1){ &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; //there was some data before the ^Z, print it out to file. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print OUT @linesplit[0]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; close(OUT);//Close the current output file, it now contains a complete MIME message (assuming a ^Z delimiter) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $count=$count+1;//increment counter &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; open(OUT, &quot;&amp;gt;$outfile&quot;.$count.&quot;.cnm&quot;);//Open a new output file &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print OUT @linesplit[1];//Print any data that came after ^Z &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else{ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print OUT $_;//This line does not contain the delimiter, just print it directly to the current output file. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } } close(READ); ------------------------------ &lt;/p&gt;

Thank you!  I now have a copy of her mail directory (FedEx and external HDs are nice).  There is one 2.5gb mail folder, the others are less than 2gb.  I've copied them to the mail server and am trying to split them out into Maildir-format.  I'm using the following script to call your Perl script.

#!/bin/bash

# "dosplit"

# Uses "dosplit.names", created by editing the output of

# for MF in *.pmm; do echo "$MF `head -c 50 $MF`" >> dosplit.names; done

# to remove spaces from mail folder names.

MAILBASEPATH=~/Maildir/.zzDJTemp

cat dosplit.names | while read MFLINE; do

MF=`echo $MFLINE | cut -f 1 -d " "`

if [ ! -f $MF.split ]; then

MFB=`basename $MF .pmm`

MFNAME=`echo $MFLINE | cut -f 2 -d " "`

mkdir -p $MAILBASEPATH.$MFNAME/cur

mkdir -p $MAILBASEPATH.$MFNAME/new

mkdir -p $MAILBASEPATH.$MFNAME/tmp

DEST=$MAILBASEPATH.$MFNAME/tmp/$MFB-$$-

date > $MF.split

echo "Splitting $MF ($MFNAME) into $DEST"

./pmmsplit.pl $MF $DEST

date >> $MF.split

fi

done

#######

It creates tons of files, but many of them are just base64 chunks. At least one of the CNMs I opened has a base64 attachment chunk preceding the message, and the message's own attachment chunk is cut off.  Your code looks OK to me, but I'm not a Perl-guru.  Do you (or anyone else) have any ideas on how to fix this?  I'd much rather make this work than try to make my copy of Pegasus properly read her files.

&lt;p&gt;Thank you!&amp;nbsp; I now have a copy of her mail directory (FedEx and external HDs are nice).&amp;nbsp; There is one 2.5gb mail folder, the others are less than 2gb.&amp;nbsp; I&#039;ve copied them to the mail server and am trying to split them out into Maildir-format.&amp;nbsp; I&#039;m using the following script to call your Perl script.&lt;/p&gt; &lt;pre&gt;#!/bin/bash # &quot;dosplit&quot; # Uses &quot;dosplit.names&quot;, created by editing the output of # for MF in *.pmm; do echo &quot;$MF `head -c 50 $MF`&quot; &amp;gt;&amp;gt; dosplit.names; done # to remove spaces from mail folder names. MAILBASEPATH=~/Maildir/.zzDJTemp cat dosplit.names | while read MFLINE; do MF=`echo $MFLINE | cut -f 1 -d &quot; &quot;` if [ ! -f $MF.split ]; then MFB=`basename $MF .pmm` MFNAME=`echo $MFLINE | cut -f 2 -d &quot; &quot;` mkdir -p $MAILBASEPATH.$MFNAME/cur mkdir -p $MAILBASEPATH.$MFNAME/new mkdir -p $MAILBASEPATH.$MFNAME/tmp DEST=$MAILBASEPATH.$MFNAME/tmp/$MFB-$$- date &amp;gt; $MF.split echo &quot;Splitting $MF ($MFNAME) into $DEST&quot; ./pmmsplit.pl $MF $DEST date &amp;gt;&amp;gt; $MF.split fi done ####### &lt;/pre&gt; &lt;p&gt;It creates tons of files, but many of them are just base64 chunks. At least one of the CNMs I opened has a base64 attachment chunk preceding the message, and the message&#039;s own attachment chunk is cut off.&amp;nbsp; Your code looks OK to me, but I&#039;m not a Perl-guru.&amp;nbsp; Do you (or anyone else) have any ideas on how to fix this?&amp;nbsp; I&#039;d much rather make this work than try to make my copy of Pegasus properly read her files.&lt;/p&gt;

As far as i can tell, all your script is supposed to do is split the separate emails into a folder structure of <mail folder name>/<cur | new | tmp>.  It appears to drop all of the emails into 'tmp', probably so that the email client can process them into 'cur'.  All that my script does is cut the .pmm file on every occurance of ^Z (ctrl-Z) which is used by Pegasus to separate the MIME messages.  I'm not sure if Pegasus can use another delimeter or not, if so then you'd have to open the .pmm file (on Linux try 'tail -n #### file.pmm' to read the last #### lines out) and find out what delimeter is being used.  Also note, I've never used my script on Windows, only Linux.  It is entirely possible that the same 2Gb limit that affects Pegasus on Windows will also affect my script...

I'm not sure why you want the emails in maildir format, are you planning on using some particular client that expects this?  If you need to move to another client I suggest Thunderbird for ease of use.  Moving to Tbird is fairly straight-forward and involves using Pegasus to create Unix Mail Format folders instead of the usual Pmail v2.x format folders.  The Unix Mail Format folders in Pegasus are directly transferable to Tbird.  Note, however, that Tbird can also run into the same 2Gb problem, as can Outlook (which will then unkindly force you to 'archive' old emails to clear up space).  If your client is used to Pegasus, I strongly suggest staying with it.  You might also file a bug-report on this 2Gb problem.  I filed one sometime back and was told it was a Windows problem, though I think it would be responsible to perform a platform based size-limit test within Pegasus to prevent overfilling a folder, and maybe if you complain too then someone will listen.

Edit: I added comments to my previous code so you might understand it better.
 

&lt;p&gt;As far as i can tell, all your script is supposed to do is split the separate emails into a folder structure of &amp;lt;mail folder name&amp;gt;/&amp;lt;cur | new | tmp&amp;gt;.&amp;nbsp; It appears to drop all of the emails into &#039;tmp&#039;, probably so that the email client can process them into &#039;cur&#039;.&amp;nbsp; All that my script does is cut the .pmm file on every occurance of ^Z (ctrl-Z) which is used by Pegasus to separate the MIME messages.&amp;nbsp; I&#039;m not sure if Pegasus can use another delimeter or not, if so then you&#039;d have to open the .pmm file (on Linux try &#039;tail -n #### file.pmm&#039; to read the last #### lines out) and find out what delimeter is being used.&amp;nbsp; Also note, I&#039;ve never used my script on Windows, only Linux.&amp;nbsp; It is entirely possible that the same 2Gb limit that affects Pegasus on Windows will also affect my script... &lt;/p&gt;&lt;p&gt;I&#039;m not sure why you want the emails in maildir format, are you planning on using some particular client that expects this?&amp;nbsp; If you need to move to another client I suggest Thunderbird for ease of use.&amp;nbsp; Moving to Tbird is fairly straight-forward and involves using Pegasus to create Unix Mail Format folders instead of the usual Pmail v2.x format folders.&amp;nbsp; The Unix Mail Format folders in Pegasus are directly transferable to Tbird.&amp;nbsp; Note, however, that Tbird can also run into the same 2Gb problem, as can Outlook (which will then unkindly force you to &#039;archive&#039; old emails to clear up space).&amp;nbsp; If your client is used to Pegasus, I strongly suggest staying with it.&amp;nbsp; You might also file a bug-report on this 2Gb problem.&amp;nbsp; I filed one sometime back and was told it was a Windows problem, though I think it would be responsible to perform a platform based size-limit test within Pegasus to prevent overfilling a folder, and maybe if you complain too then someone will listen.&lt;/p&gt;&lt;p&gt;Edit: I added comments to my previous code so you might understand it better. &amp;nbsp;&lt;/p&gt;

I recall splitting in a similar manner (using VB6) for a mass-printing application a few years ago.  I'm checking a hex-dump of one of the smaller PMMs to see if I can find anything interesting.  I'm doing all of this on the Linux server that will end up hosting the mail, the files haven't touched a Windows computer or Windows file system since they left her laptop.

The Courier IMAP server expects it in this case.  I plan to store all of her mail on the server, with the well-split Pegasus archives on her local PC for all but the current year.  Maildir allows me to bypass filesize limits and open/view/print/access the mail with any IMAP client.

She is used to Pegasus, and I will keep her on it if I can.  I've never been a fan of lookOut, though there is pressure in the company to "standardize her".

Aye, I may mention this. It's not the first time that we've had 2gb trouble with her, just the first time that it wasn't easily fixed.

Thank you for the code edits, it is clearer to me now. I'll post as soon as I find anything.

&lt;p&gt;I recall splitting in a similar manner (using VB6) for a mass-printing application a few years ago.&amp;nbsp; I&#039;m checking a hex-dump of one of the smaller PMMs to see if I can find anything interesting.&amp;nbsp; I&#039;m doing all of this on the Linux server that will end up hosting the mail, the files haven&#039;t touched a Windows computer or Windows file system since they left her laptop.&lt;/p&gt; &lt;p&gt;The Courier IMAP server expects it in this case.&amp;nbsp; I plan to store all of her mail on the server, with the well-split Pegasus archives on her local PC for all but the current year.&amp;nbsp; Maildir allows me to bypass filesize limits and open/view/print/access the mail with any IMAP client.&lt;/p&gt; &lt;p&gt;She is used to Pegasus, and I will keep her on it if I can.&amp;nbsp; I&#039;ve never been a fan of lookOut, though there is pressure in the company to &quot;standardize her&quot;.&lt;/p&gt; &lt;p&gt;Aye, I may mention this. It&#039;s not the first time that we&#039;ve had 2gb trouble with her, just the first time that it wasn&#039;t easily fixed.&lt;/p&gt; &lt;p&gt;Thank you for the code edits, it is clearer to me now. I&#039;ll post as soon as I find anything.&lt;/p&gt;

Got it at last! I wrote a quick C++ program to split the PMM file, and it worked.  I still don't see why the Perl program didn't.  :-/   Source code available, e-mail me at djohnson@chguernsey.com if you want it.

&lt;p&gt;Got it at last! I wrote a quick C++ program to split the PMM file, and it worked.&amp;nbsp; I still don&#039;t see why the Perl program didn&#039;t.&amp;nbsp; :-/ &amp;nbsp;&amp;nbsp;Source code available, e-mail me at &lt;a href=&quot;mailto:djohnson@chguernsey.com&quot; mce_href=&quot;mailto:djohnson@chguernsey.com&quot;&gt;djohnson@chguernsey.com&lt;/a&gt; if you want it.&lt;/p&gt;

I apologize for the delay, several people have asked for this and I've just now gotten around to it.

http://thor.chguernsey.com/temp/split-sig.zip    12kb

MD5sum: 3f82ab2945b6eaec3211f5d74d9296c2 *split-sig.zip
The ZIP includes my PGP signature.  I'll keep the file available at that location until at least 2009-01-01.

The program was written in C++ and compiled on 32-bit Linux.  It should work as-is on Windows but I don't guarantee it.  I left some extra files in the archive that demonstrate how I actually used it, I hope it's helpful.

Daniel Johnson
Progman2000@usa.net
PGP key 0x163E81EF
djohnson@chguernsey.com

I apologize for the delay, several people have asked for this and I&#039;ve just now gotten around to it. &lt;p&gt;&lt;a href=&quot;http://thor.chguernsey.com/temp/split-sig.zip&quot; mce_href=&quot;http://thor.chguernsey.com/temp/split-sig.zip&quot;&gt;http://thor.chguernsey.com/temp/split-sig.zip&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12kb MD5sum: 3f82ab2945b6eaec3211f5d74d9296c2 *split-sig.zip The ZIP includes my PGP signature.&amp;nbsp; I&#039;ll keep the file available at that location until at least 2009-01-01.&lt;/p&gt; &lt;p&gt;The program was written in C++ and compiled on 32-bit Linux.&amp;nbsp; It should work as-is on Windows but I don&#039;t guarantee it.&amp;nbsp; I left some extra files in the archive that demonstrate how I actually used it, I hope it&#039;s helpful.&lt;/p&gt; &lt;p&gt;Daniel Johnson Progman2000@usa.net PGP key 0x163E81EF djohnson@chguernsey.com&lt;/p&gt;

I liked Barius's approach to splitting up folders into messages, but found his Perl script to be overly complicated and extremely buggy. I've rewritten it as shown below. I tested it on a folder with 445 messages, and it took ~9 seconds to process.

#!/usr/bin/perl -w

use strict;

# pmmsplit.pl

#

# Grant Root <groot dayton-phoenix="" com=""></groot>

#

# This is a rewritten version of a script by "Barius" at

# http:#community.pmail.com/forums/thread/4125.aspx

#

# This script will split a Pegasus Mail folder file into individual message files

# suitable for moving into the mailbox directory of a target user, where they will

# show up as messages in the New Mail folder.

#

# A prime use for this utility is when a folder has exceeded 2GB in size, and can no

# longer be properly accessed or reindexed through the Pegasus Mail interface.

my $infile = $ARGV[0];

my $prefix = $ARGV[1];

if(!$infile || !$prefix){

die('Usage: pmmsplit.pl <input file="" path="" file.pmm=""><output directory="" path="" prefix="">'); </output>

}

open (IN,"<$infile") || die('The input file cannot be opened.');

my $header;

if (read (IN,$header,128) != 128){ # Read past the folder header.

die('File does not appear to be a Pegasus Mail folder.');

}

my $count = 1;

open(OUT, ">$prefix".$count.".cnm"); # Open a new output file.

while (<in>){ #Loop through each line of the file </in>

if (/^\x{1A}/){ # If this line starts with a ^Z then it is a boundary between emails.

close(OUT); # Close the current output file, it now contains a complete message.

if (length($_) > 1) {

$count++;

open(OUT, ">$prefix".$count.".cnm"); # Open a new output file.

print OUT substr($_, 1); # Print any data that came after ^Z.

}

}

else{

print OUT $_; # This line does not contain the delimiter, just print it.

}

}

close(IN);

&lt;p&gt;I liked Barius&#039;s approach to splitting up folders into messages, but found his Perl script to be overly complicated and extremely buggy. I&#039;ve rewritten it as shown below. I tested it on a folder with 445 messages, and it took ~9 seconds to process.&lt;/p&gt; &lt;pre&gt;#!/usr/bin/perl -w use strict; # pmmsplit.pl # # Grant Root &lt;groot {at]=&quot;&quot; dayton-phoenix=&quot;&quot; {dot}=&quot;&quot; com=&quot;&quot;&gt; # # This is a rewritten version of a script by &quot;Barius&quot; at # http:#community.pmail.com/forums/thread/4125.aspx # # This script will split a Pegasus Mail folder file into individual message files # suitable for moving into the mailbox directory of a target user, where they will # show up as messages in the New Mail folder. # # A prime use for this utility is when a folder has exceeded 2GB in size, and can no # longer be properly accessed or reindexed through the Pegasus Mail interface. my $infile = $ARGV[0]; my $prefix = $ARGV[1]; if(!$infile || !$prefix){ die(&#039;Usage: pmmsplit.pl &lt;input file=&quot;&quot; path=&quot;&quot; file.pmm=&quot;&quot;&gt; &lt;output directory=&quot;&quot; path=&quot;&quot; prefix=&quot;&quot;&gt;&#039;); } open (IN,&quot;&amp;lt;$infile&quot;) || die(&#039;The input file cannot be opened.&#039;); my $header; if (read (IN,$header,128) != 128){ # Read past the folder header. die(&#039;File does not appear to be a Pegasus Mail folder.&#039;); } my $count = 1; open(OUT, &quot;&amp;gt;$prefix&quot;.$count.&quot;.cnm&quot;); # Open a new output file. while (&lt;in&gt;){ #Loop through each line of the file if (/^\x{1A}/){ # If this line starts with a ^Z then it is a boundary between emails. close(OUT); # Close the current output file, it now contains a complete message. if (length($_) &amp;gt; 1) { $count++; open(OUT, &quot;&amp;gt;$prefix&quot;.$count.&quot;.cnm&quot;); # Open a new output file. print OUT substr($_, 1); # Print any data that came after ^Z. } } else{ print OUT $_; # This line does not contain the delimiter, just print it. } } close(IN); &lt;/in&gt;&lt;/output&gt;&lt;/groot&gt;&lt;/pre&gt;

I have need of something to rescue my wife's Pegasus Mainn.pmm folder which has exceeded 2 GB after someone sent her a bunch of big pictures.
The effect is that mail messages with cewrtain subjects do not reflect that subject at all.  All messages are wrong.

Checking produces 'Seek Error in Master File'

So I tried moving mail out & the Pegasus program  mbxmain_ui.exe functions.  Did not correct problem.

Found Barius' & Grant Root's scripts & decided to try them after installing Active State's Perl on my Windows 7 Pro PC.

Using Grant Root's script, now get errors in script  'Use of uninitialized value $_ in pattern match (m//) at script.pl line 35' &
'Use of uninitialized value $_  at script.pl line 44'

I'm not a pearl at 'Perl' !  

Any suggestions how to fix script and/or correct problem ?

PS - If Pegasus only supports 32 bit presently & Win 7 is running 64 bit; don't we have a a fundamental problem
until Pegasus is converted to 64 bit addressing ?!?  I have been using Pegasus since early 90's & would really like to continue - safely !

&lt;p&gt;I have need of something to rescue my wife&#039;s Pegasus Mainn.pmm folder which has exceeded 2 GB after someone sent her a bunch of big pictures. The effect is that mail messages with cewrtain subjects do not reflect that subject at all.&amp;nbsp; All messages are wrong.&lt;/p&gt;&lt;p&gt;Checking produces &#039;Seek Error in Master File&#039; &lt;/p&gt;&lt;p&gt;So I tried moving mail out &amp;amp; the Pegasus program&amp;nbsp; mbxmain_ui.exe functions.&amp;nbsp; Did not correct problem.&lt;/p&gt;&lt;p&gt;Found Barius&#039; &amp;amp; Grant Root&#039;s scripts &amp;amp; decided to try them after installing Active State&#039;s Perl on my Windows 7 Pro PC.&lt;/p&gt;&lt;p&gt;Using Grant Root&#039;s script, now get errors in script&amp;nbsp; &#039;Use of uninitialized value $_ in pattern match (m//) at script.pl line 35&#039; &amp;amp; &#039;Use of uninitialized value $_&amp;nbsp; at script.pl line 44&#039;&lt;/p&gt;&lt;p&gt;I&#039;m not a pearl at &#039;Perl&#039; ! &amp;nbsp;&lt;/p&gt;&lt;p&gt;Any suggestions how to fix script and/or correct problem ? &lt;/p&gt;&lt;p&gt;PS - If Pegasus only supports 32 bit presently &amp;amp; Win 7 is running 64 bit; don&#039;t we have a a fundamental problem until Pegasus is converted to 64 bit addressing ?!?&amp;nbsp; I have been using Pegasus since early 90&#039;s &amp;amp; would really like to continue - safely ! &lt;/p&gt;

Have you tried Barius' perl script in this thread, the program that Daniel linked to, or the 'Notsplit' program in this site's Downloads / Tools and Utilities section?

 

&lt;P&gt;Have you tried Barius&#039; perl script in this thread, the program that Daniel linked to, or the &#039;Notsplit&#039; program in this site&#039;s&amp;nbsp;Downloads / Tools and Utilities section?&lt;/P&gt; &lt;P mce_keep=&quot;true&quot;&gt;&amp;nbsp;&lt;/P&gt;
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft