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
 

域名/IP反解析

  在垃圾邮件泛滥的今天,垃圾邮件给我们的生活、工作、学习带来了极大的危害。由于SMTP服务器之间缺乏有效的发送认证机制,即使采用了垃圾邮件识别阻拦技术效果仍旧一般,再者垃圾邮件识别阻拦技术主要是在收到信件后根据一定条件进行识别的,需要耗费大量服务器资源,如果能在信件到达服务器之前就采取一定手段,这样就能大大提高服务器效率了。因此,目前许多邮件服务器如sina.com,hotmail.com,yahoo.com.cn等等都采用了垃圾邮件识别阻拦技术+IP反向解析验证技术以更好的阻拦垃圾邮件。

我们先来了解一下什么是IP反向解析。其实作过DNS服务器的朋友一定会知道DNS服务器里有两个区域,即“正向查找区域”和“反向查找区域”,反向查找区域即是这里所说的IP反向解析,它的作用就是通过查询IP地址的PTR记录来得到该IP地址指向的域名,当然,要成功得到域名就必需要有IP地址的 PTR记录。

那么IP反向解析是怎么被应用到邮件服务器中来阻拦垃圾邮件的呢?我们来看看下面一个例子:

某天,阿Q到A公司拜访,他递上一张名片,名片上写着他来自“黑道俱乐部”以及电话号码等信息,A公司觉得应该对阿Q的来历做个简单调查,于是打电话到阿Q名片上的电话号码所属电信局进行查实,如果电信局告诉A公司其电话号码不属于“黑道俱乐部”,则A公司将拒绝阿Q的拜访,如果其电话号码的确属于“黑道俱乐部”,A公司可能接受阿Q的拜访也可能进一步查实,于是就打电话到“黑道俱乐部”所属注册机构查询,如果得到的答复确认该俱乐部确有此电话号码,则A公司将接受阿Q的拜访,否则仍将拒绝阿Q的拜访。 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 »

4月 052010
 

这个是讨论使用了虚拟邮件用户后,主机上的本地用户的邮件收发问题。
不同的MTA,不同的imap/pop,不同的WEB界面对处理虚拟用户和主机本地用户,有不同的做法。我只是使用了postfix,而且只使用了本地投递代理处理本地用户,虚拟用户用虚拟用户投递代理处理这种方法。当然,做虚拟用户还有别的办法,日后有时间再考虑考虑。imap/pop用courier-imap。虚拟用户信息在mysql。还用了pam-mysql做pam。

  在邮件系统中使用虚拟用户后,需要考虑如何处理邮件服务器所在主机的本地用户和件服务器自身的虚拟用户之间的关系。

一、分析本地用户和虚拟用户对邮件的需求情况。
  本地用户可以分为两类。一是系统用户,比如bin、daemon、mail、news、postmaster等等。另一类是普通用户。
  这两类用户对邮件的需求是不一样的。系统用户一般是接收来自程序的错误或日志等信息的邮件。由于系统用户没有自身的邮箱,通常是通过系统的别名表将邮件转发到一个管理员账号上。一般情况下这个管理员账号是本地上的一个用户账号,如root、local。普通用户可能有两种的邮件需求,能够在本地发送或是阅读邮件,也能够在其他计算机上使用邮件客户端利用邮件主机上的smtp/imap/pop服务进行邮件收发。
  虚拟用户的邮件需求,就是通过smtp/imap/pop进行邮件收发,不会涉及在本地的发送阅读问题。

二、本地用户和虚拟用户关系主要有两个问题

1、用户身份验证问题。本地用户和虚拟用户的用户信息保存位置不同。邮件主机的本地用户信息保存在/etc/passwd中,而虚拟用户信息则保存在数据库文件、数据库服务器或目录服务器等。在进行口令验证时(SMTP/IMAP/POP验证),如何从两个不同的位置取得用户名和口令这是一个问题;第二、本地用户和虚拟用户的邮件路由问题,即本地用户和虚拟用户的邮件投递问题。 Continue reading »

4月 052010
 

外发域配置

参数:

myorigin

说明:

myorigin参数用于指定该服务器使用哪个域名来外发邮件。

缺省的情况下myorigin采用本机主机名称(与参数myhostname相同)。

建议:在很小的网络中,采用缺省配置。而在Internet中,我们建议你保持myorigin与mydomain参数相同。也就是说采用该服务器所在的域名称。

例如:

myorigin =  $myhostname (缺省)
myorigin =  $mydomain (荐) Continue reading »

4月 042010
 

Authentication mechanisms vs. password schemes

Authentication mechanisms and password schemes are often confused, because they have somewhat similar values. For example there is a PLAIN auth mechanism and PLAIN password scheme. But they mean completely different things.

1.Authentication mechanism is a client/server protocol.
It's about how the client and server talk to each others in order to perform the authentication. Most people use only PLAIN authentication, which basically means that the user and password are sent without any kind of encryption to server. SSL/TLS can then be used to provide the encryption to make PLAIN authentication secure.

2.Password scheme is about how the password is hashed in your password database.
If you use a PLAIN scheme, your passwords are stored in cleartext without any hashing in the password database. A popular password scheme MD5-CRYPT (also commonly used in /etc/shadow) where passwords looks like “$1$oDMXOrCA$plmv4yuMdGhL9xekM.q.I/”.

3.Plaintext authentication mechanisms work with ALL password schemes.

4.Non-plaintext authentication mechanisms require either PLAIN password scheme or a mechanism-specific password scheme.