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

Problem with ssl_opts, when server and server_name_indication are not the same #25

Closed
andreas-ementio opened this issue Oct 31, 2024 · 3 comments

Comments

@andreas-ementio
Copy link

andreas-ementio commented Oct 31, 2024

with my email services ssl verification does not work.

the genserver crashes and causes this:

[error] GenServer {Yugo.Registry, :fastmail_client} terminating
** (KeyError) key :next_cmd_tag not found in: nil

If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map
    (yugo 1.0.0) lib/yugo/client.ex:654: Yugo.Client.send_command/3
    (stdlib 4.3.1.5) gen_server.erl:1161: :gen_server.try_terminate/3
    (stdlib 4.3.1.5) gen_server.erl:1351: :gen_server.terminate/10
    (stdlib 4.3.1.5) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

which caused some confusion on my side, though it had to do something with the next_cmd_tag

i think the the cause is that the verification does not work on "imap.fastmail.com", it only works on "fastmail.com"

solutions for that could be:

  1. a method to change the server_name_indication
  2. a custom hostname check like andreas-ementio@ccca909

on a side note: this library handles only receiving new email and not fetching already existing emails in the inbox or am i missing something?

@Flying-Toast
Copy link
Owner

If you send a PR for andreas-ementio@ccca909 I'd be open to merging it.

on a side note: this library handles only receiving new email and not fetching already existing emails in the inbox or am i missing something?

That's correct, my use case for making the library didn't require fetching existing emails. I am not opposed to adding that functionality though - there was even some talk about it in #24 but you'd have to check with @bkono on the status of that.

@bkono
Copy link

bkono commented Nov 10, 2024

Apologies, got pulled off to a different project for a bit and haven't cleaned up / broken down my changes to a place where I was comfortable sending a PR. I just pushed an updated version of the branch currently being used in one of my projects, @andreas-ementio you're welcome to scan the commits I've added and see if there's anything useful in there.

At the moment, it has some needed tweaks to address parsing / tag flowing etc, and a usable implementation of capability listing, mailbox listing, count of messages in a mailbox, mailbox creation, message move support, message fetching ... probably forgetting something else I needed along the way. 😆

@Themanwhosmellslikesugar

Hi, if it helps anyone, the error with the key :next_cmd_tag not found in: nil can occur due to an old version of OTP. In version <25 there's no :public_key.cacerts_get() function, because of this the client creation fails. I solved this problem by updating OTP to version 25.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants