Cannot connect to outgoing mail server - Debian Lenny, Postfix, Courier, MySQl

Discussion in 'Server Operation' started by hemajanger, May 12, 2009.

  1. hemajanger

    hemajanger New Member

    Hello,

    Thank you for this wonderful resource.

    I have followed this tutorial:
    http://howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-debian-lenny

    I have gotten almost everything to work. I can retrieve my emails, but the problem is sending emails. My email clients (thunderbird, Mail.app) can't seem to connect to my outgoing smtp server.

    I checked and triple checked for any typos, none - made sure I replaced specific info (i.e ip addresses, domain names, etc.).

    I checked my mail log and that's the strange thing. I get no errors. When I open up my email clients and log in. It shows up in the log. But when I try to send out an email. Nothing the email client, just usually hangs.

    I realize there are a bunch of related posts. But none of them seem to be similar to mine. Thank you again for all your work in putting this site together. Any help will be appreciated.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    netstat -tap
    ? Do you have a firewall that blocks port 25?
     
  3. chronix

    chronix New Member

    core:~# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 localhost:835 *:* LISTEN 5747/famd
    tcp 0 0 localhost:mysql *:* LISTEN 6126/mysqld
    tcp 0 0 *:sunrpc *:* LISTEN 5643/portmap
    tcp 0 0 core.skhost.eu:domain *:* LISTEN 3260/mydns
    tcp 0 0 localhost:domain *:* LISTEN 3260/mydns
    tcp 0 0 *:ssh *:* LISTEN 2555/sshd
    tcp 0 0 core.skhost.eu:ssh 61.189.16.37:42846 SYN_RECV -
    tcp 0 0 *:smtp *:* LISTEN 17878/master
    tcp 0 0 core.skhost.eu:ssh adsl-dyn-234.95-1:21094 ESTABLISHED 17405/sshd: root@no
    tcp 0 1 core.skhost.eu:ssh 61.189.16.37:42732 LAST_ACK -
    tcp 0 0 core.skhost.eu:ssh adsl-dyn-234.95-1:18836 ESTABLISHED 16131/sshd: root@no
    tcp 0 52 core.skhost.eu:ssh adsl-dyn-234.95-1:21095 ESTABLISHED 17410/sshd: root@tt
    tcp6 0 0 [::]:imaps [::]:* LISTEN 20320/couriertcpd
    tcp6 0 0 [::]:pop3s [::]:* LISTEN 20348/couriertcpd
    tcp6 0 0 [::]:pop3 [::]:* LISTEN 20331/couriertcpd
    tcp6 0 0 [::]:imap2 [::]:* LISTEN 20303/couriertcpd
    tcp6 0 0 [::]:http-alt [::]:* LISTEN 3247/apache2
    tcp6 0 0 [::]:www [::]:* LISTEN 3247/apache2
    tcp6 0 0 ip6-localhost:domain [::]:* LISTEN 3260/mydns
    tcp6 0 0 [::]:ssh [::]:* LISTEN 2555/sshd
    tcp6 0 0 [::]:https [::]:* LISTEN 3247/apache2
    tcp6 0 0 core.skhost.eu:pop3 adsl-dyn-234.95-1:21377 TIME_WAIT -
     
  4. topdog

    topdog Active Member

    you should be checking if your are allowing connections to port 25.
    Code:
    iptables -vnL
     
  5. chronix

    chronix New Member

    core:~# iptables -vnL
    Chain INPUT (policy ACCEPT 217 packets, 32573 bytes)
    pkts bytes target prot opt in out source destination

    Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
    pkts bytes target prot opt in out source destination

    Chain OUTPUT (policy ACCEPT 194 packets, 46605 bytes)
    pkts bytes target prot opt in out source destination






    I think that I have a bad config postfix ... Here is:

    # See /usr/share/postfix/main.cf.dist for a commented, more complete version


    # Debian specific: Specifying a file name will cause the first
    # line of that file to be used as the name. The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname

    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no

    # appending .domain is the MUA's job.
    append_dot_mydomain = no

    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h

    readme_directory = /usr/share/doc/postfix

    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.

    myhostname = core.skhost.eu
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = core.skhost.eu, localhost, localhost.localdomain
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    html_directory = /usr/share/doc/postfix/html
    message_size_limit = 30720000
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_create_maildirsize = yes
    virtual_maildir_extended = yes
    virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
    virtual_mailbox_limit_override = yes
    virtual_maildir_limit_message = "The user you are trying to reach is over quota."
    virtual_overquota_bounce = yes
    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Are you trying to connect from withinyour local network, or from the outside? If from outside, please make sure that your ISP doesn't block port 25.
     

Share This Page