There is a website, let's call it domen.com on the server with centos 7. It is necessary to receive an email with an activation link from one service. How can this be done? Here they sent me an e-mail to userdima@domen.com. Where to find this letter? There is a root file in / var / spool / mail, but the required letter is not found there.

There are no control panels on the server, just php-fpm, mariadb, bind, etc. are installed on a clean centos 7. Emails from the server via php are sent normally.

In var / named / domen.com.hosts there is a line:

@ IN MX 10 domen.com. 

Maybe something needs to be corrected in it. My server, working as root. Tell me how to solve the problem.

  • 2
    mta must be installed and configured. or use the services of any service: from google, yandex, mail.ru, yahoo, etc. // sometimes a hosting provider provides such services. - aleksandr barakin
  • "Emails from the server via php are sent normally." if php is sent then the mail server is deployed normally, then what does the author want ???????? - Denis Kotlyarov
  • @DenisKotlyarov "if php is sent, it means the mail server is deployed normally" - a very common erroneous statement. - user194374
  • "a very common fallacy." Why did it take me to deploy an email server in order to send mail with fhp, how to deploy teach it to forward all requests for Yandex. - Denis Kotlyarov

2 answers 2

You did not say a word about the mail server, whether you use it or not.

Emails are not related to your centos server.

In the DNS records of your domain there is (or should be) an MX record about which server handles mail for this domain. A mail service must be installed on the specified server in order to process the letters. Expanding all this for simple receipt of letters makes absolutely no sense. There are ready-made solutions.

If you had a hosting service, you could use the mail service there, often for free. Without hosting - use yandex.pdd , for example. Connecting it is not difficult, you will receive letters in a yandex-box, by domain name. There are more google apps for work . Choose who you like best.

    Your question is divided into several parts.

    You described the first one yourself - you need to correctly configure the DNS records. The minimum bundle is MX records, in a good way, you still need to configure SPF.

    The second part - you need to configure the actual mail server. The first option is to bring up the mail service directly on this server (for example, postfix + dovecot - let 's say the article ), the second is to use ready-made services, for example, Yandex: Mail for a domain.

    The third part is that you need to be able to access your mailbox from php and read its contents, php has functions for working with imap.