postfix - not getting any emails. I can send out emails to outside from postfix

Discussion in 'Server Operation' started by ELY_M, Jan 3, 2012.

  1. ELY_M

    ELY_M New Member

    my server is on amazon aws service. I made sure smtpd ports are open.
    I am able to use thunderbird to check my emails and send out emails.

    I sent many test emails in my gmail and yahoo accounts to [email protected]
    They never show up in mailbox for user admin.
    I do not see any errors in maillog

    I have postfix 2.66 and dovecot installed

    Code:
    [root@ip-10-170-91-47 postfix]# postconf -n
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    broken_sasl_auth_clients = yes
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    daemon_directory = /usr/libexec/postfix
    data_directory = /var/lib/postfix
    debug_peer_level = 2
    html_directory = no
    inet_interfaces = 10.170.91.47, localhost
    inet_protocols = all
    local_recipient_maps =
    mail_spool_directory = /var/spool/mail
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain
    mydomain = my-domain.biz
    myhostname = mail.my-domain.biz
    mynetworks = 50.xx.xx.xx, 10.170.91.47, 127.0.0.0/8
    mynetworks_style = host
    myorigin = $mydomain
    newaliases_path = /usr/bin/newaliases.postfix
    readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
    relay_domains =
    sample_directory = /usr/share/doc/postfix-2.6.6/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtp_tls_note_starttls_offer = yes
    smtp_use_tls = yes
    smtpd_banner = $myhostname ESMTP Authorized use only
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain =
    smtpd_sasl_security_options = noanonymous
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_auth_only = no
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    smtpd_use_tls = yes
    tls_random_source = dev:/dev/urandom
    unknown_local_recipient_reject_code = 550
    [root@ip-10-170-91-47 postfix]#
    

    dig command show that MX is set correctly...

    Code:
    dig MX my-domain.biz
    
    ; <<>> DiG 9.2.4 <<>> MX my-domain.biz
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40145
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 5
    
    ;; QUESTION SECTION:
    ;my-domain.biz.               IN      MX
    
    ;; ANSWER SECTION:
    my-domain.biz.        3600    IN      MX      10 mail.my-domain.biz.
    
    ;; AUTHORITY SECTION:
    my-domain.biz.        86400   IN      NS      ns1.afraid.org.
    my-domain.biz.        86400   IN      NS      ns3.afraid.org.
    my-domain.biz.        86400   IN      NS      ns2.afraid.org.
    my-domain.biz.        86400   IN      NS      ns4.afraid.org.
    
    ;; ADDITIONAL SECTION:
    mail.my-domain.biz.   3600    IN      A       50.xx.xx.xx
    ns3.afraid.org.         390     IN      A       72.20.15.62
    ns1.afraid.org.         390     IN      A       50.23.197.95
    ns4.afraid.org.         48      IN      A       174.128.246.102
    ns2.afraid.org.         6051    IN      A       174.37.196.55
    
    ;; Query time: 88 msec
    ;; SERVER: 192.168.1.1#53(192.168.1.1)
    ;; WHEN: Tue Jan  3 00:34:54 2012
    ;; MSG SIZE  rcvd: 216
    
    I am able to telnet to mail server fine.
    Code:
    [glow@IBM ~]$ telnet mail.my-domain.biz 25557
    Trying 50.xx.xx.xx...
    Connected to mail.my-domain.biz (50.xx.xx.xx).
    Escape character is '^]'.
    220 mail.my-domain.biz ESMTP Authorized use only
    EHLO localhost
    250-mail.my-domain.biz
    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
    quit
    221 2.0.0 Bye
    Connection closed by foreign host.
    [glow@IBM ~]$
    


    I see no error in maillog
    so I think emails get lost somewhere.....
     
    Last edited: Jan 3, 2012
  2. White

    White Member

    when you send the emails, do you get postmaster emails saying "could not send" or "retrying" to send in your gmail and yahoo accounts?
     
  3. ELY_M

    ELY_M New Member

    finally they came after like a day :(.......
    took long time for the error mails to come....

    Code:
    This is an automatically generated Delivery Status Notification
    
    THIS IS A WARNING MESSAGE ONLY.
    
    YOU DO NOT NEED TO RESEND YOUR MESSAGE.
    
    Delivery to the following recipient has been delayed:
    
         [email protected]
    
    Message will be retried for 2 more day(s)
    
    Technical details of temporary failure: 
    The recipient server did not accept our requests to connect. Learn more at http://mail.google.com/support/bin/answer.py?answer=7720 
    [mail.my-domain.biz. (10): Connection timed out]
    
    ----- Original message -----
    
    MIME-Version: 1.0
    Received: by 10.14.125.146 with SMTP id z18mr18978374eeh.88.1325490834780;
     Sun, 01 Jan 2012 23:53:54 -0800 (PST)
    Received: by 10.14.125.2 with HTTP; Sun, 1 Jan 2012 23:53:54 -0800 (PST)
    Date: Mon, 2 Jan 2012 01:53:54 -0600
    Message-ID: <CAO7tG7-TbgAz=Sh5FgXT8=kwVdWmN6uLEdnHP8uSyKg_yoQOsw@mail.gmail.com>
    Subject: testttttttt 666666
    From: "ELY M." <[email protected]>
    To: [email protected]
    Content-Type: text/plain; charset=ISO-8859-1
    
    6666666666666666666666666
    
    
     
    Last edited: Jan 3, 2012
  4. White

    White Member

    is the server yours?

    is it behind a router?

    is the router setup to allow traffic to ports 25 and 10025 in the NAT - Virtual Server ? for the server?
     
  5. ELY_M

    ELY_M New Member

    it is my server. it is vps I think.
    The firewall is already set up to allow smtpd's port.
    I am using different port for smtpd.
    I said I am able to telnet to the postfix from diff box.
     
  6. White

    White Member

    i dont know, if they were getting lost then they would be being delivered somewhere and so theoretically you should have no postmaster error emails saying "The recipient server did not accept our requests to connect".

    I had these errors which is why i asked the questions as it was my router which was refusing to connect the incoming emails requests to my server.

    whats the result of

    netstat -tap
     
  7. ELY_M

    ELY_M New Member

    Code:
    
    [root@ip-10-170-91-47 postfix]# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
    tcp        0      0 *:imaps                     *:*                         LISTEN      12715/dovecot
    tcp        0      0 *:pop3s                     *:*                         LISTEN      12715/dovecot
    tcp        0      0 *:27777                       *:*                         LISTEN      1326/sshd
    tcp        0      0 *:25557                     *:*                         LISTEN      27463/master
    tcp        0      0 *:imap                      *:*                         LISTEN      12715/dovecot
    tcp        0      0 *:adobeserver-2             *:*                         LISTEN      12715/dovecot
    tcp        0      0 *:39000                     *:*                         LISTEN      7498/perl
    tcp        0    256 ip-10-170-91-47.us-west:27777 xxxxx.dhcp.ro:33655 ESTABLISHED 13026/3
    tcp        0      0 ip-10-170-91-47.us-we:34671 204.246.160.138:http        TIME_WAIT   -
    tcp        0      0 *:imaps                     *:*                         LISTEN      12715/dovecot
    tcp        0      0 *:pop3s                     *:*                         LISTEN      12715/dovecot
    tcp        0      0 *:27777                       *:*                         LISTEN      1326/sshd
    tcp        0      0 *:25557                     *:*                         LISTEN      27463/master
    tcp        0      0 *:imap                      *:*                         LISTEN      12715/dovecot
    tcp        0      0 *:adobeserver-2             *:*                         LISTEN      12715/dovecot
    [root@ip-10-170-91-47 postfix]#
    
    
     
  8. falko

    falko Super Moderator Howtoforge Staff

    The problem is that you are not using port 25 for smtp. How should Gmail and others connect to your server if you use another port?
     
  9. ELY_M

    ELY_M New Member

    blah.... I tried falko's suggestion about port 25
    I opened port 25 in firewall and open it in master.cf
    restarted postfix...
    now, I am getting test emails.
    I sent new test email and I got new test email fast.....
     

Share This Page