Unexpected input while parsing- with an outlook.com account #195

Closed
opened 2022-10-18 09:51:38 +03:00 by asdf8dfafjk · 21 comments

I get the following error with an outlook.com account.


NORMAL | Unexpected input while parsing UID FETCH responses: `* 202 FETCH (UID 7608 FLAGS (\Seen) ENVE`, Unexpected input while parsing UID FETCH re   Invalid number of options.

My settings are as follows:

[accounts."billgates@live.com"]
root_mailbox = 'Inbox'
format = "imap"
server_hostname='outlook.office365.com'
server_username="billgates@live.com"
server_password="RichestManOnEarth"
server_port="993"  
identity = "billgates@live.com"
display_name = "Bill Gates"
subscribed_mailboxes = ["*" ]

I get the following error with an outlook.com account. ``` NORMAL | Unexpected input while parsing UID FETCH responses: `* 202 FETCH (UID 7608 FLAGS (\Seen) ENVE`, Unexpected input while parsing UID FETCH re Invalid number of options. ``` My settings are as follows: ``` [accounts."billgates@live.com"] root_mailbox = 'Inbox' format = "imap" server_hostname='outlook.office365.com' server_username="billgates@live.com" server_password="RichestManOnEarth" server_port="993" identity = "billgates@live.com" display_name = "Bill Gates" subscribed_mailboxes = ["*" ] ```

Thanks for the bug report! I tried to reproduce this with an outlook.com account but could not. This may be caused by a specific case of an email. Would you be able to apply this small patch and paste here the IMAP server's response that causes the error (censored to remove private information)

diff --git a/melib/src/backends/imap/protocol_parser.rs b/melib/src/backends/imap/protocol_parser.rs
index d546078e..c8374919 100644
--- a/melib/src/backends/imap/protocol_parser.rs
+++ b/melib/src/backends/imap/protocol_parser.rs
@@ -735,6 +735,14 @@ pub fn fetch_responses(mut input: &[u8]) -> ImapParseResult<Vec<FetchResponse<'_
                 ret.push(el);
             }
             Err(err) => {
+                crate::log(
+                    format!(
+                        "Unexpected input while parsing UID FETCH responses: `{}`, {}",
+                        String::from_utf8_lossy(input),
+                        err
+                    ),
+                    crate::ERROR,
+                );
                 return Err(MeliError::new(format!(
                     "Unexpected input while parsing UID FETCH responses: `{:.40}`, {}",
                     String::from_utf8_lossy(input),

save as a text file (e.g. imap.patch) and apply with git apply imap.patch in the root repository directory.

Then, when the error happens again it will get logged to $XDG_DATA_HOME/meli/meli.log (/home/user/.local/share/meli/meli.log)

Thanks for the bug report! I tried to reproduce this with an outlook.com account but could not. This may be caused by a specific case of an email. Would you be able to apply this small patch and paste here the IMAP server's response that causes the error (censored to remove private information) ```diff diff --git a/melib/src/backends/imap/protocol_parser.rs b/melib/src/backends/imap/protocol_parser.rs index d546078e..c8374919 100644 --- a/melib/src/backends/imap/protocol_parser.rs +++ b/melib/src/backends/imap/protocol_parser.rs @@ -735,6 +735,14 @@ pub fn fetch_responses(mut input: &[u8]) -> ImapParseResult<Vec<FetchResponse<'_ ret.push(el); } Err(err) => { + crate::log( + format!( + "Unexpected input while parsing UID FETCH responses: `{}`, {}", + String::from_utf8_lossy(input), + err + ), + crate::ERROR, + ); return Err(MeliError::new(format!( "Unexpected input while parsing UID FETCH responses: `{:.40}`, {}", String::from_utf8_lossy(input), ``` save as a text file (e.g. `imap.patch`) and apply with `git apply imap.patch` in the root repository directory. Then, when the error happens again it will get logged to `$XDG_DATA_HOME/meli/meli.log` (`/home/user/.local/share/meli/meli.log`)
Manos Pitsidianakis added the
IMAP
bug
labels 2022-10-18 12:22:13 +03:00

Related to #128

Related to #128

@asdf8dfafjk did you manage to get that debug output?

@asdf8dfafjk did you manage to get that debug output?

Oh wow, I don't know how I missed your helpful patch. I'm going to apply it and let you know.

Oh wow, I don't know how I missed your helpful patch. I'm going to apply it and let you know.

For some reason I got email only for the "related to 128" comment, not the patch.

For some reason I got email only for the "related to 128" comment, not the patch.

@asdf8dfafjk understandable, no worries. Sorry for the confusion!

@asdf8dfafjk understandable, no worries. Sorry for the confusion!

Hi, I have the errors. Any chance I could send it to a private address of yours? I wouldn't want to remove any useful information in the process of sanitizing it.

Hi, I have the errors. Any chance I could send it to a private address of yours? I wouldn't want to remove any useful information in the process of sanitizing it.

@asdf8dfafjk yes, try removed

@asdf8dfafjk yes, try ~~removed~~

I emailed you the logs

I emailed you the logs

Hi, I know I should communicate how it went but the fact is that for some reason I cannot compile the latest github version on Nix (my fault for spending so much time trying to overrideAttrs * for buildRustPackage * that I can no longer afford to go the patch way for a few weeks)

Sorry! And thanks for the change.

* I think you use nix yourself?

Hi, I know I should communicate how it went but the fact is that for some reason I cannot compile the latest github version on Nix (my fault for spending so much time trying to `overrideAttrs` * for `buildRustPackage` * that I can no longer afford to go the patch way for a few weeks) Sorry! And thanks for the change. \* I think you use nix yourself?

@asdf8dfafjk No I don't use nix so I don't know how to help you with this unfortunately. And I'm not confident there's enough visibility here for other people who know nix to help...

You can post the error here in case someone can help?

@asdf8dfafjk No I don't use nix so I don't know how to help you with this unfortunately. And I'm not confident there's enough visibility here for other people who know nix to help... You can post the error here in case someone can help?

Thank you for your kind offer, but I don't need help, I mentioned the nix part because I was using some nix specific terms in there (overrideAttrs etc) and because your installation section mentions nix specifically. I know all the steps, just that they would take some time.

Thank you for your kind offer, but I don't need help, I mentioned the nix part because I was using some nix specific terms in there (`overrideAttrs` etc) and because your installation section mentions nix specifically. I know all the steps, just that they would take some time.

Hi, I just realized that I had patched 0.7.2 with the patch you gave me, and not the then git head.

Hi, I just realized that I had patched 0.7.2 with the patch you gave me, and not the then git head.

@asdf8dfafjk ah alright. Is everything working now?

@asdf8dfafjk ah alright. Is everything working now?

I'm still struggling with the nix expression, the patch approach I was going to take also failed, I'm going to wait for an update in the repositories. :-(

I'm still struggling with the nix expression, the patch approach I was going to take also failed, I'm going to wait for an update in the repositories. :-(

If anyone else wants to take a stab, here's my expr so far, fails with the following message,

		pkgs.versioned.altLatest.meli.overrideAttrs 
			(
				oldAttrs:
				rec {
		 				version = "custom"; 
						src = pkgs.fetchgit {
							url = "https://git.meli.delivery/meli/meli.git";
		 					rev    = "88a1f0d4bc17b60f8f23ea71f33a81aee78f8769";
		 					sha256 = "0g395457m3mgajggp6xadrmdl50qxijhpd95ax47snxkkh3nb451";
		 				};
						buildInputs = oldAttrs.buildInputs ++ [ pkgs.versioned.latest.mandoc ];
						cargoBuildFlags = [ "--no-default-features --features=notmuch" ] ;

						cargoDeps = oldAttrs.cargoDeps.overrideAttrs (
							lib.const {
								name = "meli-vendor.tar.gz";
								inherit src;
									outputHash = "1niyr6xvbxyfvbgg2zmvfb7z6br0zhiq9y1s80njjy15qq094jvs";
								}
						);
				}
			)

  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:59:18

If anyone else wants to take a stab, here's my expr so far, fails with the following message, ``` pkgs.versioned.altLatest.meli.overrideAttrs ( oldAttrs: rec { version = "custom"; src = pkgs.fetchgit { url = "https://git.meli.delivery/meli/meli.git"; rev = "88a1f0d4bc17b60f8f23ea71f33a81aee78f8769"; sha256 = "0g395457m3mgajggp6xadrmdl50qxijhpd95ax47snxkkh3nb451"; }; buildInputs = oldAttrs.buildInputs ++ [ pkgs.versioned.latest.mandoc ]; cargoBuildFlags = [ "--no-default-features --features=notmuch" ] ; cargoDeps = oldAttrs.cargoDeps.overrideAttrs ( lib.const { name = "meli-vendor.tar.gz"; inherit src; outputHash = "1niyr6xvbxyfvbgg2zmvfb7z6br0zhiq9y1s80njjy15qq094jvs"; } ); } ) ``` ``` thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:59:18 ```

Working version for anyone on nix:

		pkgs.versioned.latest.meli.overrideAttrs 
			(
				oldAttrs:
				rec {
		 				version = "custom"; 
						src = pkgs.fetchgit {
							url = "https://git.meli.delivery/meli/meli.git";
		 					rev    = "88a1f0d4bc17b60f8f23ea71f33a81aee78f8769";
		 					sha256 = "0g395457m3mgajggp6xadrmdl50qxijhpd95ax47snxkkh3nb451";
		 				};
						buildInputs = oldAttrs.buildInputs ++ [ pkgs.versioned.latest.mandoc ];
						cargoBuildFlags = [ "--no-default-features --features=notmuch" ] ;
						dontCargoCheck = true;

						cargoDeps = oldAttrs.cargoDeps.overrideAttrs (
							lib.const {
								name = "meli-vendor.tar.gz";
								inherit src;
									outputHash = "1niyr6xvbxyfvbgg2zmvfb7z6br0zhiq9y1s80njjy15qq094jvs";
								}
						);
				}
			)
Working version for anyone on nix: ``` pkgs.versioned.latest.meli.overrideAttrs ( oldAttrs: rec { version = "custom"; src = pkgs.fetchgit { url = "https://git.meli.delivery/meli/meli.git"; rev = "88a1f0d4bc17b60f8f23ea71f33a81aee78f8769"; sha256 = "0g395457m3mgajggp6xadrmdl50qxijhpd95ax47snxkkh3nb451"; }; buildInputs = oldAttrs.buildInputs ++ [ pkgs.versioned.latest.mandoc ]; cargoBuildFlags = [ "--no-default-features --features=notmuch" ] ; dontCargoCheck = true; cargoDeps = oldAttrs.cargoDeps.overrideAttrs ( lib.const { name = "meli-vendor.tar.gz"; inherit src; outputHash = "1niyr6xvbxyfvbgg2zmvfb7z6br0zhiq9y1s80njjy15qq094jvs"; } ); } ) ```

The outlook.com account works fine now, thank you!

The outlook.com account works fine now, thank you!

On that note, would you consider tagging a new alpha release sometime that these changes can be picked up?

On that note, would you consider tagging a new alpha release sometime that these changes can be picked up?

@asdf8dfafjk yeah I've been delaying it because there are some small visual bugs in the mailbox lists.. I don't want to tag a commit with known problems. But that means I keep delaying it until I fix them :/

@asdf8dfafjk yeah I've been delaying it because there are some small visual bugs in the mailbox lists.. I don't want to tag a commit with known problems. But that means I keep delaying it until I fix them :/

My personal opinion is that end users always of alpha software know what they are getting so as long as they get current best they are happy, that said my brief interaction so far tells me that you know best!

My personal opinion is that end users always of alpha software know what they are getting so as long as they get current best they are happy, that said my brief interaction so far tells me that you know best!
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: meli/meli#195
There is no content yet.