This might be naive.
But is it possible in Ubuntu to have a script send out emails without requiring passwords? (via a dummy mail server, maybe)
I was hoping to use this to allow my account to periodically send info to myself (a real email account), for example, when certain task is completed. And I don't really want to risk storing the password for a real, external email account on the hard drive.
Possibly, or at least it's worked for me...
My [home] ISP allows me to send mail with the only validation being my sending IP address (that I send the email from my home & not elsewhere).
I can
telnet smtp.myisp.net 25
into their mail server & enter commands needed to send email (as if I was a MUA) then exit, which of course allowed me to script it & use it for myself (alert me to jobs, events etc).
I've even had scripts send externally (not to my isp's email address), but I've also had these rejected (I didn't explore; it was sent externally because of a typo, not intentionally).
-- My use of
telnet
was NOT intended to be the end result; it was only to prove that it's possible. My script calls functions & does not shell out to telnet. Telnet was just to prove the idea worked before I wasted time scripting it, but YES this is a dirty hack.Use MSMTP.
MSMTP is a program which delivers email from a local computer to a configured mailhost (mailhub). It is not a mail server (like feature-rich mail server sendmail) and does not receive mail, expand aliases or manage a queue. One of its primary uses is for forwarding automated email (like system alerts) off your machine and to an external email address.
Upstream: https://marlam.de/msmtp/
Man Page in Ubuntu: http://manpages.ubuntu.com/manpages/bionic/man1/msmtp.1.html