mail2googlegroup icon indicating copy to clipboard operation
mail2googlegroup copied to clipboard

imap2gg: Error while interacting with the IMAP SERVER: ''MailBox' object has no attribute '_criteria_encoder''

Open olso opened this issue 4 years ago • 7 comments

Hey, great project, would like to get it working, any ideas what might be wrong?

I'm not using any filters

olso avatar Feb 17 '21 20:02 olso

I ran into the same problem but noticed that the code in question had been removed from an earlier version of an imported library. After running pip install imap-tools==0.22.0 it started working for me. Not sure if this is ideal since imap-tools is currently version 0.31 but at least it should get you started.

switchdk avatar Mar 29 '21 09:03 switchdk

~~I was getting the same error, and after downgrading to imap-tools==0.30.0 everything works as expected. This is somehow related to issue #3. @XaviTorello I think that after you downgraded the library you didn't make a release (or the release was wrong), because doing a pip install mail2gg I got the latest imap-tools release, currently 0.39.0, not the fixed 0.30.0 version we're supposed to get.~~

I was wrong: version 0.30.0 also fails, it worked just because I had the "count=1" fix. Version 0.22.0 works fine.

sdepablos avatar Apr 14 '21 14:04 sdepablos

Same: Gmail to Google Group

Honestly, I don't know how to apply your fix.

I think this should be mentioned in README if possible until an official update fixing the things arrives.

vazome avatar Nov 08 '21 16:11 vazome

Running into the same issue here. Syncing from a Dreamhost IMAP server. Will post back if I find a solution, but would really appreciate any help.

mrk3767 avatar Jan 05 '22 18:01 mrk3767

Looks like the count=1 fix is to set the count variable to 1 on this line:

https://github.com/XaviTorello/mail2googlegroup/blob/fa835a475df9e06cf7d2ebdbccb83a269f68e84f/mail2gg/init.py#L120

Doing so prevents the code from calling search() on the remote mailbox which is where the error is coming from. I'm wondering if there are any important side-effects to not having a count...

Found this in the following issue: https://github.com/XaviTorello/mail2googlegroup/issues/5

mrk3767 avatar Jan 05 '22 19:01 mrk3767

If you are looking to get this working with the count fix, follow these instructions (Linux):

  1. Clone the repository git clone https://github.com/XaviTorello/mail2googlegroup.git
  2. Move into the directory cd mail2googlegroup
  3. Open the file with that line of code in your editor of choice vi mail2gg/__init__.py
  4. Change the count line and comment out the old value OLD -> count = self.count_elements(remote_mailbox) NEW -> count = 1 #self.count_elements(remote_mailbox)
  5. Install local package with pip3 pip3 install -e .

mrk3767 avatar Jan 05 '22 20:01 mrk3767

If you are looking to get this working with the count fix, follow these instructions (Linux):

1. Clone the repository
   `git clone https://github.com/XaviTorello/mail2googlegroup.git`

2. Move into the directory
   `cd mail2googlegroup`

3. Open the file with that line of code in your editor of choice
   `vi mail2gg/__init__.py`

4. Change the count line and comment out the old value
   OLD -> `count = self.count_elements(remote_mailbox)` NEW -> `count = 1 #self.count_elements(remote_mailbox)`

5. Install local package with pip3
   `pip3 install -e .`

Thank you so much! This finally got me up and running.

five2seven avatar Mar 03 '23 14:03 five2seven