mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 13:05:53 +03:00
[PR #1217] [CLOSED] When reading literal_data from mail body from IMAP, use byte count instead of string-length count. #1348
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#1348
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cypht-org/cypht/pull/1217
Author: @indridieinarsson
Created: 9/1/2024
Status: ❌ Closed
Base:
master← Head:issue_1119📝 Commits (10+)
e696471Use single-byte string-length to measure length of literal data6768bccremove commented-out code9862b5aRemove comment.fd9a046Merge branch 'cypht-org:master' into issue_1119bd8b85cWait_with_folder_list when reloading folders. We're reloading the page, might have to wait.342ddcbUndo changes to reload_folder_test.2de5e36Implicitly wait 10 seconds after reloading all messagesf21011cUndo changes to selenium test. Fix wasn't working, no idea why.5152540Try to kick the main_menu reference to update.e464633stupid bug📊 Changes
2 files changed (+23 additions, -8 deletions)
View changed files
📝
modules/imap/hm-imap-base.php(+7 -6)📝
tests/selenium/folder_list.py(+16 -2)📄 Description
Pullrequest
This is a first attempt to fix issue #1119.
I'm not very proficient in php, and not knowledgeable about imap, so for the love of all that is good and holy, review and test this properly.
Take a look at this chunk from hm-imap-base.php:
If I understand this writing correctly: https://www.rfc-editor.org/rfc/rfc3501#section-4.3, the number in curly braces that is being read into $literal_size, is the number of bytes in the email body, which is then sent over the wire right away.
Therefore, all string-size calculations in
read_literal()should use thestrsizerather thanmb_strsizecommand. My theory is that the issue #1119 is caused by this: the number of bytes read are underestimated sincemb_strsizeis smaller thanstrsizefor real multibyte strings. We then end up trying to read strings from the server after the server has sent the entire message, causing the code to hang.Issues
Checklist
This touches the code that reads the email body, pretty central for an email client. This PR will change behaviour in cases when the body of the message contains multibyte characters (ÞþæÆöÖðÐáÁóÓ etc.).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.