seb5law

seb5law

I am currently trying to connect to an in-house email server to download one email and process it.
I looked all around for usable packages for either POP3 or IMAP. I could not find any packages for IMAP neither for Elixir nor for Erlang that seem usable.
Is downloading an email too simple for a package or why is there no support so far for such an important functionality?

The only package in Elixir that addresses POP3 seems to be https://github.com/nico-amsterdam/pop3mail. I tried using it from within an Elixir project and I tried to call it via CLI:
mix run -e 'Pop3mail.CLI.main(["--username=<username>", "--password=<password>", "--max=10", "--server=example.com", "--port=110"])'

I tried several server configurations either with pop in the server address or without. With the above config, which I took from the description on Github, I always get a [error] connect_failed

Does anyone have an idea what the issue at hand could be assuming the credentials as well as the server address and port are correct (I checked them via telnet).

I am grateful for any suggestions.

Showing Posts 1 to 5

seb5law

seb5law OP

Posting things here always helps your (or rather my) own awareness. One of the issues is that the mailserver does not use SSL…

Otherwise I would not be able to connect via telnet, obviously! So now the way to access the server within Elixir is:

def download_one_message do
    Pop3mail.download(%{"username" => @user, "password" => @pw, "server" => @server, "max" => 1, "port" => 110, "ssl" => false})
end

Now I get a different error, but this seems to be server specific and not due to the connection or the package. I now get {:error, ' login must use full email address\r\n'}. I will check with the admis what’s amiss, thank you anyways for this great forum!

AstonJ

AstonJ

Sounds like you need username to be the full email address which could be either something like name@domain.com or, depending on how your server is set up (prob via saslauthd) name.domainaccountname where domainaccountname is the name of the linux user relating to that email/domain.

seb5law

seb5law OP

Thanks for the fast reply. I do actually use name@example.com notation:

def download_one_message do
   Pop3mail.download(%{"username" => "name@example.com", "password" => "wicket_strong_pw", "server" => "server.example.com", "max" => 1, "port" => 110, "ssl" => false})
end
NobbZ

NobbZ

Please do not use any email address or domain that is not owned by you. It might increase spam for that given address. If you do not want to waste one of your own please use example.com for the domain name. It does exist exactly for this purpose.

seb5law

seb5law OP

The logs on the mail server imply, that part of the email address entered is removed somewhere. It seems like everything after including the “@” sign is missing. Any idea on why and how that happens? Do I need to escape some characters or use special quotation marks? To me it seems to be an issue with the epop implementation.

EDIT: I simply appended “@example” to the username and everything works fine:

def download_one_message do
    Pop3mail.download(%{"username" => "name@example.com@example.com", "password" => "wicket_strong_pw", "server" => "server.example.com", "max" => 1, "port" => 110, "ssl" => false})
end

I also filed an issue in order to request it be marked in the documentation that the username is shortened.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews