A
A
Andrey2016-04-08 13:19:26
go
Andrey, 2016-04-08 13:19:26

How to check mail by imap in Go?

No matter how simple the task may seem, I can't get mail via imap.
With tlc.Dial("tcp", "imap.gmail.com:993", nil) - the connection is obtained.
But when requesting to another mail server (port 143), the error tls falls out: oversized record received with length 19232
On the STARTTLS server.
All email clients work fine with it.
If anyone knows how to solve the problem - I will be grateful.
Also, if someone can advise a library for working with imap, it will also be appropriate.
PS There is no access to the server. So there's nothing to edit on it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sivoyanope, 2016-04-08
@sivoyanope

And how do you initiate the connection to the encrypted channel before checking the mail?

U
uvelichitel, 2016-04-08
@uvelichitel

you can try

tls.Dial("tcp", "imap.yourserver.com:143", &tls.Config{
    InsecureSkipVerify: true,
})

Recognized imap client https://github.com/mxk/go-imap

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question