account default
host smtp.gmail.com
port 587
auth on
user user@gmail.com
password gmail-password
auto_from off
from user@gmail.com
tls on
tls_starttls on
tls_certcheck off
logfile
syslog LOG_MAIL
nano ~/.muttrc
set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="OpenWrt"
set from=user@gmail.com
set envelope_from=yes
note: change user@gmail.com and gmail-password with your gmail credentials
command to send mail with attachment:
echo "Hello this is the body message, we are sending email with attachement using mutt and msmtp" | mutt -a "/root/file-to-attach" -s "this is the subject of the message" -- recipient@domain.com
message without attachment:
echo "Hello this is the body message, we are sending email using mutt and msmtp" | mutt -s "this is the subject of the message" -- recipient@domain.com
Users should be aware that saving "sensitive" credentials on a router or other exposed device is poor security practice. Encryption cannot be used to reduce the risk in any case where the use of the credentials is automated, without user intervention to "unlock" the credentials for that specific use. With user input needed, the user might as well enter the password directly, rather than "a password to access the password".
everything is esposed today, it's just a matter to adopt some practices to reduce the risks, like using iptables rules to allow only authorized ip to login and using non standard ports for services like ssh and luci (uhttp), also it is important to disable all services not in use.
I'm sure it is more secure an OpenWrt router than any Windows desktop/laptop PC or Android smartphone
Did have some good book or reference practice for security management or programming in OpenWrt, I have many devices to manage, but newer to openwrt programming:)