U
U
Urukhayy2014-10-21 11:36:20
PHP
Urukhayy, 2014-10-21 11:36:20

Why are emails not sent using the mail() function?

At first, as soon as I installed VPS, I immediately installed postfix, and did not configure anything, did not even create a mailing address for the domain associated with the VPS. I started sending letters with the mail() function, in the FROM field: I indicated a fictitious mail that does not exist, but after the '@' dog icon there was my site domain, which is linked to the VPS. Of course, because of this, letters did not reach mail.ru, because I don’t have such a mailbox on my VPS, butreached temporary email (there are such services), and this meant that the mail was somehow sent. But I need to go to both gmail and Yandex. I googled, started setting up the "mail server", eventually installed devocot and started to set up something according to the instructions, and not really understanding what exactly I was setting up, because I don't have much experience with mail on VPS. I don't even know where the letters go and how they are stored. Well, I installed it, somehow configured something, as a result, the mail () function does not send letters at all, even
to a temporary email service, stupidly a php page with one line - sending a letter stopped loading, and the browser wheel keeps spinning and spinning .
In general, I would like more tips and instructions on how to set up this mail on a VPS so that it is normally sent to all gmal, yandex and other mailers, so that a mail address like [email protected] is configured and really exists the like.
I will say right away that there is no ISP. To access and manage the VPS, I have 2 ways that are convenient for me - FTP and the Putty program, this is the bare minimum, but this is quite enough, so I don’t want to download any web interfaces, because it’s better to administer the server with a console.
Centos 6.
Last 10 lines from the mail log var/log/maillog

Oct 21 04:40:56 p2725053 postfix/master[787]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Oct 21 04:41:56 p2725053 postfix/smtpd[941]: fatal: open database /etc/postfix/aliases.db: No such file or directory
Oct 21 04:41:57 p2725053 postfix/master[787]: warning: process /usr/libexec/postfix/smtpd pid 941 exit status 1
Oct 21 04:41:57 p2752053 postfix/master[787]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Oct 21 04:42:58 p2725053 postfix/smtpd[945]: fatal: open database /etc/postfix/aliases.db: No such file or directory
Oct 21 04:42:59 p2725053 postfix/master[787]: warning: process /usr/libexec/postfix/smtpd pid 945 exit status 1
Oct 21 04:42:59 p2752053 postfix/master[787]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Oct 21 04:43:59 p2752053 postfix/smtpd[947]: fatal: open database /etc/postfix/aliases.db: No such file or directory
Oct 21 04:44:00 p2750253 postfix/master[787]: warning: process /usr/libexec/postfix/smtpd pid 947 exit status 1
Oct 21 04:44:00 p2725053 postfix/master[787]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2014-10-21
@DmitriyEntelis

1) Make yourself a separate domain from which you will send mailing lists, notifications, etc.
2) Connect it to pdo.yandex.ru, create a mailbox there from which the mailing will go.
3) Additionally, connect it to https://postmaster.yandex.ru/
4) Configure DKIM and SPF records help.yandex.ru/postoffice/security.xml
5) Use any php solution that can send mail via smtp (for example, swiftmailer )
In principle, instead of Yandex, you can use any mail you like.

N
Nikita, 2014-10-21
@Rema1ns

and what does it say in the logs? since you set up mail, then during the setup process you had to specify the paths for mail logs, I would like to see what is there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question