deltachat / deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
https://delta.chat/en/contribute
Other
682 stars 87 forks source link

Unable to make "simple" example work #57

Closed link2xt closed 5 years ago

link2xt commented 5 years ago

I have tried to modify examples/simple.rs to use my email server and set "mail_server" and "send_server" via dc_set_config. That is to try if the problem https://github.com/deltachat/deltachat-core/issues/605 arises.

Now I don't even see it connecting to the SMTP server. IMAP server is successfully connected, because if I provide incorrect password, it shows messages about failed auth.

...
[CONFIGURE_PROGRESS]
  progress: 800
[CONFIGURE_PROGRESS]
  progress: 900
[INFO]
  Configuring IMAP-folders.
[CONFIGURE_PROGRESS]
  progress: 910
[CONFIGURE_PROGRESS]
  progress: 920
[INFO]
  Generating keypair with 2048 bits, e=65537 ...
sending a message
[GET_STRING]
[CONTACTS_CHANGED]
[GET_STRING]
[MSGS_CHANGED]
[GET_STRING]
[GET_STRING]
[GET_STRING]
[ERROR]
  End-to-end-encryption unavailable unexpectedly.
[MSG_FAILED]
fetching chats..
[GET_STRING]
chat: 0 - None - Some("Hi, here is my first message!")
stopping threads
[INFO]
  Interrupting IMAP-IDLE...
[INFO]
  Interrupting SMTP-idle...
joining
[INFO]
  SMTP-idle ended.
[INFO]
  Keypair generated in 14.203 s.
[INFO]
  Configure completed.
[CONFIGURE_PROGRESS]
  progress: 940
failed to close connection: Bad("no mailbox selected")
[INFO]
  IMAP disconnected.
[CONFIGURE_PROGRESS]
  progress: 1000
[INFO]
  Unsuspending SENTBOX-thread.
[INFO]
  Unsuspending MVBOX-thread.
[INFO]
  INBOX-jobs ended.
closing
[INFO]
  IMAP disconnected.
[INFO]
  IMAP disconnected.
[INFO]
  IMAP disconnected.
[INFO]
  Database closed.

I have tried to increase delay in

let duration = time::Duration::from_millis(10000);

but that only increases the time in "Keypair generated in 14.203 s." message.

link2xt commented 5 years ago

Ok, the problem with "end-to-end encryption unavailable unexpectedly" goes away if I try to send the message to my other address, not the one I used to connect.

Now it goes like this:

[INFO]
  Generating keypair with 2048 bits, e=65537 ...
sending a message
[CONTACTS_CHANGED]
[MSGS_CHANGED]
[INFO]
  [autocrypt] no peerstate for XXXX(new address here)XXXX

That is ok, because encryption is opportunistic.

It continues like this:

[GET_STRING]
[INFO]
  Interrupting SMTP-idle...
[MSGS_CHANGED]
fetching chats..
[INFO]
  SMTP-idle ended.
[INFO]
  SMTP-jobs suspended.
[INFO]
  SMTP-idle started...
[GET_STRING]
chat: 0 - Some("Me") - Some("Hi, here is my first message!")
stopping threads
[INFO]
  Interrupting IMAP-IDLE...
[INFO]
  Interrupting SMTP-idle...
joining
[INFO]
  SMTP-idle ended.
[INFO]
  Keypair generated in 29.815 s.
[INFO]
  Configure completed.
[CONFIGURE_PROGRESS]
  progress: 940
failed to close connection: Bad("no mailbox selected")
[INFO]
  IMAP disconnected.
[CONFIGURE_PROGRESS]
  progress: 1000
[INFO]
  Unsuspending SENTBOX-thread.
[INFO]
  Unsuspending MVBOX-thread.
[INFO]
  INBOX-jobs ended.
closing
[INFO]
  IMAP disconnected.
[INFO]
  IMAP disconnected.
[INFO]
  IMAP disconnected.
[INFO]
  Database closed.

But I don't see the message in any of my mailboxes (in sent or inbox).

link2xt commented 5 years ago

I have just tested, and as of commit d0c7f63809c6a71b0e208b870b463f90859cee73 I was able to send a message to myself via REPL. Closing this, seems to be resolved.