Giter VIP home page Giter VIP logo

Comments (3)

michaelspiss avatar michaelspiss commented on June 29, 2024

Please include the log data, I can't help you otherwise. Logs can be viewed by calling printImapClientDebugLog() before any other methods. Also, which server are you trying to connect to?

from imap_client.

Youcef-Goudjal avatar Youcef-Goudjal commented on June 29, 2024

I'm trying to connect to gmail
await client.connect("imap.gmail.com", 993, true);
output:
I/flutter (16447): [INFO] imap_client: C: A4 SELECT "inbox"
I/flutter (16447): [INFO] imap_client: S: * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584
I/flutter (16447): A2 OK m.*******@gmail.com authenticated (Success)
E/flutter (16447): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: Trying to use "SELECT/EXAMINE" in unauthenticated state.
E/flutter (16447): #0 _ImapCommandable._requiresAuthenticated (package:imap_client/src/imap_commandable.dart:351:7)
E/flutter (16447): #1 _ImapCommandable.getFolder. (package:imap_client/src/imap_commandable.dart:136:29)
E/flutter (16447): #2 ImapEngine.executeCommand (package:imap_client/src/imap_engine.dart:104:42)
E/flutter (16447):
E/flutter (16447): #3 _ImapCommandable.getFolder (package:imap_client/src/imap_commandable.dart:138:19)
E/flutter (16447): #4 _HomeState.getEmails (package:mail_app/main.dart:50:10)
E/flutter (16447): #5 _HomeState.build. (package:mail_app/main.dart:62:11)
E/flutter (16447): #6 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:992:19)
E/flutter (16447): #7 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:1098:38)
E/flutter (16447): #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:184:24)
E/flutter (16447): #9 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:524:11)
E/flutter (16447): #10 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:284:5)
E/flutter (16447): #11 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:219:7)
E/flutter (16447): #12 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:477:9)
E/flutter (16447): #13 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:78:12)
E/flutter (16447): #14 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:124:9)
E/flutter (16447): #15 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
E/flutter (16447): #16 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:122:18)
E/flutter (16447): #17 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:108:7)
E/flutter (16447): #18 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:220:19)
E/flutter (16447): #19 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22)
E/flutter (16447): #20 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:158:7)
E/flutter (16447): #21 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:104:7)
E/flutter (16447): #22 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:88:7)
E/flutter (16447): #23 _rootRunUnary (dart:async/zone.dart:1206:13)
E/flutter (16447): #24 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (16447): #25 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (16447): #26 _invoke1 (dart:ui/hooks.dart:283:10)
E/flutter (16447): #27 _dispatchPointerDataPacket (dart:ui/hooks.dart:192:5)
E/flutter (16447):
I/flutter (16447): [INFO] imap_client: S: * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing)
I/flutter (16447): * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing *)] Flags permitted.
I/flutter (16447): * OK [UIDVALIDITY 1] UIDs valid.
I/flutter (16447): * 2 EXISTS
I/flutter (16447): * 0 RECENT
I/flutter (16447): * OK [UIDNEXT 17] Predicted next UID.
I/flutter (16447): * OK [HIGHESTMODSEQ 2751]
I/flutter (16447): A4 OK [READ-WRITE] inbox selected. (Success)

from imap_client.

michaelspiss avatar michaelspiss commented on June 29, 2024

It seems like you are trying to select the folder before you are fully authenticated. Make sure to await each command you send to the server. In your case I suspect a missing await in front of client.login(...) or client.authenticate(...)

from imap_client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.