У меня есть сайт Drupal 8, установленный на сервере Ubuntu 18.04 с PostFix.
Я могу отправлять и получать электронные письма, но сервер не может отправлять уведомления самому себе.
Адрес почтового сервера: contact@example.com.
Если пользователь использует контактную форму на моем сайте, я получаю такую ошибку:
Ошибка при отправке электронной почты (с contact@example.com на contact@example.com с ответом на (ответ на заголовок) на undefined)
Как я могу это исправить ?
Вот исходный код электронного письма, отправленного с contact@benefitime.com на contact@s1biose.com
Он работает.
Но когда drupal уведомляет или пользователь использует контактную форму, сайт отправляет с contact@benefitime.com на contact@benefitime.com, это не работает.
Return-Path: <contact@benefitime.com>
Delivered-To: contact@s1biose.com
Received: from localhost (HELO queue) (127.0.0.1)
by localhost with SMTP; 15 Mar 2020 19:43:40 +0200
Received: from unknown (HELO output27.mail.ovh.net) (10.110.115.126)
by mail261.mgra1.mail.ovh.net with AES256-GCM-SHA384 encrypted SMTP; 15 Mar 2020 19:43:40 +0200
Received: from vr20.mail.ovh.net (unknown [10.101.8.20])
by out27.mail.ovh.net (Postfix) with ESMTP id 48gRcX5GTVz7s9BnY
for <contact@s1biose.com>; Sun, 15 Mar 2020 17:43:40 +0000 (UTC)
Received: from in31.mail.ovh.net (unknown [10.101.4.31])
by vr20.mail.ovh.net (Postfix) with ESMTP id 48gRcX3QFqzvvn3W
for <contact@s1biose.com>; Sun, 15 Mar 2020 17:43:40 +0000 (UTC)
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=51.178.63.62; helo=benefitime.com; envelope-from=contact@benefitime.com; receiver=contact@s1biose.com
Authentication-Results: in31.mail.ovh.net;
dkim=pass (2048-bit key; unprotected) header.d=benefitime.com header.i=@benefitime.com header.b="B7WUCtqE";
dkim-atps=neutral
Received: from benefitime.com (benefitime.com [51.178.63.62])
by in31.mail.ovh.net (Postfix) with ESMTPS id 48gRcX39t7zbyMDr
for <contact@s1biose.com>; Sun, 15 Mar 2020 17:43:40 +0000 (UTC)
Received: from [127.0.0.1] (localhost [127.0.0.1])
by benefitime.com (Postfix) with ESMTP id 01FFD450F5
for <contact@s1biose.com>; Sun, 15 Mar 2020 18:43:33 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=benefitime.com;
s=smtp; t=1584294214;
bh=jBaVruxH1CZZTsdxWSA6NPgxknU4XKU2xa+4nwQPye4=;
h=Date:Subject:From:Reply-To:To:From;
b=B7WUCtqEsNIdY381S895vJVYr95BI2TFOSMalFjothHA7iz6+f/TTmTaIKHfmPaVP
TMt9FyhGghE4AYGNW1Siop8ptthH+2bUiw82vZoyk8JSFyGMmhY61u3kBYX8MFO+aG
SyhO8cgdRsEcKkC1qi/vNKcqrh/EvnlXc4HCE7hBfGA25YwLa4zEie+sXyw78QGlXi
xfnhTvn7tECverT55dnBGApnqRQEJ/cwDcrdU1KaUfP6Xz8fZBVNehwRC5rs1/Xvqe
r/3FpfSWQv2YROpjr5wz+3SdHGjXPSYT2BIwxPaH4UKb0xZgXoO0DzfS3/ss3w8/8O
inAIpATCj+Q0A==
Sender: contact@benefitime.com
Message-ID: <4815781c692120a012395005f661866f@www.benefitime.com>
Date: Sun, 15 Mar 2020 18:43:33 +0100
Subject: Swift Mailer has been successfully configured!
From: contact@benefitime.com
Reply-To: contact@benefitime.com
To: contact@s1biose.com
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="_=_swift_v4_1584294213_a5b48ab827ac3ceb2beded1da2283938_=_"
X-Mailer: Drupal
X-Ovh-Remote: 51.178.63.62 (benefitime.com)
X-Ovh-Tracer-Id: 7587439473018712399
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrudefuddgtdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpehskfffuffhrhfvgggtofesrgdtjhhtredtjeenucfhrhhomheptghonhhtrggtthessggvnhgvfhhithhimhgvrdgtohhmnecukfhppeehuddrudejkedrieefrdeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehinhefuddrmhgrihhlrdhovhhhrdhnvghtpdhinhgvthephedurddujeekrdeifedriedvpdhmrghilhhfrhhomheptghonhhtrggtthessggvnhgvfhhithhimhgvrdgtohhmpdhrtghpthhtoheptghonhhtrggtthesshdusghiohhsvgdrtghomh
X-Ovh-Spam-Status: OK
X-Ovh-Spam-Reason: vr: OK; dkim: disabled; spf: disabled
X-Ovh-Message-Type: OK
--_=_swift_v4_1584294213_a5b48ab827ac3ceb2beded1da2283938_=_
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=20
DEAR ADMINISTRATEUR,
This e-mail has been sent from benefiTime by the Swift Mailer module.
The module has been successfully configured.
Kind regards
The Swift Mailer module
=20
--_=_swift_v4_1584294213_a5b48ab827ac3ceb2beded1da2283938_=_
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style type=3D"text/css">
table tr td {
font-family: Arial;
font-size: 12px;
}
</style>
</head>
<body>
<div>
<table width=3D"800px" cellpadding=3D"0" cellspacing=3D"0">
<tr>
<td>
<div style=3D"padding: 0px 0px 0px 0px;">
<h3>Dear administrateur,</h3>
<p>This e-mail has been sent from benefiTime by the Swift Mailer module. T=
he module has been successfully configured.</p>
Kind regards<br /><br />
<p>The Swift Mailer module</p>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
--_=_swift_v4_1584294213_a5b48ab827ac3ceb2beded1da2283938_=_--
Вот журналы PostFix (отправьте по адресу contact@benefitime.com, который не работает):
Mar 16 00:08:34 www-benefitime-com postfix/smtpd[31465]: warning: cannot get RSA certificate from file "/etc/mail/ssl/benefitime.com/benefitime.com.bundle.crt": disabling TLS support
Mar 16 00:08:34 www-benefitime-com postfix/smtpd[31465]: warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:288:fopen('/etc/mail/ssl/benefitime.com/benefitime.com.bundle.crt','r'):
Mar 16 00:08:34 www-benefitime-com postfix/smtpd[31465]: warning: TLS library problem: error:20074002:BIO routines:file_ctrl:system lib:../crypto/bio/bss_file.c:290:
Mar 16 00:08:34 www-benefitime-com postfix/smtpd[31465]: warning: TLS library problem: error:140DC002:SSL routines:use_certificate_chain_file:system lib:../ssl/ssl_rsa.c:615:
Mar 16 00:08:34 www-benefitime-com postfix/smtpd[31465]: connect from localhost[127.0.0.1]
Mar 16 00:08:34 www-benefitime-com postfix/smtpd[31465]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <contact@benefitime.com>: Recipient address rejected: User unknown in local recipient table; from=<contact@benefitime.com> to=<contact@benefitime.com> proto=ESMTP helo=<[127.0.0.1]>
Mar 16 00:08:34 www-benefitime-com postfix/smtpd[31465]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=0/1 rset=1 quit=1 commands=4/5
Вот журналы PostFix (отправьте на contact@s1biose.com, который работает):
Mar 16 00:11:13 www-benefitime-com postfix/smtpd[31568]: warning: cannot get RSA certificate from file "/etc/mail/ssl/benefitime.com/benefitime.com.bundle.crt": disabling TLS support
Mar 16 00:11:13 www-benefitime-com postfix/smtpd[31568]: warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:288:fopen('/etc/mail/ssl/benefitime.com/benefitime.com.bundle.crt','r'):
Mar 16 00:11:13 www-benefitime-com postfix/smtpd[31568]: warning: TLS library problem: error:20074002:BIO routines:file_ctrl:system lib:../crypto/bio/bss_file.c:290:
Mar 16 00:11:13 www-benefitime-com postfix/smtpd[31568]: warning: TLS library problem: error:140DC002:SSL routines:use_certificate_chain_file:system lib:../ssl/ssl_rsa.c:615:
Mar 16 00:11:13 www-benefitime-com postfix/smtpd[31568]: connect from localhost[127.0.0.1]
Mar 16 00:11:13 www-benefitime-com postfix/smtpd[31568]: 8A8A3450F5: client=localhost[127.0.0.1]
Mar 16 00:11:13 www-benefitime-com postfix/cleanup[31571]: 8A8A3450F5: message-id=<57471c64b44d07b54a30e30748492978@www.benefitime.com>
Mar 16 00:11:13 www-benefitime-com postfix/qmgr[16755]: 8A8A3450F5: from=<contact@benefitime.com>, size=1789, nrcpt=1 (queue active)
Mar 16 00:11:13 www-benefitime-com postfix/smtpd[31568]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Mar 16 00:11:19 www-benefitime-com postfix/smtp[31572]: 8A8A3450F5: to=<contact@s1biose.com>, relay=mx1.mail.ovh.net[188.165.36.237]:25, delay=5.8, delays=0.12/0.03/5.4/0.18, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 48gZtb24zLzbqg8w)
Mar 16 00:11:19 www-benefitime-com postfix/qmgr[16755]: 8A8A3450F5: removed
Журналы Postfix сообщают вам, что не так: вы хотите отправить (локальному) пользователю contact
. Но локальный пользователь contact
не существует. И поэтому postfix не принимает электронную почту.
Вам нужно создать пользователя contact
или создайте псевдоним адреса электронной почты contact
для уже существующего пользователя.
Кроме того, вы должны исправить проблемы TLS, о которых сообщает postfix.