3 ms·
Nice job. I just realized, would Elixir be the perfect platform for this since you could have a GenServer process that has a constantly alive IMAP connection f
by atonse 6y ago
Nice job.
I just realized, would Elixir be the perfect platform for this since you could have a GenServer process that has a constantly alive IMAP connection for each server?
I'm not sure if this API is initiating an IMAP connection each time you request something, but keeping that connection alive could be really interesting.
Also can you use a regular connection pooling library to do this?
Or am I imagining a problem that doesn't exist? (overhead of reconnecting to IMAP server for each request)
- dqv 6y agoYes. And there was an Erlang library called switchboard I ported to Elixir that works as an IMAP client. It is not complete though. A few issues are: - it does not properly handle the case when you send something invalid in a continuation mode - continuation commands from the command response queue (well it’s a gb tree actually) don’t actually get a response - there is a weird bug where some pieces of mail don’t get processed - might be something wrong with me porting the code. It’s also not necessary since the mail parser from that Erlang smtp lib can be used https://github.com/voughtdq/imap https://github.com/voughtdq/imap
- andris9 6y agoIMAP API opens a single persistent connection for every registered IMAP account and then uses this connection for all operations. Unfortunately this also means that you can't do stuff in parallel, so if you pile up a bunch of requests against a single account then it might take some time until all these requests are processed as these need do be done one by one.