0
我有使用sendEmail(CentOS的壳) 脚本发送电子邮件的脚本:sendEmail:Linux的脚本和阵列
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
到目前为止,这工作得很好。
现在我创建一个ConfigFile实现如下:
Company=TestCompany, Inc.
[email protected]
Password=password
[email protected]
Smtp=ASPMX.L.GOOGLE.com
,现在我修改我的脚本如下:
#!/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]}
我获得以下错误:
'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.
现在的我米无法理解,为什么我得到这个错误。即使当我尝试回显值时,它显示出正确的值。那么我在哪里做错了。?请帮忙。谢谢。