IMAP Problem with Postfix

Port 23 is not the IMAP port, or any mail-related port at all. You won’t learn anything by trying to connect to port 23. IMAP port is 143 (unencrypted) and IMAPS is 993 (encrypted with SSL/TLS).

the link shows the example for imap

open imapserver.example.com imap

This is the result:

telnet>open mail.xxx.com imap
Looking up host: mail.xxx.com
Trying IP.IP.IP.IP:143…
Connected to mail.xxx.com. Escape key is ALT-].

  • OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready.

And with 993:

telnet>open mail.xxx.com 993
Looking up host: mail.xxx.com
Trying IP.IP.IP.IP:993…
Connected to mail.xxx.com. Escape key is ALT-].

a1 LOGIN user123456
Connection terminated.

That shows the imap connection works on port 143, maybe use that port on your client

P.S. I just found out telnet can’t test on port 993 due ssl/tls, you need to use openssl

This is the result with openssl:

OpenSSL> s_client -connect mail.xxx.com:993 -crlf
CONNECTED(000001B8)
depth=0 CN = localhost.localdomain
verify error:num=18:self signed certificate
verify return:1
depth=0 CN = localhost.localdomain
verify return:1

Certificate chain
0 s:CN = localhost.localdomain
i:CN = localhost.localdomain

Server certificate
-----BEGIN CERTIFICATE-----



-----END CERTIFICATE-----
subject=CN = localhost.localdomain

issuer=CN = localhost.localdomain


No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, P-384, 384 bits

SSL handshake has read 1487 bytes and written 783 bytes
Verification error: self signed certificate

New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 18 (self signed certificate)


Post-Handshake New Session Ticket arrived:
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_256_GCM_SHA384
Session-ID: 65589ACA41BDCE799354AD5442ED2…
Session-ID-ctx:
Resumption PSK: 98EEC7C340421DCFD030C6BFD86…
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 7200 (seconds)
TLS session ticket:
0000 - …
0010 - …
0020 - …
0030 - …
0040 - …
0050 - …
0060 - …
0070 - …
0080 - …
0090 - …
00a0 - …
00b0 - …
00c0 - …
00d0 - …

Start Time: 1681833718
Timeout   : 7200 (sec)
Verify return code: 18 (self signed certificate)
Extended master secret: no
Max Early Data: 0

read R BLOCK

Post-Handshake New Session Ticket arrived:
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_256_GCM_SHA384
Session-ID: 5D1FF8853CAEAF62436520…
Session-ID-ctx:
Resumption PSK: 426315780D6D54092C1ECBC0…
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 7200 (seconds)
TLS session ticket:
0000 - …
0010 - …
0020 - …
0030 - …
0040 - …
0050 - …
0060 - …
0070 - …
0080 - …
0090 - …
00a0 - …
00b0 - …
00c0 - …
00d0 - …

Start Time: 1681833718
Timeout   : 7200 (sec)
Verify return code: 18 (self signed certificate)
Extended master secret: no
Max Early Data: 0

read R BLOCK

  • OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready.

I think everythings are good, right?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.