dzenlife
2/9/2017 - 11:27 AM

ssmtp https://serveradmin.ru/nastroyka-email-opoveshheniy-v-zabbix/

1. yum install -y ssmtp
apt install ssmtp

2. /etc/ssmtp/ssmtp.conf 

3. /etc/ssmtp/revaliases

4. echo "test_message" | ssmtp -v yusupovomar@gmail.com

5. 
cat /etc/zabbix/zabbix_server.conf | grep AlertScriptsPath
cd /usr/lib/zabbix/alertscripts
mcedit mail.sh
chmod 0777 mail.sh
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=postmaster

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=mail

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=server.np.net

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=YES

root=email
mailhub=smtp.yandex.ru:465
AuthUser=email
AuthPass=
AuthMethod=LOGIN
FromLineOverride=YES
UseTLS=YES
RewriteDomain=server.zabbix
Hostname=server.zabbix
Debug=YES
root:zabbix@zeroxzed.ru:smtp.yandex.ru:465
1. Поднять сетевой интерфейс sudo ifup eth0
#!/bin/sh
export smtpemailfrom=testmail64@yandex.ru
echo "To: $1" > /tmp/mymailinput
echo "Subject: $2" >> /tmp/mymailinput
echo "Content-Type: text/plain; charset="utf-8"" >> /tmp/mymailinput
echo "From: \"Zabbix Server\"<$smtpemailfrom>" >> /tmp/mymailinput
echo "" >> /tmp/mymailinput
echo "$3" >> /tmp/mymailinput