Releases: TeamMsgExtractor/msg-extractor
Releases · TeamMsgExtractor/msg-extractor
Version 0.29.1
v0.29.1
- [TeamMsgExtractor #198] Added a feature to save the header in it's own file (prefers the full raw header if it can find it, otherwise puts in a generated one) that was actually supposed to be in v0.29.0 but I forgot, lol.
Version 0.29.0
v0.29.0
- [TeamMsgExtractor #207] Made it so that unspecified dates are handled properly. For clarification, an unspecified date is a custom value in MSG files for dates that means that the date is unspecified. It is distinctly different from a property not existing, which will still return None. For unspecified dates,
datetime.datetime.max
is returned. While perhaps not the best solution, it will have to do for now. - Fixed an issue where
utils.parseType
was returning a string for the date when it makes more sense to return an actual datetime instance. - [TeamMsgExtractor #165] [TeamMsgExtractor #191] Completely redesigned all existing save functions. You can now properly save to custom locations under custom file names. This change may break existing code for several reasons. First, all arguments have been changed to keyword arguments. Second, a few keyword arguments have been renamed to better fit the naming conventions.
- [TeamMsgExtractor #200] Changed imports to use relative imports instead of hard imports where applicable.
- Updated the save functions to no longer rely on the current working directory to save things. The module now does what it can to use hard pathing so that if you spontaneously change working directory it will not cause problems. This should also allow for saving to be threaded, if I am correct.
- [TeamMsgExtractor #197] Added new property
Message.defaultFolderName
. This property returns the default name to be used for a Message if none of the options change the name. - [TeamMsgExtractor #201] Fixed an issue where if the class type was all caps it would not be recognized. According to the documentation the comparisons should have been case insensitive, but I must have misread it at some point.
- [TeamMsgExtractor #202] Module will now handle path lengths in a semi-intelligent way to determine how best to save the MSG files. Default path length max is 255.
- [TeamMsgExtractor #203] Fixed an issue where having multiple "." characters in your file name would cause the directories to be incorrectly named when using the
useFileName
(nowuseMsgFilename
) argument in the save function. - [TeamMsgExtractor #204] Fixed an issue where the failsafe name used by attachments wasn't being encoded before hand causing encoding errors.
- MSG files with a type of simply
IPM
will now be returned asMSGFile
byopenMsg
, as this specifies that no format has been specified. - [TeamMsgExtractor #214] Attachments that error because the MSG class type wasn't recognized or isn't supported will now correctly be
UnsupportedAttachment
instead ofBrokenAttachment
. - Improved internal code in many functions to make them faster and more efficient.
openMsg
will now tell you if a class type is simply unsupported rather than unrecognized. If it is found in the list, the function will raiseUnsupportedMSGTypeError
.- Added caching to
MSGFile.listDir
. I found that if you have larger files this single function might be taking up over half of the processing time because of how many times it is used in the module. - Fully implemented raw saving.
- Extended the
Contact
class to have more properties. - Added new function
MSGFile._ensureSetTyped
which acts like the other ensure set functions but doesn't require you to know the type. Prefer to use other ensure set function when you know exactly what type it will be. - Changed
Message.saveRaw
toMSGFile.saveRaw
. - Changed
MSGFile.saveRaw
to take a path and save the contents to a zip file. - Corrected the help doc to reflect the current repository (was still on mattgwwalker).
- Fixed a bug that would cause an exception on trying to access the RTF body on a file that didn't have one. This is now correctly returning
None
. - The
raw
keyword ofMessage.save
now actually works. - Added property
Attachment.randomFilename
which allows you to get the randomly generated name for attachments that don't have a usable one otherwise. - Added function
Attachment.regenerateRandomName
for creating a new random name if necessary. - Added function
Attachment.getFilename
. This function is used to get the name an attachment will be saved with given the specified arguments. Arguments are identical toAttachment.save
. - Changed pull requests to reflect new style.
- Added additional properties for defined MSG file fields.
- Added zip file support for the
Attachment.save
andMessage.save
. Simply pass a path for thezip
keyword argument and it will create a newZipFile
instance and save all of it's data inside there. Alternatively, you can pass an instance of a class that is either aZipFile
orZipFile
-like and it will simply use that. When this argument is defined, thecustomPath
argument refers to the path inside the zip file. - Added the
html
andrtf
keywords toMessage.save
. These will attempt to save the body in the html or rtf format, respectively. If the program cannot save in those formats, it will raise an exception unless theallowFallback
keyword argument isTrue
. - Changed
utils.hasLen
to usehasattr
instead of the try-except method it was using. - Added new option
recipientSeparator
toMessageBase
allowing you to specify a custom recipient separator (default is ";" to match Microsoft Outlook). - Changed the
openMsg
function inAttachment
to not be strict. This allows you to actually open the MSG file even if we don't recognize the type of embedded MSG that is being used. - Attempted to normalize encoding names throughout the module so that a certain encoding will only show up using one name and not multiple.
- Finally figured out what CRC32 algorithm is used in named properties after directly asking in a Microsoft forum (see the thread here). Fortunately the is already defined in the
compressed-rtf
module so we can take advantage of that. - Reworked
MessageBase._genRecipient
to improve it (because what on earth was that code it was using before?). Variables in the function are now more descriptive. Added comments in several places. - Many renames to better fit naming convention:
dev.setup_dev_logger
todev.setupDevLogger
.MSGFile.fix_path
toMSGFile.fixPath
.MessageBase.save_attachments
toMessageBase.saveAttachments
.*.Exists
toexists
.*.ExistsTypedProperty
to*.existsTypedProperty
.prop.create_prop
toprop.createProp
.Properties.attachment_count
toProperties.attachmentCount
.Properties.next_attachment_id
toProperties.nextAttachmentId
.Properties.next_recipient_id
toProperties.nextRecipientId
.Properties.recipient_count
toProperties.recipientCount
.utils.get_command_args
toutils.getCommandArgs
.utils.get_full_class_name
toutils.getFullClassName
.utils.get_input
toutils.getInput
.utils.has_len
toutils.hasLen
.utils.setup_logging
toutils.setupLogging
.constants.int_to_data_type
toconstants.intToDataType
.constants.int_to_intelligence
toconstants.intToIntelligence
.constants.int_to_recipient_type
toconstants.intToRecipientType
.- Misc internal function variables.
Version 0.28.5
v0.28.5
- [TeamMsgExtractor #189] Forgot to import
prepareFilename
inattachment.py
. - Fixed bad link in the changelog.
Version 0.28.4
v0.28.4
- [TeamMsgExtractor #184] Added code to
Message
to ensure subjects with null characters get stripped of them. - Moved code for stripping subjects of bad characters to
prepareFilename
inutils
.
Version 0.28.3
v0.28.3
- Fixed minor typo in an exception description.
- Updated the README this time. Forgot to do it for at least 1 update.
Version 0.28.2
v0.28.2
- Started preparing more of the code for when HTML and RTF saving are fully implemented. Please note that they do not work at all right now. Commented out the code for this because it wasn't meant to be uncommented.
- [TeamMsgExtractor #184] Added code to ensure file names don't have null characters when saving an attachment.
- Minor improvement to the section of the save code that checks if you have provided incompatible options.
- [TeamMsgExtractor #185] Added the
IncompatibleOptionsError
. It was supposed to be added a few updates ago, but was accidentally left out. - Modified
Message.save
to return the currentMessage
instance to allow for chained commands. This allows you to do something likeextract_msg.openMsg("path/to/message.msg").save().close()
where you could not before.
Version 0.28.1
v0.28.1
- [TeamMsgExtractor #181] Fixed issue in
Attachment
that arose when moving some of the code to a base class. - Fixed small error in
utils.parse_type
that caused it to incorrectly compare expected and actual length. Fortunately, this had no actual effect aside from a warning. - Added the
ebcdic
module to the requirements to add more supported encodings.
Version 0.28.0
v0.28.0
- [TeamMsgExtractor #87] Added a new system to handle
NotImplementedError
and other exceptions. All msg classes now have an option calledattachmentErrorBehavior
that tells the class what to do if it has an error. The value should be one of three constants:ATTACHMENT_ERROR_THROW
,ATTACHMENT_ERROR_NOT_IMPLEMENTED
, orATTACHMENT_ERROR_BROKEN
.ATTACHMENT_ERROR_THROW
tells the class to not catch and exceptions and just let the user handle them.ATTACHMENT_ERROR_NOT_IMPLEMENTED
tells the class to catchNotImplementedError
exceptions and put an instance ofUnsupportedAttachment
in place of a regular attachment.ATTACHMENT_ERROR_BROKEN
tells the class to catch all exceptions and either replace the attachment withUnsupportedAttachment
if it is aNotImplementedError
orBrokenAttachment
for all other exceptions. With both of those options, caught exceptions will be logged. - In making the previous point work, much code from
Attachment
has been moved to a new class calledAttachmentBase
. BothBrokenAttachment
andUnsupportedAttachment
are subclasses ofAttachmentBase
meaning data can be extracted from their streams in the same way as a functioning attachment. - [TeamMsgExtractor #162] Pretty sure I actually got it this time. The execution flag should be applied by pip now.
- Fixed typos in some exceptions
Version 0.27.16
v0.27.16
- [TeamMsgExtractor #177] Fixed incorrect struct being used. It should be the correct one now, but further testing will be required to confirm this.
- Fixed log error message in
extract_msg.prop
to actually format a value into the message.
Version 0.27.15
v0.27.15
- [TeamMsgExtractor #177] Fixed missing import.