9月 062011
 

Is my DNS a Mess? Probably!!

We don’t have time and space here to fix all those problems, but I’d like to concentrate now on:

How to Keep Your DNS from Blocking Mail Delivery from your and your Clients’ Mail Servers

Short, snappy headlines rule, OK!

IPv6, when widely implemented (you do have a plan, don’t you?) will fix a ton of Internet security problems. Until Nirvana arrives, we’ll have to do the best we can with the (DNS) technology in hand, which is a lot better than than mess we’ve got now.

Since I’ve become involved with postfix, a wonderful Mail Tranfser Agent (MTA) by Wietse Venema and IBM, used as the basis of my IMGate project (see link in left column), I’ve learned a lot about how advanced MTA’s such as postfix, qmail, and the latest version of sendmail can be setup to triangulate and validate any other mail servers who want to send them mail.

Using postfix as as example, just take a look at this page: Continue reading »

8月 262010
 

目前RBL服务器一般采用DNS查询或DNS区域传输的方法.国内的RBL服务器比较少,而且数据库比较小.国外的RBL服务器维护的数据库比较大,但使用起来由于国际网络原因经常有超时现象发生.企业应该根据自己收到的垃圾邮件的种类来选择合适的RBL.下面说几个常用的:

国内的:
国内的实时黑名单服务(RBL)做的最大的就是anti-spam. 它的官方网站是: http://www.anti-spam.org.cn
它提动的实时黑名单服务(RBL)主要包括四个部分:CBL、CDL和CBL+、CBL-。
CBL包含近期中国国内的主要垃圾邮件发送源。
CDL包含中国国内动态分配地址。
CBL+为CBL和CDL的合集。
CBL-是CBL+中去除了中国邮件服务运营商白名单服务(CML)的内容后的黑名单,该黑名单方便于既想使用实时黑名单,而又要保证在任何情况下都能收到来着他们的邮件的用户。

我们可以根据自己的实际情况选择下面的四种模式中的任意一种。
CBL: cbl.anti-spam.org.cn
CDL: cdl.anti-spam.org.cn
CBL+: cblplus.anti-spam.org.cn
CBL-: cblless.anti-spam.org.cn Continue reading »

5月 142010
 

postfix提示:
warning: do not list domain in BOTH mydestination and virtual_mailbox_domains

根据提示,是说我的mydestination选项和mysql里面的virtual_mailbox_domain出现冲突,2者留其一。

原因:是系统域名与虚拟帐户的域名冲突了,而mydestination会自动根据机器名生成

解决;因此如果虚拟账号里有aaaa.com,那么在mydestination里就要去掉aaaa.com。
另外,也可以将其设为空:postconf -e mydestination=
或者手动编辑一下main.cf,加入mydestination=

4月 072010
 

在开放源代码的世界里,电子邮件服务器最主流的目前有三种,分别是sendmail, qmail, postfix。而存储格式最流行的有两种,Mbox和Maildir,它们都是开放的存储格式,因此兼容性比较好。

而mbox和maildir的历史,却不为大多数用户所了解。今天和一个朋友聊到mbox和maildir哪个好,顺便搜集一下mbox和maildir的资料,谈谈这两者的原理和区别,以及应该如何做选择。

Mbox的历史较Maildir悠久,sendmail支持mbox,qmail和postfix都支持mbox,其主要特点就是“所有邮件都存放到一个文件里”。每个邮件之间以特定的标记分割。

而Maildir则相反,每一封邮件保存成一个文件,每个文件名称一般有一定的规律,例如会包含时间戳、pid及inode节点号等。

除了mbox和maildir格式外,还有一个叫mbx的格式,它是对mbox的改进版本。主要用在UW-IMAP server里。它最大的特点是有一个针对mbox文件的索引,能改善读/写性能。但依然需要file lock。

随着qmail/postfix的普及,以及mbox的一些问题暴露,maildir得到了越来越多的应用。其中mbox的最主要问题是文件缩定(file lock),其次是大多数update操作的效能问题。 Continue reading »

4月 062010
 

2xx: 请求的动作已成功接受并完成,客户端可以继续下一步.

3xx: 命令不接受,因为服务器还需要更多信息.客户端应该以其他命令提供充足信息.

4xx: 暂时性的失败. 若客户端下次尝试同样动作,或许有机会成功.

5xx: 永久性的失败. 客户端不应该继续尝试同样的动作.

4月 062010
 

What domain name to use in outbound mail

The myorigin parameter specifies the domain that appears in mail that is posted on this machine. The default is to use the local machine name, $myhostname, which defaults to the name of the machine. Unless you are running a really small site, you probably want to change that into $mydomain, which defaults to the parent domain of the machine name.

For the sake of consistency between sender and recipient addresses, myorigin also specifies the domain name that is appended to an unqualified recipient address.

Examples (specify only one of the following):

    /etc/postfix/main.cf:
        myorigin = $myhostname (default: send mail as “user@$myhostname”)
        myorigin = $mydomain   (probably desirable: “user@$mydomain”)

What domains to receive mail for

The mydestination parameter specifies what domains this machine will deliver locally, instead of forwarding to another machine. The default is to receive mail for the machine itself. Continue reading »

4月 062010
 

You should set up a postmaster alias in the aliases(5) table that directs mail to a human person. The postmaster address is required to exist, so that people can report mail delivery problems. While you're updating the aliases(5) table, be sure to direct mail for the super-user to a human person too.

    /etc/aliases:
        postmaster: you
        root: you

Execute the command “newaliases” after changing the aliases file. Instead of /etc/aliases, your alias file may be located elsewhere. Use the command “postconf alias_maps” to find out.

The Postfix system reports problems to the postmaster alias. You may not be interested in all types of trouble reports, so this reporting mechanism is configurable. The default is to report only serious problems (resource, software) to postmaster:

Default setting:

    /etc/postfix/main.cf:
        notify_classes = resource, software Continue reading »

4月 062010
 

什么是SPF

就是Sender Policy Framework。SPF可以防止别人伪造你来发邮件,是一个反伪造性邮件的解决方案。当你定义了你的domain name的SPF记录之后,接收邮件方会根据你的SPF记录来确定连接过来的IP地址是否被包含在SPF记录里面,如果在,则认为是一封正确的邮件,否则则认为是一封伪造的邮件。关于更详细的信息请参考RFC4408(http://www.ietf.org/rfc/rfc4408.txt)

如何增加SPF记录
非常简单,在DNS里面添加TXT记录即可。登陆http://www.openspf.org/在里面输入你的域名,点击Begin,然后会自动得到你域名的一些相关信息。
a 你域名的A记录,一般选择yes,因为他有可能发出邮件。
mx 一般也是yes,MX服务器会有退信等。
ptr 选择no,官方建议的。

a: 有没有其他的二级域名?比如:mail.abc.com和www不在一台server上,则填入mail.abc.com。否则清空。
mx: 一般不会再有其他的mx记录了。
ip4: 你还有没有其他的ip发信?可能你的smtp服务器是独立出来的,那么就填入你的IP地址或者网段。
include: 如果有可能通过一个isp来发信,这个有自己的SPF记录,则填入这个isp的域名,比如:hichina.com
~all: 意思是除了上面的,其他的都不认可。当然是yes了。

好了,点击Continue…..
自动生成了一条SPF记录 Continue reading »