473,466 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Create 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 1936
In article <gMUbe.2502$iZ1.2213@trnddc03>,
"David Isaac" <ai*****@verizon.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.washington.edu
Jul 19 '05 #2

"Donn Cave" <do**@u.washington.edu> wrote in message
news:do************************@gnus01.u.washingto n.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
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...
0
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...
4
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...
11
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...
2
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...
9
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...
3
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...
3
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...
4
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.