Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No mailbox with flag MailboxFlag.sent found #170

Open
Marco4763 opened this issue Sep 17, 2021 · 6 comments
Open

No mailbox with flag MailboxFlag.sent found #170

Marco4763 opened this issue Sep 17, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@Marco4763
Copy link

I can't access the Sent folder with the library, but I can on any other client email app, when I try to send an email with this library, I receive this response:

Unhandled Exception: MailException: No mailbox with flag MailboxFlag.sent found in ["Lixo Eletrônico" exists: 0, highestModeSequence: null, "Itens Excluídos" exists: 0, highestModeSequence: null, "Itens Enviados" exists: 0, highestModeSequence: null, "Trash" exists: 0, highestModeSequence: null, "INBOX.spam" exists: 0, highestModeSequence: null, "Sent" exists: 0, highestModeSequence: null, "Drafts" exists: 0, highestModeSequence: null, "INBOX" exists: 4, highestModeSequence: 16].

@robert-virkus robert-virkus added the bug Something isn't working label Sep 17, 2021
@robert-virkus
Copy link
Member

Thanks for the report, what mail service are you using?
Also, would it be possible to test this again while depending on the git version of enough_mail? This should produce more output.
In your project, use this dependency:

dependencies:
  enough_mail: 
    git:
      url: https://github.com/Enough-Software/enough_mail.git

I assume that you are using MailClient.sendMessage(...) which triggers this problem, is that correct?

@kunalmanocha98
Copy link

I am also facing a similar issue. There are no flags present in mailboxes list neither sent nor any other (draft,archive,junk etc..)

@kunalmanocha98
Copy link

Thanks for the report, what mail service are you using? Also, would it be possible to test this again while depending on the git version of enough_mail? This should produce more output. In your project, use this dependency:

dependencies:
  enough_mail: 
    git:
      url: https://github.com/Enough-Software/enough_mail.git

I assume that you are using MailClient.sendMessage(...) which triggers this problem, is that correct?

But this is not compatible with enough_flutter and enough_editor

@robert-virkus
Copy link
Member

I assume this is because the mail service in question does not support mailbox flags, rfc 6154.
Can you confirm that this problem occurs when sending a message?

In regards to the dependencies, you can also alter the dependencies of enough_mail_flutter and enough_mail_html to target to the respective git repositories.

dependencies:
  enough_mail: 
    git:
      url: https://github.com/Enough-Software/enough_mail.git
  enough_mail_flutter: 
    git:
      url: https://github.com/Enough-Software/enough_mail_flutter.git
  enough_mail_html: 
    git:
      url: https://github.com/Enough-Software/enough_mail_html.git

@kunalmanocha98
Copy link

Yes, I am encountering the mailbox flags issues. this problem occurs when save a draft and also while appending the message to sent when sending a message.

robert-virkus added a commit that referenced this issue Oct 4, 2021
You can now specify a target mailbox
when sending a message or
when saving a draft.
This is useful in case the
IMAP service does not support
mailbox flags.

Relates to #170
@robert-virkus
Copy link
Member

When the IMAP service does not support mailbox flags, it pretty much boils down to guessing, so implementations can now either guess or ask the user to specify the respective mailboxses.

I just pushed a change to MailClient so that you can specify a target mailbox when sending a message or saving a draft.

Note that you can also set the appendToSent parameter to false in sendMessage:

Future<void> sendMessage(
    MimeMessage message, {
    MailAddress? from,
    bool appendToSent = true,
    Mailbox? sentMailbox,
    bool use8BitEncoding = false,
    List<MailAddress>? recipients,
  })

In saveDraft you can now also specify a mailbox:

  Future<UidResponseCode?> saveDraftMessage(MimeMessage message,
      {Mailbox? draftsMailbox})

Both changes are available on head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants