LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-07-2014, 01:00 AM   #1
tuanhqit
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Rep: Reputation: Disabled
Telnet localhost 465, pop3s, imaps. connection closed by foreign host


Hello! I'm setting up SSL encrypted connection in Postfix, Dovecot. I use vps amazon ec2.
Error:
telnet localhost 465
Escape character is '^]'.
Connection closed by foreign host.

Code:
# ss -tpl | grep -E 'imaps|pop3s'
LISTEN     0      100                    :::imaps                   :::*        users:(("dovecot",17085,26))
LISTEN     0      100                     *:imaps                    *:*        users:(("dovecot",17085,25))
LISTEN     0      100                    :::pop3s                   :::*        users:(("dovecot",17085,20))
LISTEN     0      100                     *:pop3s                    *:*        users:(("dovecot",17085,19))
///////////////////////////////////////////////////////////////////
# ss -tnpl | grep 465
LISTEN     0      100                      :::465                     :::*      users:(("master",17696,18))
LISTEN     0      100                       *:465                      *:*      users:(("master",17696,17))
Have a something wrong ? telnet localhost 465
connection closed by foreign host
If you need anything else (configuration file), post reply. I would show you.
Thank you very much. I am a newbie. Not good english. Please explain clearly.

Last edited by tuanhqit; 08-07-2014 at 01:03 AM.
 
Old 08-07-2014, 05:58 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
0) If the port uses SSL then you don't want to telnet as you can't do a SSL handshake. Instead use something like
Code:
true | openssl s_client -connect localhost:465
1) If a port seems "closed" when it should be open always check: a) tcp_wrappers (/etc/hosts.{allow,deny}), b) iptables-save output, c) system and daemon logs in /var/log/ and d) the daemon configuration for clues.
 
Old 08-12-2014, 03:32 AM   #3
tuanhqit
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Pop3s, Imaps Dovecot can't receive email

Hello everybody.
I configued mail server. I can send email form port 465 but i can't receive email by pop3s, imaps. if I don't use SSL, my server would work. Sorry my english.
These are configuration files

Dovecot
Code:
protocols = imap pop3 lmtp
ssl = yes
ssl_cert = </etc/pki/tls/certs/sucsongtre.vn.crt
ssl_key = </etc/pki/tls/private/sucsongtre.vn.key
Master.cf
Code:
smtps     inet  n       -       n       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
Main.cf
Code:
home_mailbox = Maildir/
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
smtpd_use_tls = yes
smtpd_tls_key_file  = /etc/pki/tls/private/sucsongtre.vn.key
smtpd_tls_cert_file = /etc/pki/tls/certs/sucsongtre.vn.crt
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
Code:
# ss -tpl | grep -E 'imaps|pop3s'
LISTEN     0      100                    :::imaps                   :::*        users:(("dovecot",20254,26))
LISTEN     0      100                     *:imaps                    *:*        users:(("dovecot",20254,25))
LISTEN     0      100                    :::pop3s                   :::*        users:(("dovecot",20254,20))
LISTEN     0      100                     *:pop3s                    *:*        users:(("dovecot",20254,19))
Code:
# ss -tnpl | grep 465
LISTEN     0      100                      :::465                     :::*      users:(("master",8920,13))
LISTEN     0      100                       *:465                      *:*      users:(("master",8920,12))
If you want to know more configuration file, you can reply, i will show you.
Thank you for help. Sorry my english not good.
 
Old 08-12-2014, 04:29 AM   #4
tuanhqit
LQ Newbie
 
Registered: Jun 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
0) If the port uses SSL then you don't want to telnet as you can't do a SSL handshake. Instead use something like
Code:
true | openssl s_client -connect localhost:465
1) If a port seems "closed" when it should be open always check: a) tcp_wrappers (/etc/hosts.{allow,deny}), b) iptables-save output, c) system and daemon logs in /var/log/ and d) the daemon configuration for clues.
Hello, can you help me? i have a problem. my mail server can send email by 465 but not receive email by pop3s, imaps.
 
Old 08-12-2014, 06:49 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Merged the two closely related threads - please stick to one thread per topic.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Telnet "Connection closed by foreign host" jhilton Linux - Networking 37 03-29-2016 05:33 AM
Telnet: Connection closed by a foreign host DBrenchley Linux - Server 3 05-16-2014 01:49 AM
telnet session closed by foreign host vikky Linux - Newbie 2 02-14-2013 06:27 AM
telnet - connection closed by foreign host rbumann Linux - General 11 01-05-2012 09:43 AM
Telnet error "Connection closed by foreign host" without prompting login. jhilton Linux - Newbie 1 06-25-2008 07:36 PM


All times are GMT -5. The time now is 10:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration