0

postfix and dovecot was installed on my vps--centos7.

I can send email to others ,why can't receive email sent by others?

No problem for ports.

netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN  

To telnet my vps.

telnet xxxxxxx  110
Trying xxxxxxxx...
Connected to xxxxxx
Escape character is '^]'.
Connection closed by foreign host.

It is no use to close firewall with systemctl stop firewalld.

How to check the bug for my dovecot?
1. doveconf -n

 # 2.2.10: /etc/dovecot/dovecot.conf
 # OS: Linux 2.6.32-042stab123.3 x86_64 CentOS Linux release 7.2.1511 (Core)  
disable_plaintext_auth = no
first_valid_uid = 1000
listen = *
log_path = /var/log/dovecot.log
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mbox_write_locks = fcntl
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
}
passdb {
  driver = pam
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
  unix_listener auth-userdb {
    mode = 0600
    user = vmail
  }
}
ssl = required
userdb {
  driver = passwd
}
  1. 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
    debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
    home_mailbox = Maildir/
    html_directory = no
    inet_interfaces = all
    inet_protocols = all
    local_recipient_maps =
    mail_owner = postfix
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,mail.$mydomain, www.$mydomain, ftp.$mydomain
    mydomain = xxxx
    myhostname = xxxx
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    myorigin = $mydomain
    newaliases_path = /usr/bin/newaliases.postfix
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
    relay_domains = $mydestination
    sample_directory = /usr/share/doc/postfix-2.10.1/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtpd_client_restrictions = permit_sasl_authenticated
    smtpd_recipient_restrictions = permit_sasl_authenticated,reject_unauth_destination,permit_mynetworks smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    unknown_local_recipient_reject_code = 550

  2. telnet xxxx 25

    Trying xxxx
    Connected to xxxxxx
    Escape character is '^]'.
    220 xxxxxx ESMTP Postfix

closed as unclear what you're asking by G-Man, peterh, roaima, dr01, DarkHeart Nov 1 '17 at 1:15

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Please provide information on your Dovecot and MDA (probably Postfix) configuration: doveconf -n, postconf -n. Can you connect to your server from outside on port 25? – Jens Erat Oct 29 '17 at 13:45
  • Do you have an MX record in DNS for your domain? – RubberStamp Oct 29 '17 at 15:10
  • 1
    Please post logs from Postfix and Dovecot of what happens when you don't receive a message. Your question can't be answered without these logs. – Satō Katsura Oct 29 '17 at 19:21
1

Does

dig domain.tld in MX

give you a response that shows something like:

domain.tld.  86400 IN MX 10 mail.domain.tld.

If not, you will need to add an MX record in DNS like this:

owner-name           ttl  class   rr  pref name
example.com.         3w   IN      MX  10   mail.example.com.

Here is a decent explanation and the source of the above example:

Mail Exchange Record (MX) on zytrax.com

0
dig  mydomain.com in MX

;; AUTHORITY SECTION:
mydomain.com        285 IN  SOA 


dig  mail.mydomain.com  in MX

;; ANSWER SECTION:
mail.mydomain.com.  300 IN  MX  10 mydomain.com

The mydomain.com was not added a MX record, mail.mydomain.com added a MX record.

To add an MX record in DNS for mydomain.com instead of mail.mydomain.com in my domainname server.

owner-name           ttl  class   rr  pref name
mydomain.com         3w   IN      MX  10   mydomain.com
  • Please don't add an answer that repeats what someone else has suggested. Instead, accept their answer. If you made slight adjustments you can add those as comments under their answer. – roaima Oct 30 '17 at 7:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.