Dryice Liu
非常感谢aiwha, delphij, intron, liue等各位在我第一次发PR时的帮助.本文 的最新版将放在 http://dryice.3322.org/computer/FreeBSD/Chinese/sendpr.html
所谓反向解析,就是从一个给定的IP,找出对应的域名.我们平时上网用的DNS解 析,是从域名到IP,这个是由域名的所有者设定的.而反向DNS解析,是由IP的所 有者(通常是ISP)设定的.
我们中很多人用的是动态IP,ISP不可能给我们设反向DNS解析,更不用说很多是 内网上网,或是在虚拟机里装的FreeBSD了.即使是使用固定IP的网友,也很少有 人能让他的ISP给他设反向解析.这样,当我们在自己的FreeBSD里面用send-pr发 PR的时候,过不了多久就会收到退信,象这样:
450 Client host rejected:
cannot find your hostname, [xxx.xxx.xxx.xxx]
这样,除非你能在一台有反向解析的FreeBSD机器上有账号,要不然就只能想办 法骗过FreeBSD的mail server,让它以为信是从另一台有反向解析的机器上发出 的。这就是我们下面要介绍的办法:使用ssmtp
安装完后,需要修改/usr/local/etc/ssmtp/ssmtp.conf文件进行配置:
好,现在可以来设置使用send-pr了.这一步的关键是设置MAIL_AGENT
变量,send-pr会根据就个变量发信.我们需要所它指向ssmtp,我常用的是这样:
/usr/local/sbin/ssmtp -v -t -au 我的账号 -ap 我的密码可以man ssmtp看参数的具体含意,其中 -au 和 -ap 适用于需要smtp验证的情 况.
好了,现在可以运行send-pr,把``To:''改成自己常用的地址,发一封信试试了. 一开始可以打开ssmtp的``-v''参数,可以看到和smtp服务器的对话,来判断错 误出在哪.注意现在很多的smtp服务器都限制只给自己的用户发信,所以你很可 能需要把``From''一栏设成你新申请的mail地址.不过我们可以把reply-to设成 自己常用的地址,这样就不用多检查一个邮箱了 :)
(setq message-send-mail-function 'feedmail-send-it)
(add-hook 'message-mail-send-hook
'feedmail-mail-send-hook-splitter)
(setq feedmail-buffer-eating-function
'feedmail-buffer-to-ssmtp)
(setq feedmail-ssmtp-template
"/usr/local/sbin/ssmtp -v -t
-au xxxxx -ap xxxxxxxxxx")
(defun feedmail-buffer-to-ssmtp (prepped errors-to addr-listoid)
"Function which actually calls ssmtp as a subprocess.
Feeds the buffer to it.
derived from feedmail-buffer-to-binmail"
(set-buffer prepped)
(apply
'call-process-region
(append (list (point-min) (point-max)
"/bin/sh" nil errors-to nil "-c"
(format feedmail-ssmtp-template)))))
使用其它mail client的BSDer也应该有办法,只要把信件的内容做为stdin传给 ssmtp就可以了.
This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -split +0 -no_navigation sendpr.tex
The translation was initiated by Dryice Liu on 2003-12-26