I am trying to write a bash script that will be executed by a cron job which, under certain circumstances, will send me an email.
To try to get sendmail to work with the Sendgrid SMTP settings, I edited the /etc/postfix/main.cf file with the following:
smtp_sasl_password_maps = static:<username>:<password> smtp_sasl_security_options = noanonymous smtp_tls_security_level = may smtp_tls_security_level=encrypt header_size_limit = 4096000 relayhost = [smtp.sendgrid.net]:587
I restarted the postfix using sudo / etc / init.d / postfix restart
And tried to send an email from the command line using the following command:
sendmail my@email.com </tmp/email.txt
The result is the following:
You have new mail in / var / mail / ubuntu
Why send sendgrid with my email inbox using the Sendgrid SMTP parameters specified in main.cf?
Please note that this question only applies to sendmail, I do not want to install other SMTP clients and applications, it should work as is.
source share