antfarm

antfarm

How to build an IMAP Email client with Elixir?

I want to build an IMAP Email client that can connect to Gmail. What library would you suggest?

I tried using Mailroom, but cannot even get it to connect to my account.

iex> {result, client} = Mailroom.IMAP.connect("imap.gmail.com", "me@example.com", "PASSWORD", ssl: true)
{:error, :unable_to_connect}

Any help is appreciated, thanks.

Most Liked

D4no0

D4no0

I am not against hardening of security, but when manual review comes into play, you know there is a bias involved.

Here is the line that worries me:

If your public application uses scopes that permit access to certain user data, it must complete a verification process. If you see unverified app on the screen when testing your application, you must submit a verification request to remove it. Find out more about unverified apps and get answers to frequently asked questions about app verification in the Help Center.

This is the same story as google play apps requires and it will most probably only get worse the next years.

maennchen

maennchen

I don’t know if there’s a library that already does this, but it should be relatively simple to implement:

  • Setup an OAuth lib and obtain a token
  • Adapt the IMAP implementation to support the AUTHENTICATE command instead of the default LOGIN command.

Here’s an example imap implementation in PHP:
https://github.com/pluginsGLPI/oauthimap/blob/5e5cead36246e5c9c46d6a9f403769aa458ebfa4/inc/imap/imapoauthprotocol.class.php#L147-L153

maennchen

maennchen

(Also see the Google Docs about the AUTHENTICATE command: OAuth 2.0 Mechanism  |  Gmail  |  Google for Developers)

Last Post!

princemaple

princemaple

Hi, you might want to give this a go… my new little lib
https://github.com/princemaple/blop

EDIT: I’ve tested with my own gmail account. With app password (the less secure thingy), I managed to access my emails with blop v0.1.4

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

Other popular topics Top

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement