I wrote a pretty easy script to send some emails using mailx. The script is working fine but I'm trying to use a different sender email address and I've tried almost everything and is not working for me. I have the feeling that the gmail cert somehow is overwriting whatever I'm defining as the sender.
This is the code:
for i in ${EMAILS[@]}; do
mailx -s "Let me introduce myself" -r "Company <company@company.com>" -S replyto="company@company.com" $i <<eof
Hello World,
I'm an automate email
eof
done
Everytime that I recevie an email the sender email is "Company mypersonalgmail@gmail.com".
I've added this lines at the end of the main.cf file on /etc/postfix
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
And finally, I've created the /etc/postfix/sasl_passwd file with my personal gmail info (login+password).
Any kind of help would be much appreciated.
Thanks!