Specifications
56
#getdata 1.60f, written by Michele Citterio (mcit@geus.dk) at GEUS, Copenhagen
#coding=cp850
#
#install and use: install pyhton 2.5.2 and pywin32 212, copy this file into an
#empty folder and run it from there. Four files and a folder can be created
#for each IMEI number found when retrievig the emails from the Exchange server:
#1) IMEI#.txt readable comma-separated ascii file - AWS observations
#2) IMEI#-D.txt readable comma-separated ascii file - AWS diagnostics
#3) IMEI#-F.txt readable comma-separated ascii file - malformed msg (from 1.56)
#4) IMEI#-X.txt file with whatever else has been received from that IMEI device
#5) IMEI#/ a folder where individual received email attachments are stored
#One further file msgshash.dat is also created on the first program run and
#updated at every run to store the hashes of already processed mesages, so that
#they can be identified and skipped on later program runs.
#
#revision history:
# 1.51, 10-05-2009 + configured PROMICE 2009 binary format
# + configured Quadra Mining 2009 Malmbjerg binary format
# + added Python version 2.5.2 check and made Py3k-aware
# + some code cleanup of try..except blocks
# 1.52, 11-05-2009 + configured Glaciobasis 2009 Zackenberg Top binary format
# 1.53, 09-06-2009 + configured Glaciobasis 2009 Zackenberg Main binary format
# + much improved detection of bin format specification errors
# + fixed wrong format specifications 5, 7 and 12
# + improved the try..except blocks by setting the error types
# + tested for compatibility with up to Python 2.5.4
# + improved handling of user's infostores or folders choices
# + added warning for binary messages longer than specified
# + fixed support of Unicode pathnames, so x:\Søren works now!
# 1.54a, 19/06/2009 + attempted workaround to crash in pywin32 on some machines
# 1.55, 23/09/2009 + fixed 1 h timestamp error. Epochs handling more portable
# 1.60f, 06/10/2009 + added prompt to sort the *.txt files based on timestamps
# + fixed crash decoding malformed (too long/short) messages
# + truncated messages are decoded using ? for missing values
# + added option to put malformed messages in a separate file
# + added exceptions handling while opening the *.txt files
# + logoff from Exchange server even on unhandled exceptions
# + added check for re-delivered messages (Iridium or NAL bug)
# + MOMSN is also hashed when detecting duplicates
# + use the current user's name as default for Exchange logon
# + improved the printed output during the run and at the end
# + now uses 128 bits hashes: must retrieve all messages again
# since -f + do not try to logoff when logon failed due to wrong userid
# + pickle is replaced with cPickle for speed
# + ctrl-break is also trapped and handled same as ctrl-c
#