ikvk / imap_tools

Work with email by IMAP
Apache License 2.0
721 stars 83 forks source link

Multiple or conditions do not work with GMX #222

Closed mcico closed 1 year ago

mcico commented 1 year ago

Good Afternoon,

I started using imap_tools to filter mails over various mail accounts (e.g. fastmail, gmx).

I want to filter out mails from various senders, and to do so, I do the following (OR(from_=["@icloud.com", "no-reply@netdata.cloud"]

When I use this criteria to get mails from Fastmail they are correctly filtered, but when I do the same with GMX, all mails are returned instead of the ones that match the from criteria.

In #162 the explanation was given that not all imap servers can handle the logical operators properly according to RFC3501. Maybe GMX has troubles to handle this query, is there a way I can get around that except of handling the criteria myself in the code? Not sure if adding parenthesis would even help in this situation.

cheers & thanks, marco

ikvk commented 1 year ago
  1. is there a way I can get around that except of handling the criteria myself in the code

in lib - no, but handling the criteria by hands - it is not bad ).

  1. you cat try various cases for criteria at GMX:

    mailbox.fetch('TEXT "hello"')          # str
    mailbox.fetch(b'TEXT "\xd1\x8f"')      # bytes

    May be you can find reason of fail or bug at GMX.

ikvk commented 1 year ago

*Greet )

mcico commented 1 year ago

Thanks for the answer, I will check it out and let GMX know if they can fix it on their side.