Releases: TeamMsgExtractor/msg-extractor
Releases · TeamMsgExtractor/msg-extractor
Version 0.29.4
v0.29.4
- Fixed typo in
utils.knownMsgClass
. - Updated contributing guidelines and pull request template.
Version 0.30.0
v0.30.0
- Removed all support for Python 2. This caused a lot of things to be moved around and changed from indirect references to direct references, so it's possible something fell through the cracks. I'm doing my best to test it, but let me know if you have an issue.
- Changed classes to now prefer super() over direct superclass initialization.
- Removed explicit object subclassing (it's implicit in Python 3 so we don't need it anymore).
- Converted most
.format
s into f strings. - Improved consistency of docstrings. It's not perfect, but it should at least be better.
- Started the addition of type hints to functions and methods.
- Updated
utils.bytesToGuid
to make it faster and more efficient. - Renamed
utils.msgEpoch
toutils.filetimeToUtc
to be more descriptive. - Updated internal variable names to be more consistent.
- Improvements to the way
__main__
works. This does not affect the output it will generate, only the efficiency and readability.
Version 0.29.3
v0.29.3
- [TeamMsgExtractor #226] Fix typo in command parsing that prevented the usage of
allowFallback
. - Fixed main still manually navigating to a new directory with os.chdir instead of using
customPath
. - Fixed issue in main where the
--html
option was being using for both html and rtf. This meant if you wanted rtf it would not have used it, and if you wanted html it would have thrown an error. - Fixed
--out-name
having no effect. - Fixed
--out
having no effect.
Version 0.29.2
v0.29.2
- Fixed issue where the RTF injection was accidentally doing HTML escapes for non-encapsulated streams and not doing escapes for encapsulated streams.
- Fixed name error in
Message.save
causing bad logic. For context, the internal variablezip
was renamed to_zip
to avoid a name conflict with the built-in function. Some instances of it were missed.
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.