Releases: zbateson/mail-mime-parser
3.0.3
3.0.2
3.0.1
2.4.1
3.0.0
-
Logging support, pass in a LoggerInterface to the constructor or call
MailMimeParser::setGlobalLogger. Not much is actually logged at this point
(please submit pull requests to add useful log messages) -
ErrorBag class -- most user classes extend ErrorBag which allows classes to
keep track of errors by calling addError, and users to call getErrors or
getAllErrors (to include errors in child classes).Additional validation on objects is not performed, but can be done by passing
'true' as the validate parameter on getErrors/getAllErrors. By default only
errors encountered without additional validation are added.See IErrorBag class for documentation.
-
If ParserManagerService can't find a parser for a PartBuilder,
CompatibleParserNotFoundException will be thrown. This would only happen if
customizing the used parsers passed on to ParserManagerService since the
default set includes a 'catch-all' with NonMimeParserService. -
protected AbstractHeader::setParseHeaderValue renamed to parseHeaderValue, and
signature changed. -
Can look up comment parts in headers -- use IHeader::getAllParts to return all
parsed parts including comment parts. -
GenericHeader getValue returns a string value of the combination of all its
non-comment parts. This applies to any header that doesn't have a more
specialized header type (not an address, date, id, parameter, received or
subject header), see HeaderFactory docs for specifics. -
IHeader now has a getComments() method that returns a string array of
comments. ReceivedHeader no longer has protected members $comments and
$date ($date is now private -- still has AbstractHeader::getComments(), and
ReceivedHeader::getDateTime()) -
Switched to PHP-DI, users can provide a array|string|DefinitionSource to
override definitions- Renamed service classes to clarify:
o AbstractParser -> AbstractParserService
o HeaderParser -> HeaderParserService
o IParser -> IParserService
o MessageParser -> MessageParserService
o MimeParser -> MimeParserService
o NonMimeParser -> NonMimeParserService
o ParserManager -> ParserManagerService
o All consumer classes, e.g. AbstractConsumer -> AbstractConsumerService
- Renamed service classes to clarify:
-
Refactored Header classes to depend on their respective IConsumerService
classes they need -
Refactored ConsumerService classes to define which sub-ConsumerService classes
they depend on. Removed ConsumerService. -
Cleaned up method return types and parameter types.
-
Added an AbstractHeader::from which returns IHeader objects from a passed
header line, or header name/value pair. Static method can be called on a
sub class which returns its type, for example AddressHeader::from would return
an AddressHeader regardless of the name parameter or name of header in the
passed line. -
Refactored HeaderPart classes with the following goals:
- Token classes to be used by Consumers to convert from a string to a "part".
- When processing a part, consumer may combine them into a 'ContainerPart'
array to return to a header. - Non-Token classes are "ContainerParts" and contain other HeaderParts.
- When constructing a ContainerPart, other HeaderParts can become children of
it. - HeaderPart is an ErrorBag, so it and all its children can report errors up
the chain all the way to Message.
Merged PRs
- Fix: README.md example to get person name from TO header by @Stefaans in #215
- Fix typo in the IMessage::getHtmlPart() docblock by @krisbuist in #217
- Update PHPCSFIxer by @phpfui in #218
- PHP Cs fixer update by @phpfui in #220
- Update cs fixer by @phpfui in #226
- Run tests on PHP 8.3 by @michalbundyra in #230
New Contributors
- @Stefaans made their first contribution in #215
- @krisbuist made their first contribution in #217
- @michalbundyra made their first contribution in #230
Full Changelog: 2.4.0...3.0.0
3.0.0-beta.2
- Added missing tests
- Added IMessage::getSubject
3.0.0-beta
-
Logging support, pass in a LoggerInterface to the constructor or call
MailMimeParser::setGlobalLogger. Not much is actually logged at this point
(please submit pull requests to add useful log messages) -
ErrorBag class -- most user classes extend ErrorBag which allows classes to
keep track of errors by calling addError, and users to call getErrors or
getAllErrors (to include errors in child classes).Additional validation on objects is not performed, but can be done by passing
'true' as the validate parameter on getErrors/getAllErrors. By default only
errors encountered without additional validation are added.See IErrorBag class for documentation.
-
If ParserManagerService can't find a parser for a PartBuilder,
CompatibleParserNotFoundException will be thrown. This would only happen if
customizing the used parsers passed on to ParserManagerService since the
default set includes a 'catch-all' with NonMimeParserService. -
protected AbstractHeader::setParseHeaderValue renamed to parseHeaderValue, and
signature changed. -
Can look up comment parts in headers -- use IHeader::getAllParts to return all
parsed parts including comment parts. -
GenericHeader getValue returns a string value of the combination of all its
non-comment parts. This applies to any header that doesn't have a more
specialized header type (not an address, date, id, parameter, received or
subject header), see HeaderFactory docs for specifics. -
IHeader now has a getComments() method that returns a string array of
comments. ReceivedHeader no longer has protected members $comments and
$date ($date is now private -- still has AbstractHeader::getComments(), and
ReceivedHeader::getDateTime()) -
Switched to PHP-DI, users can provide a array|string|DefinitionSource to
override definitions- Renamed service classes to clarify:
o AbstractParser -> AbstractParserService
o HeaderParser -> HeaderParserService
o IParser -> IParserService
o MessageParser -> MessageParserService
o MimeParser -> MimeParserService
o NonMimeParser -> NonMimeParserService
o ParserManager -> ParserManagerService
o All consumer classes, e.g. AbstractConsumer -> AbstractConsumerService
- Renamed service classes to clarify:
-
Refactored Header classes to depend on their respective IConsumerService
classes they need -
Refactored ConsumerService classes to define which sub-ConsumerService classes
they depend on. Removed ConsumerService. -
Cleaned up method return types and parameter types.
-
Added an AbstractHeader::from which returns IHeader objects from a passed
header line, or header name/value pair. Static method can be called on a
sub class which returns its type, for example AddressHeader::from would return
an AddressHeader regardless of the name parameter or name of header in the
passed line. -
Refactored HeaderPart classes with the following goals:
- Token classes to be used by Consumers to convert from a string to a "part".
- When processing a part, consumer may combine them into a 'ContainerPart'
array to return to a header. - Non-Token classes are "ContainerParts" and contain other HeaderParts.
- When constructing a ContainerPart, other HeaderParts can become children of
it. - HeaderPart is an ErrorBag, so it and all its children can report errors up
the chain all the way to Message.
2.4.0
What's Changed
- ReceivedHeader: incorrectly detects the IP address #152 by @mariuszkrzaczkowski in #153
- Keep multipart/alternative order for signed parts
- Fix issue setting mime content stream offsets
- Allow 'Received' hostnames without '.' chars #104
- Add 'getHeaderAs' for #140 #142
- Fix return value for getEmail
Full Changelog: 2.3.0...2.4.0
2.3.0
What's Changed
- run ci with php 8.2 by @Nielsvanpach in #208
- PHP 8.1 Deprecations fixed by @phpfui in #209
- Fixed null to string warnings in MimePart->getContentType() by @zacek in #199
- Port to PHP 7.1 by @phpfui in #211
- Return $this instead of void by @phpfui in #213
- Return valid email for quoted local-part #203
New Contributors
Full Changelog: 2.2.3...2.3.0
Huge thank you to @phpfui for this release and migration to php 7.1+.
2.2.3
What's Changed
- Fix PHP 8.1 return type deprecation notices by @joelharkes in #198
New Contributors
- @joelharkes made their first contribution in #198
Full Changelog: 2.2.2...2.2.3