文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>命令行发信工具:sendEmail

命令行发信工具:sendEmail

时间:2009-04-10  来源:linewer

    前段时间搞系统监控,当机器出现问题时需要通过邮件报警通知,用专门的邮件服务器Sendmail or Postfix有点"杀鸡用牛刀"的感觉,无意中在找到一个命令行的工具sendEmail(乍看和Sendmail很像,注意多了一个E,perl写的).用起来挺好,而且支持多平台.最新版是2006年的v1.55(其实用Python也可自己实现的,就像前面的发送天气预报一样)

1.About SendEmail:

SendEmail is a lightweight, command line SMTP email client. If you have the need to send email from a command line, this free program is perfect: simple to use and feature rich. It was designed to be used in bash scripts, batch files, Perl programs and web sites, but is quite adaptable and will likely meet your requirements. SendEmail is written in Perl and is unique in that it requires NO MODULES. It has an intuitive and flexible set of command-line options, making it very easy to learn and use.
[Supported Platforms: Linux, BSD, OS X, Windows 98, Windows NT, Windows 2000, & Windows XP]
500)this.width=500;" border="0">
其实最长用的是 ./sendEmail -f [email protected] -t [email protected] -cc [email protected] -u "Test" -m "Nothing, just test it" (-o message-file=yourfile) -a attachmentfile -s smtp.gmail.com -xu yourname -xp youguessit  (-o tls)

2.还发现个问题:
(1).我若以gmail的smtp发送没问题,而且收发信很快
(2).以sohu的smtp发送,偶尔会出现类似下面的信息:
Apr 10 19:52:23 localhost sendEmail[22019]: ERROR => Received:     451 4.2.1 CONTENT REJECT:sohu engine content reject [email protected]:http://mail.sohu.com/info/policy/14
     重新发送就没问题了,很怪异的事
(3).若是以sina的smtp发送,99%会出现(有一次成功过,不过是延迟了1个小时后收到的,后来再也没成功发送过):
Apr 10 19:56:11 localhost sendEmail[22285]: ERROR => Received:     500 #5.5.1 command not recognized
我一开始是用sina的账户给我自己的gmail发信,一直出现这个错误,开始怀疑这个程序有问题,后来换gmail的可以,换sohu的也可以.不晓得怎么会是这样?

   3. 其网站上说可以发送anonymous邮件,但是我用gmail的账户测试了下 -f 选项[email protected],From栏内为"[email protected]<[email protected]>"其实算不上匿名的
   4. 对于Encrypted Email,按照网站上的例子实验下,可以发送,并以附件形式发送签名的信息,但是二进制的,大致能看出我的signed_message的信息。关键对openssl生成的私钥,证书,还有.pem不是很熟,有空好好研究下。
文件: sendEmail-v1.55.tar.gz
大小: 26KB
下载: 下载


 Reference:
http://www.hack4.com/article/hack4-10529.html
http://www.cnscn.org/htm_data/35/0710/11411.html
http://blog.csdn.net/leftatrium/archive/2006/04/11/658732.aspx
https://www.myssl.cn/openssl/createpem.asp
http://blog.csdn.net/gisfarmer/archive/2009/02/27/3943460.aspx
http://www.tektalk.cn/2008/10/03/%E7%8E%8B%E5%B0%8F%E4%BA%91%E6%95%99%E6%8E%88%E7%A9%B6%E7%AB%9F%E6%98%AF%E5%A6%82%E4%BD%95%E9%9C%87%E6%92%BC%E5%AF%86%E7%A0%81%E5%AD%A6%E7%95%8C%E7%9A%84/
相关阅读 更多 +
排行榜 更多 +
别惹神枪手安卓版

别惹神枪手安卓版

冒险解谜 下载
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载