Loading ...
Sorry, an error occurred while loading the content.

Re: A small program [was: Re: [NTO] Outlook Express Folders]

Expand Messages
  • David Smart
    I have on occasions thought about repackaging (generalising) the program - specifically with the view of selling it to my customers. I ve been thinking about
    Message 1 of 2 , Jan 11, 2005
    • 0 Attachment
      I have on occasions thought about repackaging (generalising) the program - specifically with the view of selling it to my customers. I've been thinking about it on and off for years, however, and haven't done it yet, so it's unlikely to happen soon.

      All that the program is doing is a rename of the file after it has been dragged to the file system. This can also be done by using the "file/rename" facility in Windows and renaming the file by hand. I've simply automated the process - using very personal (and hard-coded) rules - to speed it up on my computer. (It's so hard-coded that I need to change the actual source code if any of my family members acquires a new e-mail address or changes the directory root that they store messages in.)

      If anyone on the list wants to write a more general program to do this, please feel free to use as much (or as little) of my explanation as you wish, and also feel free to ask me for further clarification if needed. I would not expect nor seek any recognition in the final program - my reward would be seeing something I've been putting off for years come to fruition.

      Dave S

      ----- Original Message -----
      From: Subscriber
      To: ntb-OffTopic@yahoogroups.com
      Sent: Wednesday, January 12, 2005 1:23 AM
      Subject: A small program [was: Re: [NTO] Outlook Express Folders]


      Dear David,
      I do appreciate your detailed answer and explanation. Unfortunately, I am
      simply a computer user and know nothing about programming. Have you ever
      thought about publishing your program as freeware or even shareware? Or
      maybe there is another NoteTab user who could write such a useful piece of
      software and make it available for others?
      Best regards,
      Wojciech

      ----- Original Message -----
      From: "David Smart" <smartware@...>
      To: <ntb-OffTopic@yahoogroups.com>
      Sent: Tuesday, January 11, 2005 12:14 PM
      Subject: Re: [NTO] Outlook Express Folders


      >
      > The program is full of "magic numbers" so it is somewhat useless for
      > others (and also contains slightly sensitive information). However, what
      > it does is:
      >
      > Opens and reads an EML file (which is text, so that's easy)
      > Looks at the message line keys and finds "from:" and "to:" and stores the
      > addresses of both.
      > On the way, it also grabs "sender:" or "x-sender:" and "x-apparently-to:"
      > holding them separately from the "from:" and "to:".
      > If it doesn't find a "from:" it uses what it found for "sender:" or
      > "x-sender:"; and if it doesn't find a "to:" it uses what it found for
      > "x-apparently-to:". (But it uses the "from:" / "to:" in preference. I
      > don't remember why, but I did it that way for good reasons.)
      > Then it looks at the "from" and the "to" and works out which one of them
      > is "me". This is one area where the magic stuff comes in - it's looking
      > for any of many e-mail addresses and also looking at the directory of the
      > tree the file's in to work out who "me" is anyway (could be any of the
      > four members of my family). It discards the one it decides is "me" and
      > keeps the other one.
      > It forms up a new name for the file, consisting of the original name, with
      > the e-mail information appended.
      >
      > The basic name for your e-mail would be
      >
      > Re [NTO] Outlook Express Folders [from subscriber04].eml
      >
      > and the basic name for THIS message will be
      >
      > Re [NTO] Outlook Express Folders [to ntb-OffTopic@yahoogroups.com]
      >
      > While creating the new name, I actually clean it up a bit: multiple spaces
      > are removed; underlines that are clearly conversions from colons, etc, are
      > removed; non file-name characters are removed from the e-mail address.
      > This is totally arbitrary stuff which I have put in whenever I didn't like
      > a particular result, or when the file rename failed because of an illegal
      > character coming from the e-mail address.
      >
      > There are a couple of other transformations I do on the way: if the e-mail
      > doesn't have a subject, I put "no subject"; if OE has given the message a
      > sequence number to avoid file name clashes, I remove it.
      >
      > When there is more than one e-mail about the same subject and to/from the
      > same address, the above formatting would give a name clash. To work round
      > that I will add a sequence number to the end of each of the files. I find
      > out what to do with a simple run of logic.
      >
      > If a file of the above name already exists, it means that the new message
      > is the second of this sequence and, more importantly, that the existing
      > file will become the first of the sequence. I rename the existing file,
      > i.e.:
      >
      > Re [NTO] Outlook Express Folders [from subscriber04].eml
      >
      > is renamed to
      >
      > Re [NTO] Outlook Express Folders [from subscriber04] 1.eml
      >
      > Then, regardless of what I did there, I start looking for files in the
      > sequence, starting at the "1" position. I either find no files, or the
      > last file in an existing sequence.
      >
      > If there are no files, I rename the new message
      >
      > Re [NTO] Outlook Express Folders [from subscriber04].eml
      >
      > If there are files, I note the last (highest numbered) one, and rename the
      > new message into the next position in the sequence.
      >
      > So, after one message, I'd have
      >
      > Re [NTO] Outlook Express Folders [from subscriber04].eml
      >
      > And after a second message from you on the same subject I'd have
      >
      > Re [NTO] Outlook Express Folders [from subscriber04] 1.eml
      > Re [NTO] Outlook Express Folders [from subscriber04] 2.eml
      >
      > I've often suggested to myself that I should just always start with
      > sequence "1", but it doesn't please my eye, and would only actually save
      > about three or four lines of code anyway.
      >
      > I compile the program as a DOS console application and put in a
      > right-click option for EML files to run it from Windows Explorer. If I
      > want to do multiple files at once, I get Windows to call the program once
      > for each file - I didn't bother making the program handle multiple files.
      >
      > This is all pretty arbitrary, and very simple C++ code - built on a
      > foundation of classes that I have developed over the many years since I
      > started using C++. Although I could sanitise it and post it, it would be
      > somewhat meaningless without the supporting classes, which I'm not willing
      > to give out.
      >
      > A bit of work in your favourite programming environment would knock up an
      > equivalent program in a couple of evenings. The points that need to be
      > covered are:
      >
      > Reading the EML text file looking for the lines that begin with specific
      > key words, and grabbing the e-mail information from those lines;
      > Guessing which of the "to" or "from" is the other party;
      > Constructing a file name which is a combination of the file name OE gave
      > it and the selected e-mail information;
      > Ensuring that you can handle multiple messages that would end up with the
      > same name otherwise (e.g. by appending a sequence number, or the date and
      > time, or whatever);
      > Renaming the file.
      >
      > All the other stuff I do is window-dressing and you may or may not wish to
      > do something similar.
      >
      > Dave S
      >
      > ----- Original Message -----
      > From: subscriber04
      > To: ntb-OffTopic@yahoogroups.com
      > Sent: Tuesday, January 11, 2005 8:03 AM
      > Subject: Re: [NTO] Outlook Express Folders
      >
      >
      >
      > --- In ntb-OffTopic@yahoogroups.com, "David Smart" <smartware@o...>
      > wrote:
      > > In fact, I don't ever keep messages in the OE dbx files for long
      > anyway. I keep them in my normal file system as EML files,
      > alongside all my other documents. I drag them to the appropriate
      > documentation folders, then run a small program I wrote that changes
      > the file names to give more information about the e-mails, and also
      > removes the worry of multiple files with the same names.
      >
      >
      > Dave,
      >
      > Could you please elaborate a little bit more what does this program
      > do? And more, could you possibly share it? I mean, is possible to
      > get it from you? A couple of days ago I joined the club of upset OE
      > users with corruptet dbx files (although they were not bigger than
      > 50 MB each) and would like to save what I was able to recover from
      > my backup copy the way you describe.
      >
      > Kind regards,
      >
      > Wojciech/Subscriber
      >
      >
      >
      >
      >
      > ------------------------------------------------------------------------------
      > Yahoo! Groups Links
      >
      > a.. To visit your group on the web, go to:
      > http://groups.yahoo.com/group/ntb-OffTopic/
      >
      > b.. To unsubscribe from this group, send an email to:
      > ntb-OffTopic-unsubscribe@yahoogroups.com
      >
      > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      > Service.
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
      >




      ------------------------------------------------------------------------------
      Yahoo! Groups Links

      a.. To visit your group on the web, go to:
      http://groups.yahoo.com/group/ntb-OffTopic/

      b.. To unsubscribe from this group, send an email to:
      ntb-OffTopic-unsubscribe@yahoogroups.com

      c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.