Затык произошел на этапе отправки письма с помощью PHP
?php
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "hostname@domain.ru";
$to = "hostname@domain.ru";
$subject = "PHP Mail Test script";
$message = "This is a Mail from HOSTNAME";
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);
echo "Test email sent";
?>
-------------------------
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
-------------------------
uname -vr
4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:00:59 UTC 2016
-------------------------
postconf -n
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
inet_interfaces = all
inet_protocols = ipv4
mail_name = name@domain.ru
mydestination = smtp.yandex.ru, localhost
mydomain = domain.ru
myhostname = domain.ru
readme_directory = no
relay_domains = smtp.yandex.ru
relayhost =
sender_canonical_maps = hash:/etc/postfix/canonical
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = login
smtp_sasl_password_maps = hash:/etc/postfix/yandex_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_type = cyrus
smtp_sender_dependent_authentication = yes
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (HOST_NAME)
-------------------------
/etc/aliases :
postmaster: hostname@domain.ru
root: hostname@domain.ru
-------------------------
/etc/hosts :
127.0.0.1 localhost
127.0.0.1 hostname
# The following lines are desirable for IPv6 capable hosts
#::1 localhost ip6-localhost ip6-loopback
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
-------------------------
Лог ошибки:
host smtp.yandex.ru[77.88.21.38] said: 503 5.5.4 Error:
send AUTH command first. (in reply to MAIL FROM command)
-------------------------
P.S.
через команду mail почта до яндекса доходит, только попадает в спам!