Postfix Connection closed by foreign host

Discussion in 'Installation/Configuration' started by netizen_69, Oct 31, 2006.

  1. netizen_69

    netizen_69 New Member

    Hi there, I'm new to this.:D

    I'm trying to learn to setup a Linux E-mail server.
    Printed out the "The Perfect Setup - Fedora Core 5 (64 Bit)"

    I faced the foolowing message when I tried to telnet to see if SMTP-AUTH and TLS work properly. :(

    Quote
    [root@svr1 ~]# telnet localhost 25
    Trying 127.0.0.1...
    Connected to localhost.localdomain (127.0.0.1).
    Escape character is '^]'.
    Connection closed by foreign host.
    Unquote

    my main.cf

    Quote
    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/libexec/postfix
    mail_owner = postfix
    inet_interfaces = all
    mydestination = $myhostname, localhost.$mydomain, localhost
    unknown_local_recipient_reject_code = 550
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    debug_peer_level = 2
    debugger_command =
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    xxgdb $daemon_directory/$process_name $process_id & sleep 5
    sendmail_path = /usr/sbin/sendmail.postfix
    newaliases_path = /usr/bin/newaliases.postfix
    mailq_path = /usr/bin/mailq.postfix
    setgid_group = postdrop
    html_directory = no
    manpage_directory = /usr/share/man
    sample_directory = /usr/share/doc/postfix-2.2.8/samples
    readme_directory = /usr/share/doc/postfix-2.2.8/README_FILES
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtpd_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    Unquote

    Kindly advice what otherinformation you need and what went wrong?:confused:

    Thank you for your assistance.:)
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Are there any errors in /var/log/maillog? What's the output of
    Code:
    netstat -tap
    ? What happens when you run
    Code:
    /etc/init.d/postfix restart
    ?
     
  3. netizen_69

    netizen_69 New Member

    vim /var/log/maillog

    Nov 6 04:02:08 svr1 postfix/pickup[18148]: 211721E3431: uid=0 from=<root>
    Nov 6 04:02:08 svr1 postfix/cleanup[18538]: 211721E3431: message-id=<[email protected]>
    Nov 6 04:02:08 svr1 postfix/qmgr[1894]: 211721E3431: from=<[email protected]>, size=1743, nrcpt=1 (queue active)
    Nov 6 04:02:09 svr1 postfix/local[18552]: 211721E3431: to=<[email protected]>, orig_to=<root>, relay=local, delay=2, status=sent (delivered to mailbox)
    Nov 6 04:02:09 svr1 postfix/qmgr[1894]: 211721E3431: removed


    netstat -tap

    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address Stat
    e PID/Program name
    tcp 0 0 *:mysql *:* LIST
    EN 1795/mysqld
    tcp 0 0 *:sunrpc *:* LIST
    EN 1425/portmap
    tcp 0 0 localhost.localdomain:50000 *:* LIST
    EN 1661/hpiod
    tcp 0 0 localhost.localdomain:50002 *:* LIST
    EN 1666/python
    tcp 0 0 *:34162 *:* LIST
    EN 1444/rpc.statd
    tcp 0 0 195.100.100.5:domain *:* LIST
    EN 1407/named
    tcp 0 0 localhost.localdomai:domain *:* LIST
    EN 1407/named
    tcp 0 0 localhost.localdomain:ipp *:* LIST EN 25481/cupsd
    tcp 0 0 *:smtp *:* LIST EN 1884/master
    tcp 0 0 localhost.localdomain:rndc *:* LIST EN 1407/named
    tcp 0 0 192.168.100.5:42552 200.210-193-7.unknown.:http ESTA BLISHED 20516/firefox-bin
    tcp 0 0 192.168.100.5:42545 200.210-193-7.unknown.:http ESTA BLISHED 20516/firefox-bin
    tcp 0 0 192.168.100.5:47834 198.210-193-7.unknown.:http ESTA BLISHED 20516/firefox-bin
    tcp 0 0 *:imaps *:* LIST EN 1823/dovecot
    tcp 0 0 *:pop3s *:* LIST EN 1823/dovecot
    tcp 0 0 *:pop3 *:* LIST EN 1823/dovecot
    tcp 0 0 *:imap *:* LIST EN 1823/dovecot
    tcp 0 0 *:ssh *:* LIST EN 1686/sshd


    [root@svr1 ~]# /etc/init.d/postfix restart
    Shutting down postfix: [ OK ]
    Starting postfix: [ OK ]
    [root@svr1 ~]#


    now what else can i check?
     
  4. falko

    falko Super Moderator ISPConfig Developer

    What's in /etc/hosts and /etc/resolv.conf? What's the output of
    Code:
    hostname
    and
    Code:
    hostname -f
    ?
     
  5. netizen_69

    netizen_69 New Member

    /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost
    195.100.100.50 svr1.abc.com svr1

    ::1 svr1.abc.com svr1 localhost.localdomain localhost

    /etc/resolv.conf
    search abc.com
    nameserver 210.193.xxx.xxx
    nameserver 165.21.xxx.xxx
    nameserver 202.172.xxx.xxx
    [root@svr1 ~]# hostname
    svr1.abc.com
    [root@svr1 ~]# hostname -f
    svr1.abc.com
    [root@svr1 ~]#
     
  6. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    postcheck
    and
    Code:
    ifconfig
    ?
     
  7. netizen_69

    netizen_69 New Member

    In regards the IP address and domain, when I reply to you, I would normally change to
    192.168.xxx.xxx and svr1.abc.com
    I would double check that the output in the actual tally as the output as what it is suppose to show.

    What other checks do I need to do please. :eek:
     
  8. falko

    falko Super Moderator ISPConfig Developer

    I'm sorry, the correct command is
    Code:
    postfix check
    :eek:

    Please also change
    Code:
    195.100.100.50 svr1.abc.com svr1
    to
    Code:
    192.168.1.xxx svr1.abc.com svr1
    in /etc/hosts (replace xxx with the real number) and run
    Code:
    postconf -e 'myhostname = svr1.abc.com'
    /etc/init.d/postfix restart
     
  9. netizen_69

    netizen_69 New Member


    Hi Falko thanks for your help.
    However the reply came a bit late.
    I decided to reformat and start the whole process from the begining.
    This time round the postfix installed perfectly.:D

    However I'm still facing the problem with mysqladmin.:(
    It's the same with some new users I noticed.
    Somehow when we execute the command

    shell> myseladmin -h localhost -u root password 'ourmysqlpassword'
    we would be prompted with something like
    mysqladmin : connect to server at 'localhost' failed
    error: 'Access denied for user: 'root'@'localhost' (Using password: NO)'

    I'm not an expert, somehow something tell me that there is a configuration somewhere which states that there is no password in place and that's why it reject the command. I would read on this matter in the forum submitted by other people first before I start a new one.

    Another thing.

    Noted the following yum commands no longer works

    a) yum install webalizer
    b) yum install phpmyadmin

    once again thank you:D
     
  10. falko

    falko Super Moderator ISPConfig Developer

    Please try
    Code:
    mysqladmin -u root password yourrootsqlpassword
    What's the output?
    Also, what's the output of
    Code:
    netstat -tap
    ? Did you disable SELinux?
     

Share This Page