Version 0.46.0
·
251 commits
to master
since this release
v0.46.0
- [TeamMsgExtractor #95] Adjusted the
overrideEncodingproperty ofMSGFileto allow automatic encoding detection. Simply set the property to the string"chardet"and, assuming thechardetmodule is installed, it will analyze a number of the strings to try and form a consensus about the encoding. This will ignore the specified encoding only if if successfully detects. Otherwise it will log a warning and fall back to the default behavior. - [TeamMsgExtractor #387] Changed
extract_msg.utils.decodeRfc2047to not throw decoding errors if the content given is not ASCII. - [TeamMsgExtractor #387] Changed header parsing policy to
email.policy.compat32to prevent partial parsing of quoted header fields. - [TeamMsgExtractor #388] Updated documentation of
MSGFile.exportto specify that updated fields on anMSGFileinstance (and it's subclasses) will not be reflected in the result of the function. Many of the functions do use the newest version of a cached_property, but this is not one of them. - Removed methods deprecated in
v0.45.0. - Changed the base class of
EntryIDfrom no base class toabc.ABC. - Added
positionproperty toEntryIDto tell how many bytes were used to create theEntryID. - Added a number of properties to
MSGFilefrom [MS-OXCMSG]. - Moved some properties down to
MessageBasefrom it's subclasses. - Added support for Journal objects.
- Changed internal code of
PermanentEntryIDto correctly parse the data. Previously the distinguished name did not actually end at the null character, instead ending at the end of the bytes provided. If there was trailing data, it would be captured inadvertently. - Finished definition for
StoreObjectEntryID. - Added new keyword arguments for MSG files:
dateFormatanddatetimeFormat. These allow the user to easily override the strings being used for format dates and dates that include a time component, respectively.- In unifying all the formats into 2 options, you may notice that some will look a bit different starting from this version, as there was an unfortunately large amount of variation.
- Fixed code for
MessageBase.parsedDatewhich could have incorrect values. - Fixed issues with
MessageBase.dateand related things either being incorrectly documented or doing things that are not specified by the documentation. It was supposed to have been changed to usedatetimeobjects, but it was still using strings. - Removed unused function
extract_msg.utils.isEmptyString. - Removed unused function
extract_msg.utils.properHex. - Added a
getStreamhelper function toCustomAttachmentHandler. - Added a
getStreamAshelper function toCustomAttachmentHandler. - Added new custom attachment handler for journal-associated attachments.
- Changed
EntryID.autoCreateto returnNoneif givenNoneor empty bytes. - Changed
EntryID.autoCreateto raise aFeatureNotImplementedexception if no valid entry ID class is found. - Fix typing annotations for
CustomAttachmentHandler. - Removed unneeded
imapclientdependency. - Changed
getJsonto have values be null if they aren't found rather than an empty string. - Implemented the
getJsonmethod correctly for a number of classes. - Changed
Task.percentCompleteto always return a float. - Changed the
NotImplementedErrorfor custom attachment handler not being found toFeatureNotImplemented. Additionally, changed the error message to specify the CLSID found on the attachment to better enable people to report issues. - Changed code for
RecipientandMessageBasethat makes it rely onMessageBase.recipientTypeClassto determine the class to use for therecipientTypeproperty. Adjusted the typing ofRecipientto have it reflect the type that will be used. - Correctly changed the returned value for
ResponseStatus.fromIterto actually return a List instead of a set. - Filled out typing information for a significant portion of the module where variables or functions were missing it. This includes the entirety of the constants submodule.
- Corrected a number of minor issues.
- Extended values for
DVAspectenum. - Added new enums to go with parsing for
OLEPresentationStream. - Changed
NNTPNewsgroupFolderEntryID.newsgroupNameto bytes instead of string since it is ANSI. - Fixed an issue that would cause headers to fail to parse properly if the header text starts with "Microsoft Mail Internet Headers Version 2.0" which is common on some MSG files. This is fixed by stripping that from the beginning before actually parsing the text. This is to circumvent CPython issue #85329, confirmed to still exist in at least some of the supported Python versions.
- Added
listDirandslistDiras methods toAttachmentBase,Recipient, andNamed. These always exclude the prefix, returning as if their directory is the root of the object. This allows the named to be directly used for accessing those files. - Numerous spelling fixes in docstrings, comments, and exceptions.
- Reduced the amount of initialization performed by
MessageBase. Much of this initialization was there from before a lot of stuff changed tocached_propertyand a number of internal variables were being used. Now all of the relevant variables will be initialized by the way they are accessed. - Added new exception
DependencyError. - Changed the errors for missing optional dependencies from
ImportErrortoDependencyError. - Removed all instances of the
rawDataproperty in favor of thetoBytesmethod. For now, many of these will simply return the raw data used, specifically those that are still unmodifiable. Any whose properties have the ability to be modified will have properly implemented versions. These classes also allowNoneto be passed as the value for their data, which will be the default if no arguments have been passed to the constructor. If no arguments orNoneis given as the data, it will create a new instance with default values. This is all in an effort to move towards the ability to create new MSG files and theMSGWriterclass. AlltoBytesmethods will either exclusively returnbytesor will returnNoneto specify that the structure isn't valid to convert to bytes. Structures that may be invalid will be annotated asOptional[bytes]for the return type.- Additionally, these objects will also support the
__bytes__method. If the object returned is not bytes, the method will throw aTypeError.
- Additionally, these objects will also support the
- Removed the individual
PropBaseflag properties and changed the mainflagsproperty to return an enum containing the flags. - Changed various data structs to allow modification and creation of new instances for writing to an MSG file.
- Changed
TZRuleto use unsigned values where applicable. - Changed
TZRuleto require the 14 null bytes (I commented it out completely on accident instead of swapping it to a plain read). It now logs a warning about the bytes not being null. - Removed unneeded function
windowsUnicode. - Moved
FixedLengthProperty.parseTypeto the private API. This was not intended for external use anyways, so leaving it as public API didn't make sense. - Fixed check for type in
ContactAddressEntryIDbeing the wrong value. - Modified
inputToBytesto support objects with the__bytes__method. If the method exists and works then it will be used as a last resort. - Modified
OleWriterto accept objects with a__bytes__method for the data to use for an entry. - Added
__bytes__method toMSGFile. This is equivalent to callingMSGFile.exportBytes.