Tags

2011年10月15日 星期六

Linux 70% Lab - Postfix + Cyrus + OpenWebMail with IPv6

Apache2:

Server1:
  • vi /etc/apache2/vhost.d/mail.31100173.com.conf
新增以下內容:
<VirtualHost 2002:a78:d01:0:800:27ff:fe03:b3e9:80>
    ServerAdmin root@31100173.com
    ServerName mail.31100173.com
    DocumentRoot /srv/apache2/mail
    ErrorLog /var/log/apache2/mail.31100173.com-error_log
    CustomLog /var/log/apache2/mail.31100173.com-access_log combined
    HostnameLookups Off
    ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
    <Directory "/srv/www/cgi-bin">
        AllowOverride None
        Options +ExecCGI -Includes
        Order allow,deny
        Allow from all
    </Directory>
    <IfModule mod_userdir.c>
        UserDir public_html
        Include /etc/apache2/mod_userdir.conf
    </IfModule>
    <Directory "/srv/apache2/mail">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>















  • Service apache2 restart
HostOS:
  • 開啟browser連入mail.31100173.com測試apache2是否正常運作

 

Postfix:

Server1:
  • chkconfig postfix on
  • vi /etc/postfix/main.cf
做下列修改:
91:mydomain = 31100173.com
107:myorigin = $mydomain
268:mynetworks = [2002:a78:d01::]/64, [::1]/128
671:myhostname = mail.31100173.com
675:inet_interfaces = localhost, $myhostname
676:masquerade_domains = $mydomain
677:mydestination = $myhostname, localhost.$mydomain, $mydomain
679:mynetworks_style = subnet
681:relayhost = 10.120.101.101 <---驗收時再補上
687:smtpd_client_restrictions = hash:/etc/postfix/access
  • service postfix restart
HostOS:
  • telnet mail.31100173.com 25 測試smtp是否有通 (出現220才算成功)
Server2:
  • zypper ar http://download.opensuse.org/distribution/11.1/repo/oss opensuse11.1
  • zypper install kmail
  • kmail設定:Setting –> Configure Kmail..
Identities:Add
    General:Your name:amy
               Email address:amy@mail.31100173.com
OK.
Accounts:
    Receiving:Add—> POP3 :
         Account Name: amy
                                 Host: mail.31100173.com
                                 Login: amy
                                 Password: XXXXXXXX
                Sending:Add:
   Name:amy
                                Host:mail.31100173.com
  • 寄信到外部信箱做測試
  • vi /etc/postfix/sender-canonical
         新增兩筆資料:
amy info@mail.31100173.com
boby info@mail.31100173.com
  • postmap hash:/etc/postfix/sender_canonical

Cyrus:

Server1:
  • yast –i cyrus (預設應該裝好了)
  • service cyrus start
HostOS:
  • telnet mail.31100173.com 110
  • telnet mail.31100173.com 143
  • vi /etc/postfix/transport
於文件最末端新增一行:
31100173.com    cyrus:
  • postmap hash:/etc/postfix/transport
  • vi /etc/imapd.conf
於文件末端新增一行:
allowplaintext: yes
  • service postfix restart
  • service cyrus restart
  • service saslauthd restart
  • chkconfig saslauthd on
  • chkconfig cyrus on
Server2:
  • 用Kmail測試收發信

OpenWebMail:
Server1:
  • yast –i perl-MIME-tools (ver. 5.427-2.8)
  • yast –i perl-Text-Iconv (ver. 1.4.3.85)
  • tar –zxvf openwebmail-2.53.tar.gz –C /srv/apache2
  • tar –zxvf openwebmail-2.53.tar.gz –C /srv/www
(事先於 http://www.openwebmail.org/openwebmail/download/release/2.53/ 下載)
  • cp –a /srv/apache2/data/openwebmail /srv/apache2/mail
  • cd /srv/www/cgi-bin/openwebmail
  • vi etc/openwebmail.conf
做下列修改:
13:31100173.com
16:/srv/www/cgi-bin/openwebmail
18:/srv/apache2/mail/openwebmail
31:預設簽名檔  隨便改
  • vi etc/defaults/openwebmail.conf
做以下修改:
30:mail.31100173.com
  • cp etc/default/dbm.conf etc/
  • vi etc/dbm.conf
做以下修改:
30:.db 改成 .pag
  • cp etc/default/auth_unix.conf etc/
  • vi etc/auth_unix.conf
做下列修改:
73: /etc/shadow
74: none
  • chmod 4555 /srv/www/cgi-bin/openwebmail/openwebmail*.pl
  • chown root.mail /srv/www/cgi-bin/openwebmail/openwebmail*.pl
  • chmod 4555 /usr/bin/suidperl
  • vi /etc/openwebmail_path.conf
新增以下內容:
/srv/www/cgi-bin/openwebmail
  • rcapparmor stop
  • chkconfig boot.apparmor off
  • vi /srv/apache2/mail/index.html
修改為:
<html>
<head>
<meta http-equiv="refresh" content="0;
url=http://mail.31100173.com/cgi-bin/openwebmail/openwebmail.pl/">
</head>
</html>
  • /srv/www/cgi-bin/openwebmail/openwebmail-tool.pl –init
(最後的send report可以不用送.若送了有錯誤訊息是正常的)
HostOS:
  • 開啟browser連入mail.31100173.com 登入openwebmail 測試收信

沒有留言:

張貼留言