Community Discussions and Support
Can not delete empty mail trays

I have several pmail trays that give the error:


You have asked to delete a tray file which still contains folders. Please delete or move all folders from the tray before attempting to delete it.


but there are no folders to delete or move.


WinPMail version: Version 4.81.1154, Jan 10 2023, build ID 1154


I have several pmail trays that give the error: You have asked to delete a tray file which still contains folders. Please delete or move all folders from the tray before attempting to delete it. but there are no folders to delete or move. WinPMail version: Version 4.81.1154, Jan 10 2023, build ID 1154

I have seen this happen when the folders in the trays had the same name. Pegasus Mail can display these folders in their correct trays for a long time, and then it stops displaying them. It is as if the duplicate names cause confusion resulting in none of them being displayed. The folders still exist, it is the display of their names in the folder list that is affected.


To check for this condition:


  1. Make note of the exact names of the trays that appear empty.
  2. Shut down Pegasus Mail.
  3. Use a file explorer to navigate to your mailbox directory.
  4. Locate the file named HIERARCH.PM and make a copy of it in a temporary workspace. You are using the copy so as to not risk corruption of the original.
  5. Use a text editor like Notepad to open the copy of HIERARCH.PM.
  6. Do a search of the entire file for each of the tray names noted in Item 1.You should find an entry for each one of them that contains the words "My Mailbox". It will look something like this:

1,3,"26E96249:<TrayName>","033F1989:My mailbox","<TrayName>"


Any additional search hits will contain reference to the child folder name. Those will look something like this:


0,0,"4BNEZ0SA:1BE7:FOL021F5","26E96249:<TrayName>","<FolderName>"


I suggest copying the entry of each search hit and pasting it into a separate text document for future reference. Posting its content into a reply could help in providing recovery details.


That said, since you are trying to delete these trays, I wonder whether the content of any invisible child folders is of value. If not, an easy solution would be to delete their folder files.


Please post back about what what you find and, if child folder entries are identified, your thoughts about their value.


I have seen this happen when the folders in the trays had the same name. Pegasus Mail can display these folders in their correct trays for a long time, and then it stops displaying them. It is as if the duplicate names cause confusion resulting in none of them being displayed. The folders still exist, it is the display of their names in the folder list that is affected. To check for this condition: 1. Make note of the exact names of the trays that appear empty. 2. Shut down Pegasus Mail. 3. Use a file explorer to navigate to your mailbox directory. 4. Locate the file named HIERARCH.PM and make a copy of it in a temporary workspace. You are using the copy so as to not risk corruption of the original. 5. Use a text editor like Notepad to open the copy of HIERARCH.PM. 6. Do a search of the entire file for each of the tray names noted in Item 1. You should find an entry for each one of them that contains the words &quot;My Mailbox&quot;. It will look something like this: 1,3,&quot;26E96249:&lt;TrayName&gt;&quot;,&quot;033F1989:My mailbox&quot;,&quot;&lt;TrayName&gt;&quot; Any additional search hits will contain reference to the child folder name. Those will look something like this: 0,0,&quot;4BNEZ0SA:1BE7:FOL021F5&quot;,&quot;26E96249:&lt;TrayName&gt;&quot;,&quot;&lt;FolderName&gt;&quot; I suggest copying the entry of each search hit and pasting it into a separate text document for future reference. Posting its content into a reply could help in providing recovery details. That said, since you are trying to delete these trays, I wonder whether the content of any invisible child folders is of value. If not, an easy solution would be to delete their folder files. Please post back about what what you find and, if child folder entries are identified, your thoughts about their value.

I'm never been a user of trays, but have a dummy setup of Pegasus that has admin user with some trays. Wrote a little linux script that extracts tray / folder info from HIERARCH.PM file.


test.sh script


clear
echo "Mail Folder"
mailfolder=$(head -n 1 HIERARCH.PM | cut -f 3 -d,)
echo $mailfolder
echo -e "\nTrays"
grep ^1 <HIERARCH.PM
echo -e "\nFolders in Trays (Not Main Folder)"
grep -v "$mailfolder" <HIERARCH.PM
echo -e "\nFolders in Trays in Main Folder"
grep "$mailfolder" <HIERARCH.PM


Contents of HIERARCH.PM
2,1,"29465149:My mailbox","","My mailbox"
0,0,"TOIWZPQ5:5262:copyself","29465149:My mailbox","Copies to self",0,20
0,0,"HZQ51LV0:5263:junk","29465149:My mailbox","Junk or suspicious mail"
0,0,"VHELKLHO:5264:main","29465149:My mailbox","Main Folder"
0,256,"W687FP0A:3598:FOL05032","29465149:My mailbox","Deleted Messages",0,20
1,1,"00F54113:test tray","29465149:My mailbox","test tray"
0,0,"9UTNJLRQ:1865:A","29465149:My mailbox","a"
0,0,"Y4GKTYBE:1866:JACKJILL","29465149:My mailbox","jack and jill"
0,0,"74NWUQDB:1867:MARYHAD","29465149:My mailbox","mary had a little lamb"
0,0,"2FVL1GA4:417B:T1","00F54113:test tray","t1"
0,0,"BSCQTIKQ:417C:T2","00F54113:test tray","t2"
1,0,"70BC6757: xx","00F54113:test tray","xx"
1,1,"6CE46759:tt","29465149:My mailbox","tt"
0,0,"HWVFDFEV:6A12:FOL071E1","29465149:My mailbox","tt1"
0,0,"Z4XUZ0ZK:6A13:FOL043AB","29465149:My mailbox","ttx"
0,0,"QORVA9N0:6A14:FOL0476B","6CE46759:tt","tttt"


Put space in : xx to avoid emoji??


Mail Folder
"29465149:My mailbox"


Trays
1,1,"00F54113:test tray","29465149:My mailbox","test tray"
1,0,"70BC6757: xx","00F54113:test tray","xx"
1,1,"6CE46759:tt","29465149:My mailbox","tt"


Folders in Trays (Not Main Folder)
0,0,"2FVL1GA4:417B:T1","00F54113:test tray","t1"
0,0,"BSCQTIKQ:417C:T2","00F54113:test tray","t2"
1,0,"70BC6757: xx","00F54113:test tray","xx"
0,0,"QORVA9N0:6A14:FOL0476B","6CE46759:tt","tttt"


Folders in Trays in Main Folder
2,1,"29465149:My mailbox","","My mailbox"
0,0,"TOIWZPQ5:5262:copyself","29465149:My mailbox","Copies to self",0,20
0,0,"HZQ51LV0:5263:junk","29465149:My mailbox","Junk or suspicious mail"
0,0,"VHELKLHO:5264:main","29465149:My mailbox","Main Folder"
0,256,"W687FP0A:3598:FOL05032","29465149:My mailbox","Deleted Messages",0,20
1,1,"00F54113:test tray","29465149:My mailbox","test tray"
0,0,"9UTNJLRQ:1865:A","29465149:My mailbox","a"
0,0,"Y4GKTYBE:1866:JACKJILL","29465149:My mailbox","jack and jill"
0,0,"74NWUQDB:1867:MARYHAD","29465149:My mailbox","mary had a little lamb"
1,1,"6CE46759:tt","29465149:My mailbox","tt"
0,0,"HWVFDFEV:6A12:FOL071E1","29465149:My mailbox","tt1"
0,0,"Z4XUZ0ZK:6A13:FOL043AB","29465149:My mailbox","ttx"


Don't know what output would be with HIERARCH.PM file that has lots of folders and trays?
Could make a CPP program that does the same with a little time.


I&#039;m never been a user of trays, but have a dummy setup of Pegasus that has admin user with some trays. Wrote a little linux script that extracts tray / folder info from HIERARCH.PM file. test.sh script clear echo &quot;Mail Folder&quot; mailfolder=$(head -n 1 HIERARCH.PM | cut -f 3 -d,) echo $mailfolder echo -e &quot;\nTrays&quot; grep ^1 &lt;HIERARCH.PM echo -e &quot;\nFolders in Trays (Not Main Folder)&quot; grep -v &quot;$mailfolder&quot; &lt;HIERARCH.PM echo -e &quot;\nFolders in Trays in Main Folder&quot; grep &quot;$mailfolder&quot; &lt;HIERARCH.PM Contents of HIERARCH.PM 2,1,&quot;29465149:My mailbox&quot;,&quot;&quot;,&quot;My mailbox&quot; 0,0,&quot;TOIWZPQ5:5262:copyself&quot;,&quot;29465149:My mailbox&quot;,&quot;Copies to self&quot;,0,20 0,0,&quot;HZQ51LV0:5263:junk&quot;,&quot;29465149:My mailbox&quot;,&quot;Junk or suspicious mail&quot; 0,0,&quot;VHELKLHO:5264:main&quot;,&quot;29465149:My mailbox&quot;,&quot;Main Folder&quot; 0,256,&quot;W687FP0A:3598:FOL05032&quot;,&quot;29465149:My mailbox&quot;,&quot;Deleted Messages&quot;,0,20 1,1,&quot;00F54113:test tray&quot;,&quot;29465149:My mailbox&quot;,&quot;test tray&quot; 0,0,&quot;9UTNJLRQ:1865:A&quot;,&quot;29465149:My mailbox&quot;,&quot;a&quot; 0,0,&quot;Y4GKTYBE:1866:JACKJILL&quot;,&quot;29465149:My mailbox&quot;,&quot;jack and jill&quot; 0,0,&quot;74NWUQDB:1867:MARYHAD&quot;,&quot;29465149:My mailbox&quot;,&quot;mary had a little lamb&quot; 0,0,&quot;2FVL1GA4:417B:T1&quot;,&quot;00F54113:test tray&quot;,&quot;t1&quot; 0,0,&quot;BSCQTIKQ:417C:T2&quot;,&quot;00F54113:test tray&quot;,&quot;t2&quot; 1,0,&quot;70BC6757: xx&quot;,&quot;00F54113:test tray&quot;,&quot;xx&quot; 1,1,&quot;6CE46759:tt&quot;,&quot;29465149:My mailbox&quot;,&quot;tt&quot; 0,0,&quot;HWVFDFEV:6A12:FOL071E1&quot;,&quot;29465149:My mailbox&quot;,&quot;tt1&quot; 0,0,&quot;Z4XUZ0ZK:6A13:FOL043AB&quot;,&quot;29465149:My mailbox&quot;,&quot;ttx&quot; 0,0,&quot;QORVA9N0:6A14:FOL0476B&quot;,&quot;6CE46759:tt&quot;,&quot;tttt&quot; Put space in : xx to avoid emoji?? Mail Folder &quot;29465149:My mailbox&quot; Trays 1,1,&quot;00F54113:test tray&quot;,&quot;29465149:My mailbox&quot;,&quot;test tray&quot; 1,0,&quot;70BC6757: xx&quot;,&quot;00F54113:test tray&quot;,&quot;xx&quot; 1,1,&quot;6CE46759:tt&quot;,&quot;29465149:My mailbox&quot;,&quot;tt&quot; Folders in Trays (Not Main Folder) 0,0,&quot;2FVL1GA4:417B:T1&quot;,&quot;00F54113:test tray&quot;,&quot;t1&quot; 0,0,&quot;BSCQTIKQ:417C:T2&quot;,&quot;00F54113:test tray&quot;,&quot;t2&quot; 1,0,&quot;70BC6757: xx&quot;,&quot;00F54113:test tray&quot;,&quot;xx&quot; 0,0,&quot;QORVA9N0:6A14:FOL0476B&quot;,&quot;6CE46759:tt&quot;,&quot;tttt&quot; Folders in Trays in Main Folder 2,1,&quot;29465149:My mailbox&quot;,&quot;&quot;,&quot;My mailbox&quot; 0,0,&quot;TOIWZPQ5:5262:copyself&quot;,&quot;29465149:My mailbox&quot;,&quot;Copies to self&quot;,0,20 0,0,&quot;HZQ51LV0:5263:junk&quot;,&quot;29465149:My mailbox&quot;,&quot;Junk or suspicious mail&quot; 0,0,&quot;VHELKLHO:5264:main&quot;,&quot;29465149:My mailbox&quot;,&quot;Main Folder&quot; 0,256,&quot;W687FP0A:3598:FOL05032&quot;,&quot;29465149:My mailbox&quot;,&quot;Deleted Messages&quot;,0,20 1,1,&quot;00F54113:test tray&quot;,&quot;29465149:My mailbox&quot;,&quot;test tray&quot; 0,0,&quot;9UTNJLRQ:1865:A&quot;,&quot;29465149:My mailbox&quot;,&quot;a&quot; 0,0,&quot;Y4GKTYBE:1866:JACKJILL&quot;,&quot;29465149:My mailbox&quot;,&quot;jack and jill&quot; 0,0,&quot;74NWUQDB:1867:MARYHAD&quot;,&quot;29465149:My mailbox&quot;,&quot;mary had a little lamb&quot; 1,1,&quot;6CE46759:tt&quot;,&quot;29465149:My mailbox&quot;,&quot;tt&quot; 0,0,&quot;HWVFDFEV:6A12:FOL071E1&quot;,&quot;29465149:My mailbox&quot;,&quot;tt1&quot; 0,0,&quot;Z4XUZ0ZK:6A13:FOL043AB&quot;,&quot;29465149:My mailbox&quot;,&quot;ttx&quot; Don&#039;t know what output would be with HIERARCH.PM file that has lots of folders and trays? Could make a CPP program that does the same with a little time.

mikes@guam.net

edited Jul 6 '23 at 9:00 pm

Wrote a little cpp program.
1122 Jul 7 06:53 testhier.cpp Source code
15168 Jul 7 06:54 testhier Linux
42496 Jul 7 06:56 testhier.exe Windows (ming compiler)


#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main()
{
FILE *fp1;
char mailfolder[50]="",line[200]="",*p1,*eof;
#ifdef __linux__
system("clear");
#else
system("cls");
#endif

printf("Mail Folder\n");
fp1=fopen("HIERARCH.PM","r");
fgets(line,160,fp1);
strcpy(mailfolder,&line[4]);
p1=strchr(mailfolder,',');
*p1=0;
fclose(fp1);
printf("%s\n",mailfolder);

printf("\nTrays\n");
fp1=fopen("HIERARCH.PM","r");
while((!feof(fp1)))
{
fgets(line,99,fp1);
if(line[0]=='1') printf("%s",line);
}
fclose(fp1);

printf("\nFolders in Trays (Not Main Folder)\n");
fp1=fopen("HIERARCH.PM","r");
while((!feof(fp1)))
{
eof=fgets(line,99,fp1);
if(eof==0) break;
if(strstr(line,mailfolder)==0) printf("%s",line);
}
fclose(fp1);

printf("\nFolders in Trays in Main Folder\n");
fp1=fopen("HIERARCH.PM","r");
while((!feof(fp1)))
{
fgets(line,99,fp1);
if(strstr(line,mailfolder)) printf("%s",line);
}
fclose(fp1);
return(0);
}
Wrote a little cpp program. 1122 Jul 7 06:53 testhier.cpp Source code 15168 Jul 7 06:54 testhier Linux 42496 Jul 7 06:56 testhier.exe Windows (ming compiler) ```` #include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;ctype.h&gt; int main() { FILE *fp1; char mailfolder[50]=&quot;&quot;,line[200]=&quot;&quot;,*p1,*eof; #ifdef __linux__ system(&quot;clear&quot;); #else system(&quot;cls&quot;); #endif printf(&quot;Mail Folder\n&quot;); fp1=fopen(&quot;HIERARCH.PM&quot;,&quot;r&quot;); fgets(line,160,fp1); strcpy(mailfolder,&amp;line[4]); p1=strchr(mailfolder,&#039;,&#039;); *p1=0; fclose(fp1); printf(&quot;%s\n&quot;,mailfolder); printf(&quot;\nTrays\n&quot;); fp1=fopen(&quot;HIERARCH.PM&quot;,&quot;r&quot;); while((!feof(fp1))) { fgets(line,99,fp1); if(line[0]==&#039;1&#039;) printf(&quot;%s&quot;,line); } fclose(fp1); printf(&quot;\nFolders in Trays (Not Main Folder)\n&quot;); fp1=fopen(&quot;HIERARCH.PM&quot;,&quot;r&quot;); while((!feof(fp1))) { eof=fgets(line,99,fp1); if(eof==0) break; if(strstr(line,mailfolder)==0) printf(&quot;%s&quot;,line); } fclose(fp1); printf(&quot;\nFolders in Trays in Main Folder\n&quot;); fp1=fopen(&quot;HIERARCH.PM&quot;,&quot;r&quot;); while((!feof(fp1))) { fgets(line,99,fp1); if(strstr(line,mailfolder)) printf(&quot;%s&quot;,line); } fclose(fp1); return(0); } ````

mikes@guam.net

I had renamed the trays. I searched for the new try name, then used the key in the third column and found an additional entry for a non-existant FOLO... file. I deleted that row. I restarted Pegasus Mail and was able to delete the try. This worked for all of the problem trays.


Thanks.


I had renamed the trays. I searched for the new try name, then used the key in the third column and found an additional entry for a non-existant FOLO... file. I deleted that row. I restarted Pegasus Mail and was able to delete the try. This worked for all of the problem trays. Thanks.

Nice detective work in identifying the entries pointing to non-existent folder files. Normally, the editing of HIERARCH.PM is not needed nor recommended.


I'm glad that you have it fixed.


Nice detective work in identifying the entries pointing to non-existent folder files. Normally, the editing of HIERARCH.PM is not needed nor recommended. I&#039;m glad that you have it fixed.

Wondering if the lines had Name_Unavailable on them??
These lines sometimes show up in the HIERARCH.PM File.
Usually temp folders that are created and not correctly removed or links to folders that no longer exist or the location is not currently available.


I generally have a script that removes this lines from my HIERARCH.PM file.


cat cleanHIER
#!/usr/bin/bash
grep -v Name_Unavailable <HIERARCH.PM >HIERARCH.PMz
cp HIERARCH.PMz HIERARCH.PM


Have never found a problem with removing these lines, but I never link to folders in other locations.
Would assume those folders would show back if the location is restored? But mine are never those.


I also have another program that renames my folders from the FOL* names to names that match the first 8 or less characters of long name. Make them unique. Makes it easy to know which folder matches to which file pair. Back in DOS version of Pegasus your could rename folders in Pegasus, and it would change name in folder and change name of files, but in Windows version, it just changes the long name, and folders keep the original names.


Was wondering how the missing folders came to be missing?
Have heard of antivirus programs finding a message in a folder that they think is virus, and then the folder gets moved to a quarantine folder or deleted.


Would be interesting to know exactly what happened to them, but glad you have it working.


Wondering if the lines had Name_Unavailable on them?? These lines sometimes show up in the HIERARCH.PM File. Usually temp folders that are created and not correctly removed or links to folders that no longer exist or the location is not currently available. I generally have a script that removes this lines from my HIERARCH.PM file. cat cleanHIER \#!/usr/bin/bash grep -v Name_Unavailable &lt;HIERARCH.PM &gt;HIERARCH.PMz cp HIERARCH.PMz HIERARCH.PM Have never found a problem with removing these lines, but I never link to folders in other locations. Would assume those folders would show back if the location is restored? But mine are never those. I also have another program that renames my folders from the FOL* names to names that match the first 8 or less characters of long name. Make them unique. Makes it easy to know which folder matches to which file pair. Back in DOS version of Pegasus your could rename folders in Pegasus, and it would change name in folder and change name of files, but in Windows version, it just changes the long name, and folders keep the original names. Was wondering how the missing folders came to be missing? Have heard of antivirus programs finding a message in a folder that they think is virus, and then the folder gets moved to a quarantine folder or deleted. Would be interesting to know exactly what happened to them, but glad you have it working.

mikes@guam.net

Did a little script to check for non-existing folders.


cat chkexist.sh 
#!/bin/bash

for a in $(grep ^0 <HIERARCH.PM | cut -f3 -d: | cut -f 1 -d\") ; do
echo -n $a;
if [ -f $a.PMM ] ; then
echo -e "
\tExist"
else
echo -e "
\tNot Exist"
fi
done

Currently have no Name_Unavailable lines since cleaned them, so only folder that doesn't exists is the deleted mail folder that is left in HIERARCH.PM when closed, but file is then folder is deleted after closing since I don't save deleted folder. Could modify or create a new program to do this..
Interesting..


Output with my HIERARCH.PM
ACCOUNT Exist
AFT Exist
ALUMNI Exist
AMAZON Exist
AMZOLD Exist
ANALOGX Exist
BACKUP Exist
BILL521 Exist
BLOODBAN Exist
BOYCOTT Exist
BRAIN Exist
C Exist
COLLECTZ Exist
COPY1314 Exist
COPY2000 Exist
COPY2001 Exist
COPY2002 Exist
COPY2003 Exist
COPY2004 Exist
COPY2005 Exist
COPY2006 Exist
COPY2007 Exist
COPY2008 Exist
COPY2009 Exist
COPY2010 Exist
COPY2011 Exist
COPY2012 Exist
COPY2015 Exist
COPY2016 Exist
COPY2017 Exist
COPY2018 Exist
COPYSELF Exist
CUSTCARE Exist
DAD Exist
DHARRIS Exist
DISNEY Exist
DONNA_SU Exist
EBAY Exist
EBAYOLD Exist
ELAINE Exist
ELAINE1 Exist
ELAINE2 Exist
ELAINE3 Exist
FEDORA Exist
G4L Exist
G4L0408 Exist
G4L0909 Exist
G4L1011 Exist
G4L1213 Exist
G4L1418 Exist
G4U Exist
GFT Exist
GRC Exist
GRUB Exist
HARLEY Exist
HERC-XEN Exist
IBM Exist
JAY Exist
JUNK Exist
KERNEL Exist
KEVIN Exist
KUENTOS Exist
LIBRE Exist
LINUX Exist
LYNDAE Exist
MAIN Exist
MAIN2003 Exist
MAIN2004 Exist
MAIN2005 Exist
MAIN2006 Exist
MAIN2007 Exist
MAIN2008 Exist
MERCURY Exist
MOM Exist
OPENCOB Exist
PM-NEWS Exist
PMAIL Exist
PMAIL2020 Exist
PMAIL2021 Exist
PMAIL2022 Exist
REDHAT Exist
SALIVE Exist
SETI Exist
SPAM Exist
SPAMH Exist
SQUID Exist
SYSLINUX Exist
TIGHTVNC Exist
TISHAWNN Exist
USPS Exist
USPS2018 Exist
USPS2019 Exist
USPS2020 Exist
USPS2021 Exist
WATT Exist
WEBCAL Exist
ZHAOPEI Exist
FOL01860 Not Exist


Did a little script to check for non-existing folders. ```` cat chkexist.sh #!/bin/bash for a in $(grep ^0 &lt;HIERARCH.PM | cut -f3 -d: | cut -f 1 -d\&quot;) ; do echo -n $a; if [ -f $a.PMM ] ; then echo -e &quot;\tExist&quot; else echo -e &quot;\tNot Exist&quot; fi done ```` Currently have no Name_Unavailable lines since cleaned them, so only folder that doesn&#039;t exists is the deleted mail folder that is left in HIERARCH.PM when closed, but file is then folder is deleted after closing since I don&#039;t save deleted folder. Could modify or create a new program to do this.. Interesting.. Output with my HIERARCH.PM ACCOUNT Exist AFT Exist ALUMNI Exist AMAZON Exist AMZOLD Exist ANALOGX Exist BACKUP Exist BILL521 Exist BLOODBAN Exist BOYCOTT Exist BRAIN Exist C Exist COLLECTZ Exist COPY1314 Exist COPY2000 Exist COPY2001 Exist COPY2002 Exist COPY2003 Exist COPY2004 Exist COPY2005 Exist COPY2006 Exist COPY2007 Exist COPY2008 Exist COPY2009 Exist COPY2010 Exist COPY2011 Exist COPY2012 Exist COPY2015 Exist COPY2016 Exist COPY2017 Exist COPY2018 Exist COPYSELF Exist CUSTCARE Exist DAD Exist DHARRIS Exist DISNEY Exist DONNA_SU Exist EBAY Exist EBAYOLD Exist ELAINE Exist ELAINE1 Exist ELAINE2 Exist ELAINE3 Exist FEDORA Exist G4L Exist G4L0408 Exist G4L0909 Exist G4L1011 Exist G4L1213 Exist G4L1418 Exist G4U Exist GFT Exist GRC Exist GRUB Exist HARLEY Exist HERC-XEN Exist IBM Exist JAY Exist JUNK Exist KERNEL Exist KEVIN Exist KUENTOS Exist LIBRE Exist LINUX Exist LYNDAE Exist MAIN Exist MAIN2003 Exist MAIN2004 Exist MAIN2005 Exist MAIN2006 Exist MAIN2007 Exist MAIN2008 Exist MERCURY Exist MOM Exist OPENCOB Exist PM-NEWS Exist PMAIL Exist PMAIL2020 Exist PMAIL2021 Exist PMAIL2022 Exist REDHAT Exist SALIVE Exist SETI Exist SPAM Exist SPAMH Exist SQUID Exist SYSLINUX Exist TIGHTVNC Exist TISHAWNN Exist USPS Exist USPS2018 Exist USPS2019 Exist USPS2020 Exist USPS2021 Exist WATT Exist WEBCAL Exist ZHAOPEI Exist FOL01860 Not Exist

mikes@guam.net

More than half of the lines in the HIERARCH.PM file have "Name_Unavailable" and there is no matching physical file. From the comments, it seems that these lines can be safely deleted. The istallation is over 20 years old and has gone through numerous BSOD and upgrades. I am running on Windows, and could not use the shell scripts directly, but used them as a guides for coresponding Regina scripts.


More than half of the lines in the HIERARCH.PM file have &quot;Name_Unavailable&quot; and there is no matching physical file. From the comments, it seems that these lines can be safely deleted. The istallation is over 20 years old and has gone through numerous BSOD and upgrades. I am running on Windows, and could not use the shell scripts directly, but used them as a guides for coresponding Regina scripts.

Was kind of hoping it would be 100% having Name_Unavailable.
I've modified the program to check for the physical files.


Output from my simple test HIERARCH.PM is
In both this and my real one, I don't have any Name_Unavailable lines and only the Deleted messages Folder shows as missing. Y is found, N is not Found, and Blank is a Tray.
Unfortunately, this doesn't paste a monospace found, so things don't line up.


Mail Folder
"29465149:My mailbox"

Trays
1,1,"00F54113:test tray","29465149:My mailbox","test tray"
1,0,"70BC6757:xx","00F54113:test tray","xx"
1,1,"6CE46759:tt","29465149:My mailbox","tt"

Folders in Trays (Not Main Folder)
T1.PMM Y 0,0,"2FVL1GA4:417B:T1","00F54113:test tray","t1"
T2.PMM Y 0,0,"BSCQTIKQ:417C:T2","00F54113:test tray","t2"
Mailbox/Tray 1,0,"70BC6757:xx","00F54113:test tray","xx"
FOL0476B.PMM Y 0,0,"QORVA9N0:6A14:FOL0476B","6CE46759:tt","tttt"

Folders in Trays in Main Folder
Mailbox/Tray 2,1,"29465149:My mailbox","","My mailbox"
COPYSELF.PMM Y 0,0,"TOIWZPQ5:5262:copyself","29465149:My mailbox","Copies to self",0,20
JUNK.PMM Y 0,0,"HZQ51LV0:5263:junk","29465149:My mailbox","Junk or suspicious mail"
MAIN.PMM Y 0,0,"VHELKLHO:5264:main","29465149:My mailbox","Main Folder"
FOL05032.PMM N 0,256,"W687FP0A:3598:FOL05032","29465149:My mailbox","Deleted Messages",0,20
Mailbox/Tray 1,1,"00F54113:test tray","29465149:My mailbox","test tray"
A.PMM Y 0,0,"9UTNJLRQ:1865:A","29465149:My mailbox","a"
JACKJILL.PMM Y 0,0,"Y4GKTYBE:1866:JACKJILL","29465149:My mailbox","jack and jill"
MARYHAD.PMM Y 0,0,"74NWUQDB:1867:MARYHAD","29465149:My mailbox","mary had a little lamb"
Mailbox/Tray 1,1,"6CE46759:tt","29465149:My mailbox","tt"
FOL071E1.PMM Y 0,0,"HWVFDFEV:6A12:FOL071E1","29465149:My mailbox","tt1"
FOL043AB.PMM Y 0,0,"Z4XUZ0ZK:6A13:FOL043AB","29465149:My mailbox","ttx"

2073 Jul 7 22:00 testhier.cpp
15144 Jul 7 22:00 testhier
43520 Jul 7 22:01 testhier.exe


#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
void struprx( char *p );

int main()
{
FILE *fp1,*fp2;
char mailfolder[50]="",line[200]="",*p1,*eof,foldername[200]="";
#ifdef __linux__
system("clear");
#else
system("cls");
#endif

printf("Mail Folder\n");
fp1=fopen("HIERARCH.PM","r");
fgets(line,160,fp1);
strcpy(mailfolder,&line[4]);
p1=strchr(mailfolder,',');
*p1=0;
fclose(fp1);
printf("%s\n",mailfolder);

printf("\nTrays\n");
fp1=fopen("HIERARCH.PM","r");
while((!feof(fp1)))
{
fgets(line,99,fp1);
if(line[0]=='1') printf("%s",line);
}
fclose(fp1);

printf("\nFolders in Trays (Not Main Folder)\n");
fp1=fopen("HIERARCH.PM","r");
while((!feof(fp1)))
{
eof=fgets(line,99,fp1);
if(eof==0) break;
if(strstr(line,mailfolder)!=0) continue;
if(line[0]=='0')
{
p1=strchr(&line[17],':');
strcpy(foldername,p1+1);
p1=strchr(foldername,'"');
*p1=0;
struprx(foldername); // In linux have folder names all uppercase
strcat(foldername,".PMM");
printf("%-15s ",foldername);
if((fp2=fopen(foldername,"r"))) { printf("Y "); fclose(fp2); } else printf("N ");
}
else printf("Mailbox/Tray ");
printf("%s",line);
}
fclose(fp1);

printf("\nFolders in Trays in Main Folder\n");
fp1=fopen("HIERARCH.PM","r");
while((!feof(fp1)))
{
eof=fgets(line,99,fp1);
if(eof==0) break;
if(strstr(line,mailfolder)==0) continue;
if(line[0]=='0')
{
p1=strchr(&line[17],':');
strcpy(foldername,p1+1);
p1=strchr(foldername,'"');
*p1=0;
struprx(foldername);
strcat(foldername,".PMM");
printf("%-15s ",foldername);
if((fp2=fopen(foldername,"r"))) { printf("Y "); fclose(fp2); } else printf("N ");
}
else printf("Mailbox/Tray ");
printf("%s",line);
}
fclose(fp1);
return(0);
}

void struprx( char *p )
{
while( *p )
{
*p=toupper( *p );
p++;
}
}

Modified version of file.
File just reads HIERARCH.PM file and tries to open Folder files.
But to be 100% safe could copy HIERARCH.PM and PMM files to a different directory.
Since linux is case sensitive for files, I have all my PMM an PMI files as upper case names.
Don't recall if windows cares of case in filename matching?


have the testhier.cpp and testhier.exe file on my ftp server.
ftp setzco.dyndns.org
Generally would need an ftp client link ncftp since most browsers don't do ftp any more.
also has the older source code as testhier.cpp.sav and linux compiled version as testhier
Just runs program in mail directory.


Don't have windows machine handy, but runs fine under wine.


Know others make heavy use of trays, but I never did.
Well, if nothing else it is interesting...
Hope it all works out.


Was kind of hoping it would be 100% having Name_Unavailable. I&#039;ve modified the program to check for the physical files. Output from my simple test HIERARCH.PM is In both this and my real one, I don&#039;t have any Name_Unavailable lines and only the Deleted messages Folder shows as missing. Y is found, N is not Found, and Blank is a Tray. Unfortunately, this doesn&#039;t paste a monospace found, so things don&#039;t line up. ```` Mail Folder &quot;29465149:My mailbox&quot; Trays 1,1,&quot;00F54113:test tray&quot;,&quot;29465149:My mailbox&quot;,&quot;test tray&quot; 1,0,&quot;70BC6757:xx&quot;,&quot;00F54113:test tray&quot;,&quot;xx&quot; 1,1,&quot;6CE46759:tt&quot;,&quot;29465149:My mailbox&quot;,&quot;tt&quot; Folders in Trays (Not Main Folder) T1.PMM Y 0,0,&quot;2FVL1GA4:417B:T1&quot;,&quot;00F54113:test tray&quot;,&quot;t1&quot; T2.PMM Y 0,0,&quot;BSCQTIKQ:417C:T2&quot;,&quot;00F54113:test tray&quot;,&quot;t2&quot; Mailbox/Tray 1,0,&quot;70BC6757:xx&quot;,&quot;00F54113:test tray&quot;,&quot;xx&quot; FOL0476B.PMM Y 0,0,&quot;QORVA9N0:6A14:FOL0476B&quot;,&quot;6CE46759:tt&quot;,&quot;tttt&quot; Folders in Trays in Main Folder Mailbox/Tray 2,1,&quot;29465149:My mailbox&quot;,&quot;&quot;,&quot;My mailbox&quot; COPYSELF.PMM Y 0,0,&quot;TOIWZPQ5:5262:copyself&quot;,&quot;29465149:My mailbox&quot;,&quot;Copies to self&quot;,0,20 JUNK.PMM Y 0,0,&quot;HZQ51LV0:5263:junk&quot;,&quot;29465149:My mailbox&quot;,&quot;Junk or suspicious mail&quot; MAIN.PMM Y 0,0,&quot;VHELKLHO:5264:main&quot;,&quot;29465149:My mailbox&quot;,&quot;Main Folder&quot; FOL05032.PMM N 0,256,&quot;W687FP0A:3598:FOL05032&quot;,&quot;29465149:My mailbox&quot;,&quot;Deleted Messages&quot;,0,20 Mailbox/Tray 1,1,&quot;00F54113:test tray&quot;,&quot;29465149:My mailbox&quot;,&quot;test tray&quot; A.PMM Y 0,0,&quot;9UTNJLRQ:1865:A&quot;,&quot;29465149:My mailbox&quot;,&quot;a&quot; JACKJILL.PMM Y 0,0,&quot;Y4GKTYBE:1866:JACKJILL&quot;,&quot;29465149:My mailbox&quot;,&quot;jack and jill&quot; MARYHAD.PMM Y 0,0,&quot;74NWUQDB:1867:MARYHAD&quot;,&quot;29465149:My mailbox&quot;,&quot;mary had a little lamb&quot; Mailbox/Tray 1,1,&quot;6CE46759:tt&quot;,&quot;29465149:My mailbox&quot;,&quot;tt&quot; FOL071E1.PMM Y 0,0,&quot;HWVFDFEV:6A12:FOL071E1&quot;,&quot;29465149:My mailbox&quot;,&quot;tt1&quot; FOL043AB.PMM Y 0,0,&quot;Z4XUZ0ZK:6A13:FOL043AB&quot;,&quot;29465149:My mailbox&quot;,&quot;ttx&quot; ```` 2073 Jul 7 22:00 testhier.cpp 15144 Jul 7 22:00 testhier 43520 Jul 7 22:01 testhier.exe ```` #include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;ctype.h&gt; void struprx( char *p ); int main() { FILE *fp1,*fp2; char mailfolder[50]=&quot;&quot;,line[200]=&quot;&quot;,*p1,*eof,foldername[200]=&quot;&quot;; #ifdef __linux__ system(&quot;clear&quot;); #else system(&quot;cls&quot;); #endif printf(&quot;Mail Folder\n&quot;); fp1=fopen(&quot;HIERARCH.PM&quot;,&quot;r&quot;); fgets(line,160,fp1); strcpy(mailfolder,&amp;line[4]); p1=strchr(mailfolder,&#039;,&#039;); *p1=0; fclose(fp1); printf(&quot;%s\n&quot;,mailfolder); printf(&quot;\nTrays\n&quot;); fp1=fopen(&quot;HIERARCH.PM&quot;,&quot;r&quot;); while((!feof(fp1))) { fgets(line,99,fp1); if(line[0]==&#039;1&#039;) printf(&quot;%s&quot;,line); } fclose(fp1); printf(&quot;\nFolders in Trays (Not Main Folder)\n&quot;); fp1=fopen(&quot;HIERARCH.PM&quot;,&quot;r&quot;); while((!feof(fp1))) { eof=fgets(line,99,fp1); if(eof==0) break; if(strstr(line,mailfolder)!=0) continue; if(line[0]==&#039;0&#039;) { p1=strchr(&amp;line[17],&#039;:&#039;); strcpy(foldername,p1+1); p1=strchr(foldername,&#039;&quot;&#039;); *p1=0; struprx(foldername); // In linux have folder names all uppercase strcat(foldername,&quot;.PMM&quot;); printf(&quot;%-15s &quot;,foldername); if((fp2=fopen(foldername,&quot;r&quot;))) { printf(&quot;Y &quot;); fclose(fp2); } else printf(&quot;N &quot;); } else printf(&quot;Mailbox/Tray &quot;); printf(&quot;%s&quot;,line); } fclose(fp1); printf(&quot;\nFolders in Trays in Main Folder\n&quot;); fp1=fopen(&quot;HIERARCH.PM&quot;,&quot;r&quot;); while((!feof(fp1))) { eof=fgets(line,99,fp1); if(eof==0) break; if(strstr(line,mailfolder)==0) continue; if(line[0]==&#039;0&#039;) { p1=strchr(&amp;line[17],&#039;:&#039;); strcpy(foldername,p1+1); p1=strchr(foldername,&#039;&quot;&#039;); *p1=0; struprx(foldername); strcat(foldername,&quot;.PMM&quot;); printf(&quot;%-15s &quot;,foldername); if((fp2=fopen(foldername,&quot;r&quot;))) { printf(&quot;Y &quot;); fclose(fp2); } else printf(&quot;N &quot;); } else printf(&quot;Mailbox/Tray &quot;); printf(&quot;%s&quot;,line); } fclose(fp1); return(0); } void struprx( char *p ) { while( *p ) { *p=toupper( *p ); p++; } } ```` Modified version of file. File just reads HIERARCH.PM file and tries to open Folder files. But to be 100% safe could copy HIERARCH.PM and PMM files to a different directory. Since linux is case sensitive for files, I have all my PMM an PMI files as upper case names. Don&#039;t recall if windows cares of case in filename matching? have the testhier.cpp and testhier.exe file on my ftp server. ftp setzco.dyndns.org Generally would need an ftp client link ncftp since most browsers don&#039;t do ftp any more. also has the older source code as testhier.cpp.sav and linux compiled version as testhier Just runs program in mail directory. Don&#039;t have windows machine handy, but runs fine under wine. Know others make heavy use of trays, but I never did. Well, if nothing else it is interesting... Hope it all works out.

mikes@guam.net

"Name_Unavailable" entries are part of the normal operation of Pegasus Mail, however useless ones can accumulate. "Name_Unavailable" is added to an entry whenever its referenced folder file is unavailable. The most common cause of this is attaching another mailbox, or a directory, as an added mailbox. An entry is created in HIERARCH.PM for each of the folders in that added mailbox. When that mailbox is disconnected, the entries remain as "Name_Unavailable" for use again on next connection. Another cause is the deletion of folder files by an external program like a file explorer. The method of archiving Pegasus Mail data by moving old folder files to a storage location would do it too. "Name_Unavailable" entries are benign but it is harmless to remove them. HIERARCH.PM can become corrupted fairly easily during manual editing so be sure to have a backup copy.


&quot;Name_Unavailable&quot; entries are part of the normal operation of Pegasus Mail, however useless ones can accumulate. &quot;Name_Unavailable&quot; is added to an entry whenever its referenced folder file is unavailable. The most common cause of this is attaching another mailbox, or a directory, as an added mailbox. An entry is created in HIERARCH.PM for each of the folders in that added mailbox. When that mailbox is disconnected, the entries remain as &quot;Name_Unavailable&quot; for use again on next connection. Another cause is the deletion of folder files by an external program like a file explorer. The method of archiving Pegasus Mail data by moving old folder files to a storage location would do it too. &quot;Name_Unavailable&quot; entries are benign but it is harmless to remove them. HIERARCH.PM can become corrupted fairly easily during manual editing so be sure to have a backup copy.

Just to add. Anti-virus programs can sometimes find real or false positive matches in the PMM files, and if set to quarantine or delete these files would cause issues. Had this happen with few users, where folders disappeared. Fortunately, could be restored, and antivirus program modified to not be so aggressive. Could find message in PMM file that was setting off match and delete it from folder..


On a similar issue. Not related to Pegasus, but interesting. Had another staff member that had problem with his machine. MIS department 7 times, had completely reimaged his machine, but problem returned over and over. Finally called me. He had back ups of all his important files on 7 ZIP disks that he would restore after they reimaged machine. MIS never checked the zip disks. Turned out 5 of the 7 zip disks had viruses on them. Clean the zip disks, and then never had problem again. But MIS solution to most problems was just reimage..


Agree that one needs to backup and be careful. Do a full 7z archive of PMAIL directory about once a month, or if something important comes in. Then copy it to 3 other machines for back.


1161369530 Jan 16 20:23 pmsave-2023-01-16.7z
1140078527 Jan 25 11:33 pmsave-2023-01-25.7z
1142347898 Jan 31 21:47 pmsave-2023-01-31.7z
1147643456 Mar 8 17:32 pmsave-2023-03-08.7z
1177678810 Apr 25 22:00 pmsave-2023-04-25.7z
1188398086 May 21 05:26 pmsave-2023-05-21.7z


Eventually, do delete real old ones.


Just to add. Anti-virus programs can sometimes find real or false positive matches in the PMM files, and if set to quarantine or delete these files would cause issues. Had this happen with few users, where folders disappeared. Fortunately, could be restored, and antivirus program modified to not be so aggressive. Could find message in PMM file that was setting off match and delete it from folder.. On a similar issue. Not related to Pegasus, but interesting. Had another staff member that had problem with his machine. MIS department 7 times, had completely reimaged his machine, but problem returned over and over. Finally called me. He had back ups of all his important files on 7 ZIP disks that he would restore after they reimaged machine. MIS never checked the zip disks. Turned out 5 of the 7 zip disks had viruses on them. Clean the zip disks, and then never had problem again. But MIS solution to most problems was just reimage.. Agree that one needs to backup and be careful. Do a full 7z archive of PMAIL directory about once a month, or if something important comes in. Then copy it to 3 other machines for back. 1161369530 Jan 16 20:23 pmsave-2023-01-16.7z 1140078527 Jan 25 11:33 pmsave-2023-01-25.7z 1142347898 Jan 31 21:47 pmsave-2023-01-31.7z 1147643456 Mar 8 17:32 pmsave-2023-03-08.7z 1177678810 Apr 25 22:00 pmsave-2023-04-25.7z 1188398086 May 21 05:26 pmsave-2023-05-21.7z Eventually, do delete real old ones.

mikes@guam.net

Just got home from motorcycle funeral escort and found power off.
Guam got hit by a Cat 3 or 4 typhoon few weeks ago, and power system is still being restored.
So, systems are back up now. http://setzco.dyndns.org:8081/testhier.zip is now on the regular http server. ISP blocks port 80, but running it on 8081 works fine. That has the cpp source and windows exe file.


If anyone checks it out, let me know if any issues. Don't have any Name_Unavailable lines, but think it should just flag those as N since they don't have matching PMM files.


Just got home from motorcycle funeral escort and found power off. Guam got hit by a Cat 3 or 4 typhoon few weeks ago, and power system is still being restored. So, systems are back up now. http://setzco.dyndns.org:8081/testhier.zip is now on the regular http server. ISP blocks port 80, but running it on 8081 works fine. That has the cpp source and windows exe file. If anyone checks it out, let me know if any issues. Don&#039;t have any Name_Unavailable lines, but think it should just flag those as N since they don&#039;t have matching PMM files.

mikes@guam.net

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