Re: mbx repair script: Python vs perl



Quoth "David Isaac" <aisaac0@xxxxxxxxxxx>:
| I'm looking for the Python equivalent of the perl script and module
| described at
| http://comments.gmane.org/gmane.mail.imap.uw.c-client/707
|
| Any hope?

Sure, should be doable, if for some reason you can't just use that.
I personally wouldn't do it exactly that way, rather I would just
read the file directly.

At first you said you were only interested in fixing the header.
This one operates on the rest of the file, and I guess I will assume
that's what you really want. MBX structure is just a one line message
header before each message, with a message size value among other things.
Readers of this format will add that size value to the current file
offset and expect another header line at that point. When the data
there isn't a valid header line, they die. One does not need the
c-client library to do this, but more to the point it isn't what you
want to do, with a damaged file.

Just read the file from one end to the other and find everything that
looks like a header line, and then rewrite the file with adjusted header
lines required so that

- they are in ascending order by ID number
- they have correct sizes.

Donn Cave, donn@xxxxxxxxxxx
.



Relevant Pages

  • Re: Imagination
    ... I know of no reason I need to adjust my post to the level ... To limit spam harvesting it is not in the posting header. ... post exact recipes. ... But there is a real issue--- Diabetes has damaged my hands ...
    (alt.support.diabetes)
  • Re: Rejecting null sender from my clients
    ... As long as you put your real address in the From: header, ... The reason you'd want to use is if you want to avoid a bounce in ... correct DSN. ... blanket ban on as an envelope sender. ...
    (comp.mail.sendmail)
  • Re: where is a copy of atlstr.h ??
    ... > compilers, there is no reason, at all, for stdio.h to be a file. ... > with one previous version of Visual Studio, MFC and ATL headers were in ... A header is useless in isolation. ... > 1) If your position on missing header locations is so reasonable, ...
    (microsoft.public.vc.language)
  • Re: One to One - Multilple tables for large field qty
    ... If I add the third one-to-one, the primary key ... If you were advised to normalize your data, there's a reason. ... On the header table there is a form ID (primary ... joining the same FormID. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Link Merge Fields in Header and Footer
    ... Is there some reason you can't use a CreateDate field? ... Word MVP FAQ site: http://word.mvps.org ... > have liked to tuck the ASK field away in the header, ... >> the header and the footer cannot talk to each other. ...
    (microsoft.public.word.docmanagement)