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.

4月 042010
 

postfix 的設定
http://wiki.ubuntu.org.cn/index. … h&variant=zh-tw
http://hsu.easynow.com.tw/index.php?id=15&load=read
http://b2d.phc.edu.tw/modules/ta … ok_sn=1&bdsn=72

vi /etc/postfix/main.cf
inet_interfaces = all (原則上,設定此項就可以收到外部的來信)
/etc/init.d/postfix restart
重新啟動 postfix

——————————————————————————————————-
procmail 的過濾規則 (可以過濾帶有病毒的郵件)

dpkg -l |grep procmail #檢查 procmail 是否安裝
建立 procmail 規則: Continue reading »

4月 042010
 

2007年10月25日星期四

搞了一個禮拜的東西,記一下,做個紀念!

遇到的問題:

amavisd-new 在當時無法從套件庫安裝。 解決方法:考慮大量相依性問題 ( 可能還有缺少的很多套件 ) ,放棄使用。
procmail 必需能搭配郵件目錄使用 Maildir/ 格式,而非 mbox 檔案格式。 解決方法:見前一篇「 [postfix procmail Maildir]procmail 與 Maildir 信箱格式的搭配」。
有人很少 ( 或根本 ) 不收信,家目錄的 quota 用完後,無法收信會讓 spamd / spamc 的執行環境錯亂無法過濾垃圾郵件。 本篇目的就是解決這個問題。
使用 procmail 替代直接遞送 mail box ,是造成上述問題的原因。如果是由 postfix 遞送郵件到收件人信箱,無法遞送時 ( 如我遇到的收件者信箱 quota exceeded 問題 ) 會由 postfix 退信。但是如果是由 promail 遞送到收件者信箱, postfix 把信交給 procmail 時,就算完工了,而 procmail 則是無法退信 ( 註1 ) ,於是送信到預設的 mbox 信箱去了。

我決定採用 Postfix After-Queue Content Filter 裡的 Simple content filter ,讓 procmail 做為 mail filter ( 註2 ) ,將郵件 pipe 給 spamc 過濾加標籤,再 pipe 給 sendmail ,讓郵件重回 postfix 的 mail queue ,讓 postfix 做最後的遞送到收件人信箱。如此,就可以解決收件人信箱 quota exceeded 的問題了。 Continue reading »

4月 042010
 

首先安装好 apache2 ,php,phpmyadmin等基本服务。

1.sudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd mysql-server php5-mysql phpmyadmin

哈哈,一气呵成。

以我安装mail.ipbfans.org的邮件服务为例,先安装软件:

sudo apt-get install postfix postfix-mysql courier-authdaemon courier-authlib-mysql courier-imap courier-imap-ssl courier-pop courier-pop-ssl sasl2-bin libsasl2-2 libsasl2-modules libsasl2-modules-sql

安装过程中需要回答以下问题:

Create directories for web-based administration ? 否
General type of mail configuration: Internet Site
System mail name: <你的主机名>
其中ubuntu会根据你输入的这个主机名来生成ssl证书。安装完毕以后可以用以下命令测试postfix的安装: Continue reading »