473,583 Members | 3,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mbx repair script

I'm looking for a Python script to repair the mbx header
for a mail file where only the header is corrupted.

Thanks,
Alan Isaac
Jul 19 '05 #1
2 1946
In article <gMUbe.2502$iZ1 .2213@trnddc03> ,
"David Isaac" <ai*****@verizo n.net> wrote:
I'm looking for a Python script to repair the mbx header
for a mail file where only the header is corrupted.


"Repair" and "corrupted" covers a lot of territory.

In the simplest case, a Python script would just be
a nuisance. All mbx files start with a 2048 byte
header, and a valid header can be copied to another
file and still be valid. For example, if the damaged
file still has 2048 bytes of header,

1. Find or create another mbx file "spud".
2. Copy header: $ dd if=spud count=4 > newbx
3. Copy old file: $ dd if=oldbx skip=4 >> newbx
4. change ownership and permission to match oldbx.

This approach isn't perfect - for example, it doesn't
preserve user flag information, but then, user flags
can be messed up by common IMAP4 operations like copying
a message from one folder to another. It assumes you
know where message data actually starts in the file,
but I think you'd need to know that in any event.

If the damage is really just that someone edited the
file in vi and you need to restore the NUL characters,
you could probably write something. Again, you have
to be able to recognize the start of message data
(or rather, the first MBX message header line.) If
the NULs are gone, this is probably preceded by a
series of CRLF ('\r\n'.) Keep track of how much has
been written to the output file, and at this point,
write '\0'*(2048 - n).

Donn Cave, do**@u.washingt on.edu
Jul 19 '05 #2

"Donn Cave" <do**@u.washing ton.edu> wrote in message
news:do******** *************** *@gnus01.u.wash ington.edu...
All mbx files start with a 2048 byte
header, and a valid header can be copied to another
file and still be valid. For example, if the damaged
file still has 2048 bytes of header,

1. Find or create another mbx file "spud".
2. Copy header: $ dd if=spud count=4 > newbx
3. Copy old file: $ dd if=oldbx skip=4 >> newbx
4. change ownership and permission to match oldbx.

This did not work for me.
Should it?
I thought the header contained information tightly tied
to the rest of the content (to speed search etc) so that
e.g., byte counts could matter.

Can you point me to documentation of the mbx format?

Thanks,
Alan Isaac
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3815
by: SheldonMopes | last post by:
Here is my situation:I have several Access database projects that all keep their back-end data in a directory on a server. I would like to have a small Access application that could open each .mdb file, then compact and repair it, with no user intervention other than launching the application. Thank you for any help.
0
1423
by: Microsoft | last post by:
Hi, Here is the problem that Iam experiencing, does anyone has a suggestion/solution ?? I use C# .NET Deployment project to install my application, which installs few windows Services. The following are the sequence of steps to simulate the problem 1) INSTALL the Application by clicking the setup.exe. Because the
4
1209
by: Peteroid | last post by:
Recently, and for reasons I don't know, the project I was working on started to compile either very slowly, or it was locking up. So, I repaired VS C++.NET 2005 Express via 're-installing' it without first removing it. The repair worked, and the project now compiles in a timely manner. My question is this. After the offer to download the...
11
4941
by: ritenah | last post by:
I am running this command from a .bat file. "C:\pathToAccess\MSACCESS.EXE" "C:\pathToDatabase\db.mdb" /REPAIR Database repairs as expected, then shows the messge: "Successfully repaired the ..." and you have to click "Ok" to get rid of the message so that the database can close. How does one suppress this message, so that the database...
2
2777
by: Ron | last post by:
Hi All, Using WinXP pro/Access 2000. I have a database that's been used for about 5 months. Transferred lots of data from a dos based program, then the users have been using it for that 5 months. About 180000 records in one of the main files (maybe 25000 new since the dos conversion). Been having some speed issues crop up along the way...
9
3984
by: Ron | last post by:
New discovery. If I take a perfectly good database, and "compact/repair" on it with Access 2000 (seems to be at multiple sites--I've tried it with my system here, at another office on an entirely different network), it damages the file somehow. The user's machine that did the compact/repair can see the file fine. But any networked user...
3
5591
by: jonnyboy | last post by:
Hello again, Thanks to Scott for helping out with my last query. I've had a good look round but I can't find anything that carries out what I'm trying to do. I've got a function that imports a set of text files into already-defined tables. Every time I run it, the database swells considerably, so it would be good to be able to...
3
2198
by: Bizmark | last post by:
Access2003, Windows XP Pro OEM user OS, Windows Sever 2000 server OS. Not-so-recently I inherited 3 Access DB's from another company merging with our own. Our own system works off of SQL server, but mainting these databases is critical to keeping the business running. 1 database in particular has been causing problems. Along the course we...
4
3166
by: zufie | last post by:
When I Repair/Compact my Access databse. I get icons/copies of a database named db1.mdb, db2.mdb, db3.mdb, etc... How else may I repair this database? Thanks!, Zuf
0
7896
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8184
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7936
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5375
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3820
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1434
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1158
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.