Ситуация: поднял веб-сервер на ubuntu для 3-х внутренних сайтов в сети компании. Когда захожу по ssh на него, то периодически пишет, что, мол, вам письмо. Они лежат в /var/spool/xxx, где xxx - root и другие пользователи. Как автоматически пересылать эти письма к себе на рабочую почту? Видимо, к тому же надо еще что-то сделать с hostname машины, т.к. якобы все идет от домена в виде имени машины, а ведь тогда принимающий сервер может отбросить эти письма из-за DMARC, SPF и т.д? Как быть? Что делать? Пример присланных сообщений:
root@my-ubuntu-host:/home/company-site.ru# cat /var/mail/root
From root@my-ubuntu-host Wed Aug 29 00:12:43 2018
Return-Path: <root@my-ubuntu-host>
Received: from my-ubuntu-host (localhost.localdomain [127.0.0.1])
by my-ubuntu-host (8.15.2/8.15.2/Debian-10) with ESMTPS id ww43h33erge4y5
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
for <root@my-ubuntu-host>; Wed, 29 Aug 2018 00:12:43 +0500
Received: (from root@localhost)
by my-ubuntu-host (8.15.2/8.15.2/Submit) id w7SJCggO032352
for root; Wed, 29 Aug 2018 00:12:42 +0500
Date: Wed, 29 Aug 2018 00:12:42 +0500
Message-Id: <201808281912.w7SJCggO032352@my-ubuntu-host>
From: Anacron <root@my-ubuntu-host>
To: root@my-ubuntu-host
Subject: Anacron job 'cron.weekly' on my-ubuntu-host
Content-Type: text/plain; charset=UTF-8
X-IMAPbase: 1535694118 2
Status: O
X-UID: 1
/etc/cron.weekly/update-notifier-common:
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
-----------------------------------------------------------------
From MAILER-DAEMON Mon Aug 27 16:57:58 2018
Return-Path: <MAILER-DAEMON>
Received: from localhost (localhost)
by localhost.localdomain (8.15.2/8.15.2/Debian-10) id d234rgwehw455yrt;
Mon, 27 Aug 2018 16:57:58 +0500
Date: Mon, 27 Aug 2018 16:57:58 +0500
From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <201808271157.d234rgwehw455yrt@localhost.localdomain>
To: <company-site.ru@localhost.localdomain>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="d234rgwehw455yrt.1535371078/localhost.localdomain"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
This is a MIME-encapsulated message
--d234rgwehw455yrt.1535371078/localhost.localdomain
The original message was received at Mon, 27 Aug 2018 16:57:58 +0500
from localhost.localdomain [127.0.0.1]
----- The following addresses had permanent fatal errors -----
<owner-fio@company-site.ru>
(reason: 553 5.3.5 system config error)
----- Transcript of session follows -----
553 5.3.5 company-site.ru. config error: mail loops back to me (MX problem?)
554 5.3.5 Local configuration error
550 5.1.1 postmaster... User unknown
--d234rgwehw455yrt.1535371078/localhost.localdomain
Content-Type: message/delivery-status
Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Mon, 27 Aug 2018 16:57:58 +0500
Final-Recipient: RFC822; owner-fio@company-site.ru
Action: failed
Status: 5.3.5
Diagnostic-Code: SMTP; 553 5.3.5 system config error
Last-Attempt-Date: Mon, 27 Aug 2018 16:57:58 +0500
--d234rgwehw455yrt.1535371078/localhost.localdomain
Content-Type: text/rfc822-headers
Return-Path: <company-site.ru@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.15.2/8.15.2/Debian-10) with ESMTPS id w7RBvw6r013350
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
for <owner-fio@company-site.ru>; Mon, 27 Aug 2018 16:57:58 +0500
Received: (from root@localhost)
by localhost.localdomain (8.15.2/8.15.2/Submit) id w7RBvwts013349
for owner-fio@company-site.ru; Mon, 27 Aug 2018 16:57:58 +0500
Date: Mon, 27 Aug 2018 16:57:58 +0500
From: company-site.ru <company-site.ru@localhost.localdomain>
Message-Id: <201808271157.w7RBvwts013349@localhost.localdomain>
--d234rgwehw455yrt.1535371078/localhost.localdomain--