Postfix + Yandex DNS MAIL RELAY

OS:

[[email protected] ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)
[[email protected] ~]# uname -a
Linux nas 2.6.32-573.3.1.el6.x86_64 #1 SMP Thu Aug 13 22:55:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Install required compotes:

[[email protected] ~]#¬†yum install cyrus-sasl-plain -y
[[email protected] ~]# yum install mail -y

 

[[email protected] ~]# vi /etc/postfix/main.cf

to the end:

# pdd.yandex.ru: SMTP-Relay config
relayhost =
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_type = cyrus
smtp_sasl_mechanism_filter = login
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
sender_canonical_maps = hash:/etc/postfix/canonical
smtp_generic_maps = hash:/etc/postfix/generic
smtp_use_tls = yes

 

 

[[email protected] ~]# vi /etc/postfix/canonical

@belomor.nl [email protected]
[[email protected] ~]# vi /etc/postfix/sasl_passwd

smtp.yandex.ru [email protected]:MYPASSWD

[[email protected] ~]# vi /etc/postfix/sender_relay

@belomor.nl smtp.yandex.ru
[[email protected] ~]# postmap /etc/postfix/canonical
[[email protected] ~]# postmap /etc/postfix/sasl_passwd
[[email protected] ~]# postmap /etc/postfix/generic
[[email protected] ~]# postmap /etc/postfix/sender_relay
[[email protected] ~]# service postfix restart

[[email protected] ~]# echo “MESSAGE” | mail -r “[email protected] (NAS SERVER)” -s “SUBJECT” [email protected]

 

[[email protected] ~]# tail -f /var/log/maillog | grep “status=sent”
Dec 20 02:58:53 nas postfix/smtp[23981]: 6DEA63220718: to=<[email protected]>, relay=smtp.yandex.ru[213.180.193.38]:25, delay=1.3, delays=0.02/0/0.55/0.69, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued on smtp4h.mail.yandex.net as 1450565933-USGDET3ys6-wrFeS5vD)

subj

 

 

 

 

 

 

 

 

:)

[[email protected] ~]# date
Sun Dec 20 03:01:30 AZT 2015