Sendmail和Postfix不从CentOS服务器发送邮件?

时间:2022-10-23 19:00:29

So I'm having some issues with the PHP mail function. I'm trying send users an email with a verification link. The thing is, it's not sending the email. I know for sure that the code is correct.

所以我在PHP邮件功能方面遇到了一些问题。我正在尝试向用户发送包含验证链接的电子邮件。问题是,它不是发送电子邮件。我确信代码是正确的。

In the /var/log/maillog I can see a message saying:

在/ var / log / maillog中,我可以看到一条消息:

'Feb 28 10:46:04 postfix/smtp[18038]: connect to gmail-smtp-in.l.google.com[74.125.136.26]:25: Connection timed out Feb 28 10:46:34 postfix/smtp[18038]: connect to alt1.gmail-smtp-in.l.google.com[74.125.130.26]:25: Connection timed out Feb 28 10:47:04 postfix/smtp[18038]: connect to alt2.gmail-smtp-in.l.google.com[64.233.189.26]:25: Connection timed out Feb 28 10:47:34 postfix/smtp[18038]: connect to alt3.gmail-smtp-in.l.google.com[173.194.72.26]:25: Connection timed out Feb 28 10:48:04 postfix/smtp[18038]: connect to alt4.gmail-smtp-in.l.google.com[74.125.25.26]:25: Connection timed out'

'Feb 28 10:46:04 postfix / smtp [18038]:connect to gmail-smtp-in.l.google.com [74.125.136.26]:25:连接超时2月28日10:46:34 postfix / smtp [ 18038]:连接到alt1.gmail-smtp-in.l.google.com [74.125.130.26]:25:连接超时2月28日10:47:04 postfix / smtp [18038]:connect to alt2.gmail-smtp -in.l.google.com [64.233.189.26]:25:连接超时2月28日10:47:34 postfix / smtp [18038]:connect to alt3.gmail-smtp-in.l.google.com [173.194 .72.26]:25:连接超时2月28日10:48:04 postfix / smtp [18038]:connect to alt4.gmail-smtp-in.l.google.com [74.125.25.26]:25:连接超时'

I'm pretty sure something is blocking the SMTP (25) from sending, I just don't know what it is.

我很确定有什么东西会阻止SMTP(25)发送,我只是不知道它是什么。

Does anybody have a suggestion on what to do? What could be the issue?

有人建议怎么办?可能是什么问题?

P.S. SELinux is disabled.

附: SELinux被禁用。

1 个解决方案

#1


0  

Why are you runnning postfix and dovecot? You need a properly configured mail relay (postfix) to send email from your php server. Since you're already using gmail I would recommend this:

你为什么要运行postfix和dovecot?您需要一个正确配置的邮件中继(postfix)来从您的PHP服务器发送电子邮件。由于你已经在使用gmail,我建议你:

https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/

#1


0  

Why are you runnning postfix and dovecot? You need a properly configured mail relay (postfix) to send email from your php server. Since you're already using gmail I would recommend this:

你为什么要运行postfix和dovecot?您需要一个正确配置的邮件中继(postfix)来从您的PHP服务器发送电子邮件。由于你已经在使用gmail,我建议你:

https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/