为了账号安全,请及时绑定邮箱和手机立即绑定

RHLE5+Postfix+Openwebmail

标签:
Linux

前提条件:一/#yum install perl*

                     二/下载perl-Text-Iconv-1.7-2.el5.i386.rpm

        (http://www.openwebmail.org/openwebmail/download/redhat/rpm/packages/rhel5/perl-Text-Iconv/perl-Text-   Iconv-1.7-2.el5.i386.rpm)

        #rpm -ivh perl-Text-Iconv-1.7-2.el5.i386.rpm

                      三/关闭selinux

启动postfix + dovecot服务过程:

     # service postfix start

        Starting postfix:                                                       [   确定   ]

     # service dovecot start

        启动 Dovecot Imap:                                                  [   确定   ]

   

修改/etc/dovecot.conf文件:

      #protocols = imap imap3

        更改为:

        protocols = imap imap3 pop3 pop3s (启动imap imap3 pop3 pop3s功能)

     # service dovecot restart(重新启动dovecot服务)

        停止 Dovecot Imap:                                                    [   确定   ]

        启动 Dovecot Imap:                                                    [   确定   ]

        

修改/etc/postfix/main.cf文件:

      #myhostname = host.domain.tld

        更改为:

        myhostname = mail.test.org (指定运行Postfix邮件系统的主机名称)

     #mydomain = domain.tld

        更改为:

        mydomain = test.org (指定Postfix邮件系统使用的域名)

     #myorigin = $mydomain

        更改为:

        myorigin = test.org (指定发件人所在的域名)

      #inet_interfaces = all

        更改为:

        Inet_interfaces =all (指定Postfix邮件系统监视的网络接口)

     #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain

        更改为:

        mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain(指定Postfix接收邮件时收件人的域名)

     #mynetworks = host

        更改为:

        mynetworks = host (指定您所在的网络地址192.168.10.0/24)

     # service postfix restart (重新启动postfix服务)

        Shutting down postfix:                                                [   确定   ]

        Starting postfix:                                                     [   确定   ]

端口测试:

        # telnet mail.test.org 25 (测试25端口)Trying 127.0.0.1...

        Connected to localhost.localdomain (127.0.0.1).

        Escape character is '^]'.

        220 mail.easy.com ESMTP Postfix

        quit

        221 Bye

        Connection closed by foreign host.

        # telnet mail.test.org 110 (测试110端口)Trying 127.0.0.1...

        Connected to localhost.localdomain (127.0.0.1).

        Escape character is '^]'.

        +OK dovecot ready.

        quit

        +OK Logging out

        Connection closed by foreign host.

配置openwebmail:

      # service httpd restart (启动httpd服务)

        停止 httpd:                                                              [   确定   ]

        启动 httpd:                                                              [   确定   ]

     # cd /var/www/cgi-bin/openwebmail/

        # ./openwebmail-tool.pl --init

     Please change './etc/dbm.conf' from

        

        dbm_ext                      .db

        dbmopen_ext                none

        dbmopen_haslock           no

        

        to

        

        dbm_ext                      .db

        dbmopen_ext                .db

        dbmopen_haslock           no

        

        

        And execute './openwebmail-tool.pl --init' again!

        

        ps: If you are running openwebmail in persistent mode,

              don't forget to 'touch openwebmail*.pl', so speedycgi

              will reload all scripts, modules and conf files in --init.

        

修改 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf 文件:

        domainnames           auto

        更改为:

        domainnames         test.org (更改为自己定义的域名)

        default_language                en

        更改为:

        default_language        zh_CN.GB2312 (更改为简体中文版介面)

        default_iconset          Cool3D.Englist

        更改为:

        default_iconset          Cool3D.Chinese.Simplified (更改为中文3D按键)

修改/var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf文件:

      smtpserver                      127.0.0.1

        更改为:

        smtpserver                      192.168.10.1 (更改smtp服务器的地址)

      authpop3_server                    localhost

        更改为:

        authpop3_server                    192.168.10.1 (更改pop3服务器的地址)

     

修改/var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf文件:

     dbmopen_ext              none

        更改为:

        dbmopen_ext              .db

     dbmopen_haslock        no

        更改为:

        dbmopen_haslock        yes

     smtpserver                192.168.10.1 (添加smtp服务器的地址)

   

继续运行openwebmail-tool.pl文件:

      # ./openwebmail-tool.pl --init

        creating db /var/www/cgi-bin/openwebmail/etc/maps/b2g ...done.

        creating db /var/www/cgi-bin/openwebmail/etc/maps/g2b ...done.

        creating db /var/www/cgi-bin/openwebmail/etc/maps/lunar ...done.

        Welcome to the Open WebMail!

        

        This program is going to send a short message back to the developer,

        so we could have the idea that who is installing and how many sites are

        using this software, the content to be sent is:

     .......

         

        Send the site report?(Y/n) y (输入y,然后按回车键)

        sending report...

        

        Thank you.

        

增加用户发送电子邮:

        增加本地用户:

     # useradd user1

        # useradd user2

        # useradd user3

        设置本地yer用户的密码

        # passwd user1

        Changing password for user yer.

        New UNIX password:

        Retype new UNIX password:

        passwd: all authentication tokens updated successfully.

        

        # passwd user2

        Changing password for user fandy.

        New UNIX password:

        Retype new UNIX password:

        passwd: all authentication tokens updated successfully.

        

        # passwd user3

        Changing password for user biao.

        New UNIX password:

        Retype new UNIX password:

        passwd: all authentication tokens updated successfully.

        

        

测试webmail方式收发电子邮件:

        在ie中输入以下地址:

        http://mail.test.org/cgi-bin/openwebmail/openwebmail.pl

试验成功。

但是如果要用http://mail.test.org替代繁琐的http://mail.test.org/cgi-bin/openwebmail/openwebmail.pl

    #vi /etc/httpd/conf/httpd.conf

    去除972行注释,改为 NameVirtualHost *:80

    最后添加

    <VirtualHost *:80>

    ServerName mail.test.org

    DocumentRoot "/var/www"

    DirectoryIndex /cgi-bin/openwebmail/openwebmail.pl

    <使用mail.test.org代替mail.test.org/cgi-bin/openwebmail/openwebmail.pl 来登录Open Webmail>

    ScriptAlias /openwebmail "/var/www/cgi-bin/openwebmail"

    <因为有一些Openwebmail的根路径(例如图片的路径)是从/openwebmail开始,而实际却是在/var/www/cgi-bin/openwebmail下>

    </VirtualHost>

    <Directory /var/www/cgi-bin>

      AllowOverride All

      Options ExecCGI

      Order allow,deny

      Allow from all

    </Directory>

可能还需要注释掉如下语句:ScriptAlias /cgi-bin/ "/usr/local/www/apache22/cgi-bin/"。并且将httpd.conf中的“#AddHandler cgi-script .cgi”改为“AddHandler cgi-script .cgi .pl”;这样apache才会去执行pl文件,而不是打开它。注意,改完httpd.conf之后记得重启apche噢

©著作权归作者所有:来自51CTO博客作者qiujichun的原创作品,如需转载,请注明出处,否则将追究法律责任

职场休闲Postfix服务


点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消