URGENT PLEASE: 3rd Time Installing and Still Have SMTP Issues with PostFix

Discussion in 'Server Operation' started by norby, Jun 21, 2011.

  1. norby

    norby New Member

    Hello There,

    I need some help with my SMTP settings. I followed this tutorial to the 't':

    http://www.howtoforge.com/perfect-server-centos-5.6-x86_64-ispconfig-3

    First the problem.

    I cannot connect to my SMTP externally from my server. If a telnet on the server I get a response but when I telnet on a separate machine I get "Unable to connect to remote host". After trying telnet I tried added my account to an email client with password authentication and still unable to connect.

    Here is some output information:

    postconf -a

    Code:
    cyrus
    dovecot
    
    postconf -A

    Code:
    cyrus
    
    postconf -m

    Code:
    btree
    cidr
    environ
    hash
    ldap
    mysql
    nis
    pcre
    pgsql
    proxy
    regexp
    static
    unix
    
    postconf -n
    Code:
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    body_checks = regexp:/etc/postfix/body_checks
    broken_sasl_auth_clients = yes
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    content_filter = amavis:[127.0.0.1]:10024
    daemon_directory = /usr/libexec/postfix
    debug_peer_level = 2
    header_checks = regexp:/etc/postfix/header_checks
    html_directory = no
    inet_interfaces = all
    mail_owner = postfix
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    mime_header_checks = regexp:/etc/postfix/mime_header_checks
    mydestination = isone.example.com, localhost, localhost.localdomain
    myhostname = isone.example.com
    mynetworks = 127.0.0.0/8 [::1]/128
    nested_header_checks = regexp:/etc/postfix/nested_header_checks
    newaliases_path = /usr/bin/newaliases.postfix
    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
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
    receive_override_options = no_address_mappings
    relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
    sample_directory = /usr/share/doc/postfix-2.3.3/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_sasl_path = private/auth
    smtpd_sasl_type = dovecot
    smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_tls_security_level = may
    smtpd_use_tls = yes
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    unknown_local_recipient_reject_code = 550
    virtual_alias_domains = 
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_gid_maps = static:5000
    virtual_mailbox_base = /var/vmail
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_transport = dovecot
    virtual_uid_maps = static:5000
    
    dovecot -n

    Code:
    # 1.2.17: /etc/dovecot.conf
    # OS: Linux 2.6.18-238.el5 x86_64 CentOS release 5.6 (Final) ext3
    log_timestamp: %Y-%m-%d %H:%M:%S 
    login_dir: /var/run/dovecot/login
    login_executable(default): /usr/libexec/dovecot/imap-login
    login_executable(imap): /usr/libexec/dovecot/imap-login
    login_executable(pop3): /usr/libexec/dovecot/pop3-login
    first_valid_uid: 5000
    last_valid_uid: 5000
    first_valid_gid: 5000
    last_valid_gid: 5000
    mail_location: maildir:/var/vmail/%d/%n/Maildir
    mail_executable(default): /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/imap
    mail_executable(imap): /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/imap
    mail_executable(pop3): /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/pop3
    mail_plugins(default): quota imap_quota
    mail_plugins(imap): quota imap_quota
    mail_plugins(pop3): quota
    mail_plugin_dir(default): /usr/lib/dovecot/imap/
    mail_plugin_dir(imap): /usr/lib/dovecot/imap/
    mail_plugin_dir(pop3): /usr/lib/dovecot/pop3
    lda:
      postmaster_address: [email protected]
      mail_plugins: sieve quota
      mail_plugin_dir: /usr/lib/dovecot/lda
      auth_socket_path: /var/run/dovecot/auth-master
    auth default:
      mechanisms: plain login
      passdb:
        driver: pam
      passdb:
        driver: sql
        args: /etc/dovecot-sql.conf
      userdb:
        driver: passwd
      userdb:
        driver: sql
        args: /etc/dovecot-sql.conf
      socket:
        type: listen
        client:
          path: /var/spool/postfix/private/auth
          mode: 432
          user: postfix
          group: postfix
        master:
          path: /var/run/dovecot/auth-master
          mode: 384
          user: vmail
    plugin:
      quota: maildir
      sieve_dir: ~/sieve
    
    telnet localhost 25

    Code:
    Trying 127.0.0.1...
    Connected to localhost.localdomain (127.0.0.1).
    Escape character is '^]'.
    220 isone.example.com ESMTP Postfix
    ehlo localhost
    250-isone.example.com
    250-PIPELINING
    250-SIZE 10240000
    250-VRFY
    250-ETRN
    250-STARTTLS
    250-AUTH PLAIN LOGIN
    250-AUTH=PLAIN LOGIN
    250-ENHANCEDSTATUSCODES
    250-8BITMIME
    250 DSN
    

    netstat -tap

    Code:
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
    tcp        0      0 *:imaps                     *:*                         LISTEN      7053/imap-login     
    tcp        0      0 *:pop3s                     *:*                         LISTEN      7052/pop3-login     
    tcp        0      0 localhost.localdomain:10024 *:*                         LISTEN      13137/amavisd (mast 
    tcp        0      0 localhost.localdomain:10025 *:*                         LISTEN      13106/master        
    tcp        0      0 *:mysql                     *:*                         LISTEN      13035/mysqld        
    tcp        0      0 *:pop3                      *:*                         LISTEN      7052/pop3-login     
    tcp        0      0 localhost.local:dyna-access *:*                         LISTEN      13153/clamd         
    tcp        0      0 *:imap                      *:*                         LISTEN      7053/imap-login     
    tcp        0      0 *:sunrpc                    *:*                         LISTEN      4608/portmap        
    tcp        0      0 site09.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site08.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site07.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site06.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site05.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site04.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site03.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site27.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site26.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site25.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site24.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site23.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site22.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site21.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site20.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site02.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site19.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site18.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site17.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site16.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site15.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site14.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site13.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site12.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site11.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site10.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site01.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 site00.COM:domain          *:*                         LISTEN      13254/named         
    tcp        0      0 isone.example.com:domain  *:*                         LISTEN      13254/named         
    tcp        0      0 localhost.localdomai:domain *:*                         LISTEN      13254/named         
    tcp        0      0 *:ftp                       *:*                         LISTEN      13202/pure-ftpd (SE 
    tcp        0      0 *:ipp                       *:*                         LISTEN      4689/rpc.statd      
    tcp        0      0 localhost.localdomain:rndc  *:*                         LISTEN      13254/named         
    tcp        0      0 *:smtp                      *:*                         LISTEN      13106/master        
    tcp        0      0 localhost.localdomain:mysql localhost.localdomain:43268 ESTABLISHED 13035/mysqld        
    tcp        0      0 localhost.localdomain:43268 localhost.localdomain:mysql ESTABLISHED 13151/amavisd (ch1- 
    tcp        0      0 localhost.localdomain:35251 localhost.localdomain:mysql ESTABLISHED 13152/amavisd (ch1- 
    tcp       56      0 localhost.localdomain:45914 localhost.localdomain:10025 CLOSE_WAIT  13151/amavisd (ch1- 
    tcp        0      0 localhost.localdomain:mysql localhost.localdomain:35251 ESTABLISHED 13035/mysqld        
    tcp       56      0 localhost.localdomain:56778 localhost.localdomain:10025 CLOSE_WAIT  13152/amavisd (ch1- 
    tcp        0      0 *:imaps                     *:*                         LISTEN      7053/imap-login     
    tcp        0      0 *:pop3s                     *:*                         LISTEN      7052/pop3-login     
    tcp        0      0 *:pop3                      *:*                         LISTEN      7052/pop3-login     
    tcp        0      0 *:imap                      *:*                         LISTEN      7053/imap-login     
    tcp        0      0 *:http                      *:*                         LISTEN      11219/httpd         
    tcp        0      0 *:tproxy                    *:*                         LISTEN      11219/httpd         
    tcp        0      0 *:domain                    *:*                         LISTEN      13254/named         
    tcp        0      0 *:ftp                       *:*                         LISTEN      13202/pure-ftpd (SE 
    tcp        0      0 *:ssh                       *:*                         LISTEN      6435/sshd           
    tcp        0      0 localhost6.localdomain:rndc *:*                         LISTEN      13254/named         
    tcp        0      0 *:pcsync-https              *:*                         LISTEN      11219/httpd         
    tcp        0      0 *:https                     *:*                         LISTEN      11219/httpd         
    tcp        0   3888 isone.example.com:ssh     h24-207-60-64.dlt.dcc:58191 ESTABLISHED 6849/0              
    
    iptables -L

    Code:
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination  
    
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Is there some other firewall (e.g. on your router) that blocks port 25? It is also possible that your ISP is blocking port 25.
     
  3. norby

    norby New Member

    Falko, you are right. The most obvious solution is sometimes the most difficult to see.

    I changed the SMTP port to 2525 and now things are working. My ISP must be blocking port 25. Need to get this corrected.

    Thank you for your help.
     
  4. norby

    norby New Member

    After checking with the ISP provider, they have assured me that port 25 is not being blocked. So I am still trying to figure out why my SMTP doesn't work on port 25.
     
  5. falko

    falko Super Moderator Howtoforge Staff

    Did you check your router firewall?
     
  6. norby

    norby New Member

    No router installed. What is really odd is that when use a mail client to send and receive through port 2525 seems to be working fine. However, all emails that are sent out are addressed with the server name "[email protected]" and also "[email protected]".

    When sending an email from the system, localhost, using Java Mail and using SMTP setting mail.example.com through port 2525 all emails are marked as "Relay Access Denied".

    Do you think this has anything to do with my DNS settings?

    DNS Info: site1.com

    A site1.com. 00.63.132.34
    A mail 00.63.132.34
    A ns1 00.63.132.34
    A www 00.63.132.34
    MX site1.com. mail.site1.com.
    NS site1.com. ns1.site1.com.
    NS site1.com. ns2.site1.com.
    TXT site1.com. v=spf1 a mx ptr -all

    DNS Info: site2.com

    A site2.com. 00.63.132.35
    A mail 00.63.132.35
    A ns1 00.63.132.35
    A www 00.63.132.35
    MX site2.com. mail.site2.com.
    NS site2.com. ns1.site2.com.
    NS site2.com. ns2.site2.com.
    TXT site2.com. v=spf1 a mx ptr -all
     
  7. norby

    norby New Member

    No router installed. What is really odd is that when use a mail client to send and receive through port 2525 seems to be working fine. However, all emails that are sent out are addressed with the server name "[email protected]" and also "[email protected]".

    When sending an email from the system, localhost, using Java Mail and using SMTP setting mail.example.com through port 2525 all emails are marked as "Relay Access Denied".

    Do you think this has anything to do with my DNS settings?

    DNS Info: site1.com

    A site1.com. 00.63.132.34
    A mail 00.63.132.34
    A ns1 00.63.132.34
    A www 00.63.132.34
    MX site1.com. mail.site1.com.
    NS site1.com. ns1.site1.com.
    NS site1.com. ns2.site1.com.
    TXT site1.com. v=spf1 a mx ptr -all

    DNS Info: site2.com

    A site2.com. 00.63.132.35
    A mail 00.63.132.35
    A ns1 00.63.132.35
    A www 00.63.132.35
    MX site2.com. mail.site2.com.
    NS site2.com. ns1.site2.com.
    NS site2.com. ns2.site2.com.
    TXT site2.com. v=spf1 a mx ptr -all
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Please use localhost instead of mail.example.com - that way you don't have to authenticate.

    Do you really use IPs starting with 00, or do you just use this here in the forum to hide your real IP?
     
  9. norby

    norby New Member

    Falko I am using localhost for the time being and yes I am hiding the IP addresses in this posting thus they begin with 00. I'm surprised that no one else had the same issue as I used the tutorial 3 times and got the same result.

    Regarding the below two items where would you being your troubleshooting?

    What is really odd is that when use a mail client to send and receive through port 2525 seems to be working fine. However, all emails that are sent out are addressed with the server name "[email protected]" and also "[email protected]".

    When sending an email from the system, localhost, using Java Mail and using SMTP setting mail.example.com through port 2525 all emails are marked as "Relay Access Denied".
     
  10. falko

    falko Super Moderator Howtoforge Staff

    Please make sure you set the correct sender address in your email client.

    Can you post an excerpt from your mail log?
     

Share This Page