网站运营
位置:首页>> 网站运营>> 用Linux作邮件服务器(4)

用Linux作邮件服务器(4)

 来源:中国站长站 发布时间:2008-07-28 17:30:00 

标签:


4  配置Elm和Pine

配置好sendmall邮件系统后,就可以发送和接受邮件了。但是仅仅能够收发邮件还不够,还需要显示邮件、管理邮箱的程序,因此还必须配置MUA程序。在Linux/UNIX中有很多这样的MUA程序,其中影响最大、应用最广的是Elm和Pine。在Linux的各个版本都包含了这两个邮件程序。下面介绍如何对它们进行正确的配置。

4.1  配置 Elm 

Elm代表Electronic Mail,它的功能非常强大并且提供很好的帮助系统。在多数情况下,只要sendmail邮件系统能够正常运行,就可以运行Elm程序。 
Elm的配置文件是/usr/lib/elm/elm,对于一般用户来说,仅需修改此文件中与机器名和域名有关的选项。代码清单8.l给出的elm.rc文件经过了删节,仅保留了一般用户要作修改的部分。
代码清单 8.1  elm.rc配置文件 
        # Local hostname 
        hostname=mymailer 
        # 
        #  Domain name_ 
        hostdomain=.sw.edu.cn 
        # 
        # Fully qualitifed domain name 
        hostfullname=mymailer.sw.edu.cn 
        #  
    
从上面的例子可以看出,配置语句的格式是:“变量=值”,看起来比较直观。值得注意的是,城名前面必须加上一个圆点,否则会导致机器名出错。 

缺省情况下,Elm程序使用ASCⅡ字符集,当它遇到不能识别的字符时,就调用系统进程metamail来显示代码。当进程metamail运行时,将减慢邮件程序Elm的运行速度。为了使Elm程序可以处理Linux系统使用的标准字符集,要在文件/usr/lib/elm/elm.rc中加人下面的语句:  displaycharset=iso-8859-l 
    另外,因为Elm程序不能正确处理ISO-8859-l字符集中的有些特殊字符,所以要在文件elm.rc中加入下面两行: 
        charset=iso-8859-l 
        textencoding=8bit 
缺省情况下,系统将一个字节中最后一位去掉以产生7位的字符。第二行命令把系统设置成可以处理8位字符。 
Elm程序的配置信息被保存在文件/usr/lib/elm/elm.rc中和用户主目录的.elm/elm.rc文件中。这两个文件是Elm程序运行时自动产生的,用户不必直接去编辑这两个文件。 
    8.4.2  配置Pine 
    Pine也是一个常用的邮件程序。和Elm一样,Pine程序也通过一个配置文件来控制邮件程序的访问和操作。Pine程序的配置可以引用系统变量的值,也可以由用户定义。 
    Pine程序可以通过修改文件.pinerc来配置。这个配置文件比较庞大。但一般用户仅需关心该文件的三部分:(l)系统名和用户标志的配置;(2)邮箱的配置;(3)Pine程序属性的配置。 
下面的代码清单8.2节选了配置文件关于系统名和用户标志的配置部分。其中设置为空的项表示使用系统的缺省值。如果需要用户定制,可以在等号右边填写。配置的第一项是 
        personal-name= 
一般用登录名(账号名)即可,当然也可以填写其他名字。其他配置如smtp-server、nntp-server、user-domain、inbox-path都可以用系统缺省值。在配置之前,认真地阅读开头的注释部分是很有必要的。

代码清单8.2 .pinerc中系统名和用户标志的配置部分
    # Updated by Pine(tm) 4.10,copyright 1989-1999 University of Washington.
    #
    # Pine configuration file-custornize as needed.
    #
    # This file sets the configuration iptions used by Pine and PC-Pine.If you
    # are using Pine on a Unix systern,there may be a systern-wide configuration
    # file whick sets the defaults for these variables.There are comments in 
    # this file to explain each variable, but if you have questions about
    # specific settings see the section on configuration options in the Pine
    # notes.On Unix,run pine-conf to see how system defaults have been set.
    # For variables that accept multiple values,list elements are separated
    # by commas. A line beginning with a space or tab is considered to be a 
    # continuation of the previous line. For a variable to be unset its value 
    # must be blank. To set a variable to the empty string its value should 
    # be””.You can override systern defaults by setting a variable to the 
    # empty string. Switch variables are set to either "yes" or "no",and
    # default to "no".
    # Lines beginning with "#"are comments,and ignored by Pine.
    
    # 配置用户名,一般可以用户登录名(即用户账号)。
    personal-name=your_login_name
    
    # 设置用户的域名.
    user-domain=
    
    # 设置发信SMTP服务器,缺省情况下使用sendmail.
    smtp-server=sendmail
     
    # 设置邮递新闻的NNTP服务器。
    rmtp-server=
  
# 设置(本地或远程)INBOX的路径。本地INBOX的路径通常是/usr/spool/mail/$ USER.
inbox-path=

0
投稿

猜你喜欢

手机版 网站运营 asp之家 www.aspxhome.com