Skip to content

Commit b602f88

Browse files
eypsilonclaude
andcommitted
Release v1.0.1: Bug fixes and demo enhancements
- Fix critical bug: Inline text parts incorrectly treated as attachments - Add message size tracking and display - Enhance demo with modal animations and navigation - Improve UX with collapsed initial state and refined controls 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent f67dbf0 commit b602f88

File tree

10 files changed

+546
-390
lines changed

10 files changed

+546
-390
lines changed

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.0.1] - 2025-12-10
9+
10+
### Fixed
11+
- **Critical:** Emails with `Content-Disposition: inline` on text/plain or text/html parts were incorrectly treated as attachments instead of body content
12+
- Affected newsletters and marketing emails (e.g., STRATO newsletters) that appeared empty with body parts listed as attachments
13+
- Modified `ImapClient::isAttachmentPart()` to check content type before disposition
14+
- Text parts with inline disposition are now correctly treated as body content
15+
16+
### Added
17+
- Message size tracking and display
18+
- Individual message sizes shown for each message (content-based: text + HTML + attachments)
19+
- Total size counter in messages header with message count
20+
- Smart formatting (B/KB/MB units)
21+
- Typically 79-86% of RFC822 message size (excludes headers, MIME boundaries, encoding overhead)
22+
23+
### Changed
24+
- **Demo improvements:**
25+
- Modal animations: Smooth slide-up/down transitions on open/close
26+
- Modal navigation: Previous/Next buttons for browsing messages without closing modal
27+
- Select elements: Fixed read/unread and answered/unanswered selects to use consistent option ordering
28+
- Initial state: Messages now arrive collapsed by default with synchronized toggle button
29+
30+
### Files Modified
31+
- `src/ImapClient.php` - Fixed attachment detection logic, added size calculation
32+
- `src/Message.php` - Added size property with getter/setter
33+
- `src/ImapService.php` - Added 'size' field to serialization
34+
- `src/ServiceConfig.php` - Added 'size' to DEFAULT_FIELDS
35+
- `example/get.php` - Size formatting and field inclusion
36+
- `example/index.php` - Modal UX enhancements, size display, collapsed state
37+
38+
[1.0.1]: https://github.com/yaijs/php-ymap/releases/tag/v1.0.1
39+
840
## [1.0.0] - 2025-01-XX
941

1042
### Added

README.md

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -344,98 +344,3 @@ No additional tooling is required. PHPStan level is configured in `phpstan.neon`
344344
## License
345345

346346
MIT
347-
348-
349-
```json
350-
{
351-
"imapProviders": [
352-
{
353-
"name": "Gmail / Google Workspace",
354-
"host": "imap.gmail.com:993",
355-
"mailbox": "{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX",
356-
"boxes": ["INBOX", "[Gmail]/Sent Mail", "[Gmail]/Drafts", "[Gmail]/Spam", "[Gmail]/Trash"],
357-
"notes": "Requires App Password (2FA enabled) or OAuth2 for Google Workspace"
358-
},
359-
{
360-
"name": "Outlook.com / Hotmail / Office 365",
361-
"host": "outlook.office365.com:993",
362-
"mailbox": "{outlook.office365.com:993/imap/ssl/novalidate-cert}INBOX",
363-
"boxes": ["INBOX", "Sent", "Drafts", "Junk", "Trash", "Archive"],
364-
"notes": "Works with normal password or App Password"
365-
},
366-
{
367-
"name": "Microsoft Exchange (on-prem or hybrid)",
368-
"host": "mail.yourcompany.com:993",
369-
"mailbox": "{mail.yourcompany.com:993/imap/ssl/novalidate-cert}INBOX",
370-
"boxes": ["INBOX", "Sent Items", "Drafts", "Junk Email", "Deleted Items"],
371-
"notes": "Replace with your actual domain. Often needs /novalidate-cert"
372-
},
373-
{
374-
"name": "iCloud",
375-
"host": "imap.mail.me.com:993",
376-
"mailbox": "{imap.mail.me.com:993/imap/ssl/novalidate-cert}INBOX",
377-
"boxes": ["INBOX", "Sent Messages", "Drafts", "Junk", "Trash", "Archive"],
378-
"notes": "Use Apple ID + App-Specific Password"
379-
},
380-
{
381-
"name": "Yahoo Mail",
382-
"host": "imap.mail.yahoo.com:993",
383-
"mailbox": "{imap.mail.yahoo.com:993/imap/ssl/novalidate-cert}INBOX",
384-
"boxes": ["INBOX", "Sent", "Draft", "Bulk", "Trash", "Archive"],
385-
"notes": "Requires App Password (under Account Security)"
386-
},
387-
{
388-
"name": "AOL Mail",
389-
"host": "imap.aol.com:993",
390-
"mailbox": "{imap.aol.com:993/imap/ssl/novalidate-cert}INBOX",
391-
"boxes": ["INBOX", "Sent", "Saved", "Spam", "Trash"],
392-
"notes": "Use App Password"
393-
},
394-
{
395-
"name": "1&1 IONOS (DE/UK/ES)",
396-
"host": "imap.ionos.de:993",
397-
"mailbox": "{imap.ionos.de:993/imap/ssl/novalidate-cert}INBOX",
398-
"boxes": ["INBOX", "Sent", "Drafts", "Spam", "Trash"],
399-
"notes": "Also works: imap.ionos.co.uk, imap.ionos.es, imap.ionos.com"
400-
},
401-
{
402-
"name": "Strato",
403-
"host": "imap.strato.de:993",
404-
"mailbox": "{imap.strato.de:993/imap/ssl/novalidate-cert}INBOX",
405-
"boxes": ["INBOX", "Sent", "Drafts", "Spam", "Trash"]
406-
},
407-
{
408-
"name": "GMX",
409-
"host": "imap.gmx.net:993",
410-
"mailbox": "{imap.gmx.net:993/imap/ssl/novalidate-cert}INBOX",
411-
"boxes": ["INBOX", "Sent", "Drafts", "Spam", "Trash"],
412-
"notes": "Also: imap.gmx.com"
413-
},
414-
{
415-
"name": "WEB.DE",
416-
"host": "imap.web.de:993",
417-
"mailbox": "{imap.web.de:993/imap/ssl/novalidate-cert}INBOX",
418-
"boxes": ["INBOX", "Gesendet", "Entwürfe", "Spam", "Papierkorb"]
419-
},
420-
{
421-
"name": "hosteurope / PlusServer",
422-
"host": "imap.hosteurope.de:993",
423-
"mailbox": "{imap.hosteurope.de:993/imap/ssl/novalidate-cert}INBOX",
424-
"boxes": ["INBOX", "Sent", "Drafts", "Trash"]
425-
},
426-
{
427-
"name": "All-inkl",
428-
"host": "imap.all-inkl.com:993",
429-
"mailbox": "{imap.all-inkl.com:993/imap/ssl/novalidate-cert}INBOX",
430-
"boxes": ["INBOX", "Sent", "Drafts", "Trash"]
431-
},
432-
{
433-
"name": "Zoho Mail",
434-
"host": "imap.zoho.eu:993",
435-
"mailbox": "{imap.zoho.eu:993/imap/ssl/novalidate-cert}INBOX",
436-
"boxes": ["INBOX", "Sent", "Drafts", "Spam", "Trash"],
437-
"notes": "Use imap.zoho.com (US) or imap.zoho.eu / .au / .in depending on region"
438-
}
439-
]
440-
}
441-
```

example/get.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Yai\Ymap\Exceptions\ConnectionException;
99

1010
error_reporting(E_ALL);
11-
ini_set('display_errors', '0');
1211

1312
header('Content-Type: application/json');
1413

@@ -62,6 +61,7 @@
6261
'attachments',
6362
'seen',
6463
'answered',
64+
'size',
6565
'preview',
6666
])
6767
->limit((int) ($_POST['limit'] ?? 10))
@@ -142,6 +142,17 @@
142142
$bodyPreview = mb_substr($body, 0, $bodyLength);
143143
$isTruncated = mb_strlen($body) > $bodyLength;
144144

145+
$size = (int) ($msg['size'] ?? 0);
146+
if ($size >= 1048576) {
147+
$sizeFormatted = number_format($size / 1048576, 1) . ' MB';
148+
} elseif ($size >= 1024) {
149+
$sizeFormatted = number_format($size / 1024, 1) . ' KB';
150+
} elseif ($size > 0) {
151+
$sizeFormatted = $size . ' B';
152+
} else {
153+
$sizeFormatted = '-';
154+
}
155+
145156
return [
146157
'uid' => $msg['uid'],
147158
'subject' => $msg['subject'] ?? '',
@@ -156,6 +167,8 @@
156167
'htmlBody' => $msg['htmlBody'] ?? null,
157168
'seen' => (bool) ($msg['seen'] ?? false),
158169
'answered' => (bool) ($msg['answered'] ?? false),
170+
'size' => $size,
171+
'sizeFormatted' => $sizeFormatted,
159172
'attachments' => array_map(static fn($a) => [
160173
'filename' => $a['filename'],
161174
'size' => $a['size'],

0 commit comments

Comments
 (0)