Skip to content

Commit 5153c18

Browse files
bitfehleremersion
authored andcommitted
imapclient: add DialInsecure() for plain-text IMAP
1 parent f438355 commit 5153c18

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

imapclient/client.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@ func NewStartTLS(conn net.Conn, options *Options) (*Client, error) {
209209
return client, nil
210210
}
211211

212+
// DialInsecure connects to an IMAP server without any encryption at all.
213+
func DialInsecure(address string, options *Options) (*Client, error) {
214+
conn, err := net.Dial("tcp", address)
215+
if err != nil {
216+
return nil, err
217+
}
218+
return New(conn, options), nil
219+
}
220+
212221
// DialTLS connects to an IMAP server with implicit TLS.
213222
func DialTLS(address string, options *Options) (*Client, error) {
214223
tlsConfig := options.tlsConfig()

0 commit comments

Comments
 (0)