You need to use the -H parameter for sendmail and enclose the exec openssl in quotes.dave14305
Whole evolution is result of many errors)
Now it says:
Code:+ [ 0 = 0 ] + [ connected = connected ] + FROM=my email + AUTH=my login + PASS=my pass + FROMNAME=Your Router + TO=my email + echo Subject: WAN state notification + echo From: \Your Router\<my email> + date -R + echo Date: Fri, 05 Jun 2020 21:08:14 +0300 + echo + echo I just got connected to the internet. + echo + cat /tmp/mail.txt + sendmail exec openssl s_client -quiet -CAfile /tmp/Equifax_Secure_Certificate_Authority.pem -connect smtp.gmail.com:587 -tls1 -starttls smtp -fmyemail -aumylogin -apmypass myemail sendmail: can't connect to remote host (127.0.0.1): Connection refused + rm /tmp/mail.txt
sendmail: can't connect to remote host (127.0.0.1): Connection refused
Code:
sendmail -H 'exec openssl s_client -quiet -CAfile /tmp/Equifax_Secure_Certificate_Authority.pem -connect smtp.gmail.com:587 -tls1 -starttls smtp' -fmyemail -aumylogin -apmypass myemail