sending mails with port number 587 bash script help
Hi All,
We have some shell scripts which will send emails about backup, alerts etc using mail command. Example. Code:
echo "Test Mail" | mail -s "Test" me@mydomain.com Thanks in advance. |
I send mail over 587. In /etc/mail/sendmail.mc I have the following lines.
Code:
define(`RELAY_MAILER_ARGS', `TCP $h 587') define(`ESMTP_MAILER_ARGS', `TCP $h 587') |
Thanks for the reply.
Where should I edit this i.e the /etc/mail/sendmail.mc is from our mail server or any local PC/Laptops where shell script will be running. I just wanted to define smtp settings only in each shell scripts of our local servers because one of our public IP itself has been blacklisted and not able send mails to our mail server with shell scripts because of rbl enabled in our mail server. But we have made sure that our local servers can send mails with port 587 with gerrit service after changing the port number to 587 in gerrit configuration file. But not able to send mails with shell scripts which still may be trying to connect default port 25 of our mail server and getting deny error. So expecting your kind help to define the smpt port number in each bash shell scripts rather than editing the global configuration files of our local servers as few are using sendmail and few servers are using postfix. |
Quote:
Code:
echo "Test mail" | mail -S smtp=smtps://server:port -s "Test" me@mydomain.com |
Even if your IPs have been blacklisted to the world you should still be able to have control over your own mailserver to White list them.
What mailserver or MTA are you running? |
All times are GMT -5. The time now is 12:21 PM. |