Comments (8)
I tested this case and share what I found.
gmail imap server changed email state from unread
to read
when fetching whole RFC822.
in that case, it sends one more untagged response which does not include RFC822
.
>>> 3 UID FETCH 62 (UID RFC822)\r\n
<<< * 2 FETCH (UID 62 RFC822 {5140}\r\n
<<< ... # mime data
<<< FLAGS (\Seen))\r\n
<<< * 2 FETCH (UID 62 FLAGS (\Seen))\r\n # one more untagged response without RFC822 data
<<< 3 OK Success\r\n
mailio::imap::fetch
throws Parsing failure imap_error
by following line because it didn't get literal response.
Line 449 in 1124e1e
from mailio.
You can try this fix. I have to test it a little bit more.
from mailio.
I have made the most peculiar discovery! The parsing error occurs if the message is unread and does not when the message is read! I have no clue why this could be the case, but I am certainly hoping for a fix.
from mailio.
the
std::cout << message.subject_raw() << std::endl;
line in the for loop results in the imap_error exception being thrown.exception.what()
returnsParsing failure.
message.subject_raw()
throws no exception.
it may be thrown in fetch
method
from mailio.
My apologies! I double checked and that is indeed the case. However, I still find it a bit absurd that an unread email causes an issue and a read email does not. I am sure there is a perfectly reasonable explanation, but surely other people must have run into this issue? Is there a known fix to this?
Additional information: when retrieving an email with header_only selected, there is no issue. It is only when I want the full email.
from mailio.
Interesting, let me try to reproduce it.
from mailio.
Gmail and Outlook send more tokens after the string literal, in this case this is the line FLAGS (\Seen))
.
@yjm6560 you are right about the line that throws the exception, thanks for the analysis. If I remove it, then it seems that the message is correctly read even it is unread. As a quick fix, this else statement can be removed, so the unread messages should be correctly read.
I am working on a proper fix to allow parser also to check this additional tokens. I have IMAP auto tests not published here which I'll have also to run in order to check whether something else is broken.
Sorry for taking so long to reply, I am dealing now with this problem.
from mailio.
The fix does not break existing functionalities, so I am closing it.
from mailio.
Related Issues (20)
- [Question] Image in the body of the message HOT 10
- Please, could anyone provide me an example of how to get the mail content as a unencoded string? HOT 2
- Linking errors HOT 11
- Is it ok to use `-std=c++17` instead of `-std=gnu++1z` HOT 1
- smtps::connection::submit response HOT 2
- add_bcc_recipient HOT 8
- Switching to SSL failed HOT 6
- Allow formatting of BCC addresses HOT 2
- when parsing the header of this mime crashed! HOT 14
- mailio stop working with vcpkg? HOT 1
- How to handle the inline image in the mime data? HOT 1
- Tests fail to link: ld: error: undefined symbol: main HOT 3
- Tests fail: error: in "format_attachment_utf8": check ... has failed HOT 2
- problem with static library version HOT 3
- error when linking statically HOT 1
- It looks like a problem with the SSL verification. HOT 2
- Problem when linking the "simple smtp message" example with mingw. HOT 3
- Line policy overflow in a header (mime.cpp) HOT 5
- Devivery report is not received, is it normal ? Event I added header for it !!! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailio.