I have a script that send email using sendEmail (CentOS shell) script is:
sendEmail -vvv -u "TestCompany, Inc.: USB Added" -f [email protected] -t [email protected] -s ASPMX.L.GOOGLE.com -m "USB Activity" -o tls=aut
o [email protected] password=password
So far this works fine.
Now i create a ConfigFile as follows:
Company=TestCompany, Inc.
[email protected]
Password=password
[email protected]
Smtp=ASPMX.L.GOOGLE.com
and Now I modify my script as follow:
#!/bin/sh
i=1;
while IFS="=" read VAR VALUE
do
VAR="${VAR// }"
Values[$i]=${VALUE}
let i++;
done < ConfigFile
sendEmail -vvv -u "${Values[1]}: USB Added" -f ${Values[2]} -t ${Values[4]} -s ${Values[5]} -m "Test Email" -o tls=auto username=${Values[2
]} password=${Values[3]}
I get following error:
'25 failed: IO::Socket::INET: Bad hostname 'ASPMX.L.GOOGLE.comempt to ASPMX.L.GOOGLE.com
Apr 21 12:11:35 box2 sendEmail[26378]: HINT => Try specifying a different mail relay with the -s option.
Now I'm unable to understand that why I'm getting this error. even when i try to echo Values it shows me correct values. then where I'm doing wrong.? Please help. thanks.