Перейти до основного вмісту

Sending mails from linux shell

You need to have ssmtp and mutt installed.

/etc/ssmtp/ssmtp.conf
root=sasha@e-mail.ua
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=sasha@e-mail.ua
UseSTARTTLS=YES
AuthUser=sashao@e-mail.ua
AuthPass=somepass
FromLineOverride=YES

/etc/ssmtp/revaliases
root:sasha@e-mail.ua:smtp.gmail.com:587
oomel:sasha@e-mail.ua:smtp.gmail.com:587
#localusername:username@gmail.com:smtp.gmail.com:587

~/.muttrc
set sendmail = /usr/sbin/ssmtp
unset record


Done! Now send mails like this:

echo "m body of email" | mutt -s "subject of email" sashao@bigmir.net -a /home/oomel/softserve.gif

Коментарі

Популярні дописи з цього блогу

Home assistant - modbus - HHC-N8I8OP

Thanks to https://www.cncwiki.org/index.php?title=HHC-N8I8OP  I managed to connect this buggy module to home assistant using modbus integration: It is important to have verify delay big to not break logic.  modbus:   - type: tcp     host: 192.168.222.222     port: 5000     name: "modbus1"     switches:       - name: "hhc_r8"         address: 16         write_type: coil         verify:           delay: 36       - name: "hhc_r7"         address: 17         write_type: coil         verify:           delay: 37       - name: "hhc_r6"   ...

HomeAssistant gadinan camera rest commands pan and tilt

 Add following to restcommand.yaml and include in config.yaml:   # rest_command: ptz_control_right : url : "http://192.168.16.253/PSIA/YG/PTZCtrl/channels/0/continuous?pan=1&tilt=0" method : PUT headers : Cookie : "cur_UserInfo=admin%3A123456; cur_userName=admin;" Content-Length : "0" ptz_control_left : url : "http://192.168.16.253/PSIA/YG/PTZCtrl/channels/0/continuous?pan=-1&tilt=0" method : PUT headers : Cookie : "cur_UserInfo=admin%3A123456; cur_userName=admin;" Content-Length : "0" ptz_control_stop : url : "http://192.168.16.253/PSIA/YG/PTZCtrl/channels/0/continuous?pan=0&tilt=0" method : PUT headers : Cookie : "cur_UserInfo=admin%3A123456; cur_userName=admin;" Content-Length : "0" ptz_control_up : url : "http://192.168.16.253/PSIA/YG/PTZCtrl/channels/0/continuous?pan=0&tilt=1" method : PUT headers : Cookie : "c...