Skip to content

Commit ca98a9e

Browse files
committed
php-imap updated to v3
1 parent e19068a commit ca98a9e

File tree

3 files changed

+95
-8
lines changed

3 files changed

+95
-8
lines changed

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,79 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
1515
- NaN
1616

1717

18+
## [3.0.0-alpha] - 2021-11-10
19+
### Fixed
20+
- Debug line position fixed
21+
- Handle incomplete address to string conversion
22+
- Configured message key gets overwritten by the first fetched message
23+
- Attachment::save() return error 'A facade root has not been set'
24+
- Unused dependencies removed
25+
- Fix PHP 8 error that changes null back in to an empty string. (thanks @mennovanhout)
26+
- Fix regex to be case insensitive (thanks @mennovanhout)
27+
- Attachment detection updated
28+
- Timeout handling improved
29+
- Additional utf-8 checks added to prevent decoding of unencoded values
30+
- Boundary detection simplified
31+
- Prevent potential body overwriting
32+
- CSV files are no longer regarded as plain body
33+
- Boundary detection overhauled to support "related" and "alternative" multipart messages
34+
- Attachment saving filename fixed
35+
- Unnecessary parameter removed from `Client::getTimeout()`
36+
- Missing encryption variable added - could have caused problems with unencrypted communications
37+
- Prefer attachment filename attribute over name attribute
38+
- Missing connection settings added to `Folder:idle()` auto mode
39+
- Message move / copy expect a folder path
40+
- `Client::getFolder()` updated to circumvent special edge cases
41+
- Missing connection status checks added to various methods
42+
- Unused default attribute `message_no` removed from `Message::class`
43+
- Fix setting default mask from config (thanks @shacky)
44+
- Chunked fetch fails in case of less available mails than page size
45+
- Protocol::createStream() exception information fixed
46+
- Legacy methods (headers, content, flags) fixed
47+
- Legacy connection cycle fixed (thanks @zssarkany)
48+
- Several POP3 fixes (thanks @Korko)
49+
- Fixes handling of long header lines which are seperated by `\r\n\t` (thanks @Oliver-Holz)
50+
- Fixes to line parsing with multiple addresses (thanks @Oliver-Holz)
51+
- Fixed problem with skipping last line of the response. (thanks @szymekjanaczek)
52+
- Extend date parsing error message
53+
- Fixed 'Where' method replaces the content with uppercase
54+
- Don't surround numeric search values with quotes
55+
- Context added to `InvalidWhereQueryCriteriaException`
56+
- Redundant `stream_set_timeout()` removed
57+
58+
### Added
59+
- Auto reconnect option added to `Folder::idle()`
60+
- Dynamic Attribute access support added (e.g `$message->from[0]`)
61+
- Message not found exception added
62+
- Chunked fetching support added `Query::chunked()`. Just in case you can't fetch all messages at once
63+
- "Soft fail" support added
64+
- Count method added to `Attribute:class`
65+
- Convert an Attribute instance into a Carbon date object
66+
- Disable rfc822 header parsing via config option
67+
- Added imap 4 handling. (thanks @szymekjanaczek)
68+
- Added laravel's conditionable methods. (thanks @szymekjanaczek)
69+
- Expose message folder path (thanks @Magiczne)
70+
- Adds mailparse_rfc822_parse_addresses integration (thanks @Oliver-Holz)
71+
- Added moveManyMessages method (thanks @Magiczne)
72+
- Added copyManyMessages method (thanks @Magiczne)
73+
- Added `UID` as available search criteria (thanks @szymekjanaczek)
74+
- Make boundary regex configurable (thanks @EthraZa)
75+
- IMAP ID support added
76+
- Enable debug mode via config
77+
- Custom UID alternative support added
78+
- Fetch additional extensions using `Folder::query(["FEATURE_NAME"])`
79+
- Optionally move a message during "deletion" instead of just "flagging" it (thanks @EthraZa)
80+
- `WhereQuery::where()` accepts now a wide range of criteria / values.
81+
82+
### Breaking changes
83+
- A new exception can occur if a message can't be fetched (`\Webklex\PHPIMAP\Exceptions\MessageNotFoundException::class`)
84+
- `Message::move()` and `Message::copy()` no longer accept folder names as folder path
85+
- A `Message::class` instance might no longer have a `message_no` attribute
86+
- All protocol methods which had a `boolean` `$uid` option no longer support a boolean. Use `IMAP::ST_UID` or `IMAP::NIL` instead. If you want to use an alternative to `UID` just use the string instead.
87+
- Default config option `options.sequence` changed from `IMAP::ST_MSGN` to `IMAP::ST_UID`.
88+
- `Folder::query()` no longer accepts a charset string. It has been replaced by an extension array, which provides the ability to automatically fetch additional features.
89+
90+
1891
## [2.4.0] - 2021-01-09
1992
### Fixed
2093
- Attachment::save() return error 'A facade root has not been set'

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"ext-mbstring": "*",
2727
"ext-iconv": "*",
2828
"ext-fileinfo": "*",
29-
"webklex/php-imap": "^2.4",
29+
"webklex/php-imap": "^3.0",
3030
"laravel/framework": ">=5.0.0"
3131
},
3232
"autoload": {

src/config/imap.php

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@
6060
'request_fulluri' => false,
6161
'username' => null,
6262
'password' => null,
63-
]
63+
],
64+
"timeout" => 30,
65+
"extensions" => []
6466
],
6567

6668
/*
@@ -96,7 +98,7 @@
9698
| This option is only used when calling $oClient->
9799
| You can use any supported char such as ".", "/", (...)
98100
| -Fetch option:
99-
| IMAP::FT_UID - Message marked as read by fetching the message body
101+
| IMAP::FT_UID - Message marked as read by fetching the body message
100102
| IMAP::FT_PEEK - Fetch the message without setting the "seen" flag
101103
| -Fetch sequence id:
102104
| IMAP::ST_UID - Fetch message components using the message uid
@@ -105,8 +107,16 @@
105107
| Default TRUE
106108
| -Flag download option
107109
| Default TRUE
110+
| -Soft fail
111+
| Default FALSE - Set to TRUE if you want to ignore certain exception while fetching bulk messages
112+
| -RFC822
113+
| Default TRUE - Set to FALSE to prevent the usage of \imap_rfc822_parse_headers().
114+
| See https://github.com/Webklex/php-imap/issues/115 for more information.
115+
| -Debug enable to trace communication traffic
116+
| -Boundary regex used to detect message boundaries. If you are having problems with empty messages, missing
117+
| attachments or anything like this. Be advised that it likes to break which causes new problems..
108118
| -Message key identifier option
109-
| You can choose between 'id', 'number' or 'list'
119+
| You can choose between the following:
110120
| 'id' - Use the MessageID as array key (default, might cause hickups with yahoo mail)
111121
| 'number' - Use the message number as array key (isn't always unique and can cause some interesting behavior)
112122
| 'list' - Use the message list number as array key (incrementing integer (does not always start at 0 or 1)
@@ -132,9 +142,13 @@
132142
'options' => [
133143
'delimiter' => '/',
134144
'fetch' => \Webklex\PHPIMAP\IMAP::FT_PEEK,
135-
'sequence' => \Webklex\PHPIMAP\IMAP::ST_MSGN,
145+
'sequence' => \Webklex\PHPIMAP\IMAP::ST_UID,
136146
'fetch_body' => true,
137147
'fetch_flags' => true,
148+
'soft_fail' => false,
149+
'rfc822' => true,
150+
'debug' => false,
151+
'boundary' => '/boundary=(.*?(?=;)|(.*))/i',
138152
'message_key' => 'list',
139153
'fetch_order' => 'asc',
140154
'dispositions' => ['attachment', 'inline'],
@@ -145,12 +159,12 @@
145159
"sent" => "INBOX/Sent",
146160
"trash" => "INBOX/Trash",
147161
],
148-
'open' => [
149-
// 'DISABLE_AUTHENTICATOR' => 'GSSAPI'
150-
],
151162
'decoder' => [
152163
'message' => 'utf-8', // mimeheader
153164
'attachment' => 'utf-8' // mimeheader
165+
],
166+
'open' => [
167+
// 'DISABLE_AUTHENTICATOR' => 'GSSAPI'
154168
]
155169
],
156170

0 commit comments

Comments
 (0)