- Download ngrok
- Extract
- Move
ngrok
binary in mailer folder
sudo apt install msmtp msmtp-mta ca-certificates
https://myaccount.google.com/lesssecureapps and check the toggle
Google Account/2Fa
Google Account/Security/App Password
sudo vim /etc/msmtprc
Content
# Generics
defaults
auth on
tls on
# following is different from ssmtp:
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# user specific log location, otherwise use /var/log/msmtp.log, however,
# this will create an access violation if you are user pi, and have not changes the access rights
logfile ~/.msmtp.log
# Gmail specifics
account gmail
host smtp.gmail.com
port 587
from dummy
user [email protected]
password App Password
# Default
account default : gmail
/var/lib/motioneye/Camera1/
/home/pi/mailer
crontab -e
@reboot sleep 30 && /home/pi/mailer/ngrokmailer.sh
@weekly /home/pi/mailer/ngrokmailer.sh