Я пытаюсь отправить электронную почту со своего компьютера, используя gmail в качестве отправителя. Я следовал этому руководству: https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp/ и когда я пытаюсь отправить электронное письмо из командной строки:
echo "Test mail from postfix" | mail -s "Test Postfix" mymail@domain.com
Я не получаю никаких сообщений об ошибках, только электронная почта / var / mail / root, которая имеет:
From MAILER-DAEMON Wed Jun 8 12:29:25 2016
Return-Path: <>
X-Original-To: root@monitor
Delivered-To: root@monitor
Received: by monitor (Postfix)
id 68F8C22768; Wed, 8 Jun 2016 12:29:25 +0200 (CEST)
Date: Wed, 8 Jun 2016 12:29:25 +0200 (CEST)
From: MAILER-DAEMON@monitor (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
To: root@monitor
Auto-Submitted: auto-replied
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="66753226CD.1465381765/monitor"
Message-Id: <20160608102925.68F8C22768@monitor>
This is a MIME-encapsulated message.
--66753226CD.1465381765/monitor
Content-Description: Notification
Content-Type: text/plain; charset=us-ascii
This is the mail system at host monitor.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<user@domain.com>: unknown user: "user"
--66753226CD.1465381765/monitor
Content-Description: Delivery report
Content-Type: message/delivery-status
Reporting-MTA: dns; monitor
X-Postfix-Queue-ID: 66753226CD
X-Postfix-Sender: rfc822; root@monitor
Arrival-Date: Wed, 8 Jun 2016 12:29:25 +0200 (CEST)
Final-Recipient: rfc822; user@domain.com
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Postfix; unknown user: "user"
--66753226CD.1465381765/monitor
Content-Description: Undelivered Message
Content-Type: message/rfc822
Return-Path: <root@monitor>
Received: by monitor (Postfix, from userid 0)
id 66753226CD; Wed, 8 Jun 2016 12:29:25 +0200 (CEST)
subject: Backup Error!
from:backup@server01
Message-Id: <20160608102925.66753226CD@monitor>
Date: Wed, 8 Jun 2016 12:29:25 +0200 (CEST)
--66753226CD.1465381765/monitor--
Конфигурация (postconf -n):
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
mydestination = monitor, localhost.localdomain, , localhost, gmail.com
myhostname = monitor
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
Кто-нибудь может мне помочь?
Спасибо
В conf файле я думаю , mydestination должен быть похожим на это
mydestination = localhost, localhost.localdomain
После внесения изменений, необходимо перезагрузить conf
service postfix reload