歡迎您光臨本站 註冊首頁

經過幾個星期測試完成的郵件系統(qmail)

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

經過幾個星期測試完成的郵件系統(qmail)

大家好,我經歷了幾個星期測試,搭建了 qmail+vpopmail+mysql+coureier-imap+apache+php+cmd5checkpw+autorespond+ezmlm/ezmlm-idx+qmailadmin這套系統,全部採用源碼編譯完成,現將資料拿來跟大家分享。

操作系統版本:redhat linux As 4.7
軟體包相關:
mysql-4.0.21.tar.gz
appache-2.0.54.tar.bz2 (httpd-2.0.54)
php-4.3.1.tar
netqmail-1.05.tar
daemontools-0.76.tar
qmail-1.03.tar
qmail-smtpd-auth-0.31.tar
qmailadmin-1.0.6.tar
qmail-toaster-0.6-1.patch.bz2
ucspi-tcp-0.88.tar
ucspi-tcp-0.88.a_record.patch
ucspi-tcp-0.88.errno.patch
ucspi-tcp-0.88.nodefaultrbl.patch
vpopmail-5.4.13.tar
cmd5checkpw-0.22.tar.gz
autorespond-2.0.4.tar.tar
ezmlm-0.53.tar.gz  
ezmlm-idx-0.42.tar.gz
courier-imap-1.7.1.tar
igenus_2_20030516_snap.tgz

一、        mysql 安裝   
版本:mysql-4.0.21.tar.gz
   ./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql/  --with-charset=gb2312
說明:   
                   #prefix=/usr/local/mysql mysql安裝的目標目錄
                   #sysconfdir=/etc my.ini配置文件的路徑
                   #localstatedir=/var/lib/mysql 資料庫存放的路徑
#make
#make install
#cp support-files/my-medium.cnf /etc/my.cnf
#cp support-files/mysql.server  /etc/init.d/mysqld   //copy mysqld files
chmod 700 /etc/init.d/mysqld
../scripts/mysql_install_db --user=mysql
Chown –R mysql:mysql  /var/lib/mysql
# ./mysqladmin -u root password 『123456』   //changer adminstartor password
# mysql -uroot -p123456  //come into mysql

配置庫文件搜索路徑
# echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
# ldconfig -v
添加/usr/local/mysql/bin到環境變數PATH中
#export PATH=$PATH:/usr/local/mysql/bin
ln -sv /usr/local/mysql/bin/* /usr/bin/
servcei mysql restar


二、        apache 安裝     
版本:appache-2.0.54.tar.bz2
groupadd vchkpw
useradd –g vchkpw vpopmail
. /configure --prefix=/usr/local/apache --enable-so --enable-rewrite --enable-mods-shared=most   --server-uid=vpopmail  --server-gid=vchkpw
Make
Make install

說明:
        --enable-so選項:讓Apache可以支持DSO模式,注意,這裡採用的是Apache2.0的語法。如果你的Apache是1.3版本,應改為--enable-module=so。
        --enable-mods-shared=most選項:告訴編譯器將所有標準模塊都編譯為DSO模塊。你要是用的是Apache1.3,改為--enable-shared=max就可以。
        --enable-rewrite選項:支持地址重寫功能,使用1.3版本的朋友請將它改為--enable-module=rewrite。
測試: /usr/local/apache/bin/apachectl start
http://mailtest.domain.com/ 看到apache默認的頁面就ok了

三、PHP安裝:
版本: php-4.3.1.tar
1)./configure
./configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --disable-debug --enable-safe-mode --enable-trans-sid --with-xml --enable-short-tags --with-gd --with-zlib -with-jpeg --with-png --enable-memory-limit --disable-posix --with-config-file-path=/usr/local/lib  --with-gettext
Make

版本:imap-2004g.tar.Z
Horde+imp需開啟的相關功能模塊,配置安裝方法
先安裝imap-2004g.tar.Z(imp必須的php擴展功能模塊)
  Tar xvf
  Mkdir /usr/local/imap
  Makdir /usr/local/imap/include
  Makdir /usr/local/imap/lib
在返回 cd imap-2004g
Cp c-client/*.h /usr/local/imap/include
Cp c-client/*.c /usr/local/imap/lib
Cp c-client/*.c /usr/local/imap/lib


(./configure --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-openssl=/usr/local/ssl --with-xml --with-zlib --with-freetype --enable-track-vars --with-png --with-jpeg --enable-mbstring=all --with-gd --with-mcrypt --with-kerberos --enable-ftp --enable-session --with-imap=/usr/local/imap/ --with-imap-ssl=/usr/local/ssl --with-gettext)

Copy  your php.ini file
2)cp php.ini-dist /usr/local/lib/php.ini
3)vi /usr/local/lib/php.ini  (edit th file and make sure it contains the following commands)
max_execution_time=60
memory_limit=10M
post_max_size=8M
upload_max_filesize=8M
file_uploads=On
log_errors=On
register_globals = On
error_log=/usr/local/apache/logs/php_error_log
4) Make install
5)[ [email protected] php-4.3.1]# chown -R root.vchkpw /usr/local/lib/php
6)# chmod -R g-w,o-rwx /usr/local/lib/php

7)Vi /usr/local/apahce/conf/httpd.conf
添加:
LoadModule php4_module  modules/libphp4.so
#<Directory />
#    Options FollowSymLinks
#    AllowOverride None
#</Directory>           這段註銷掉
# uncomment (or add) the following line
AddType application/x-httpd-php .php
# Add the index.php into this line so apache will use this file as a default in addition to index.html
DirectoryIndex index.php index.html
# Go towards the end of the httpd.conf and look for the "SSL Virtual Host Context"
ServerName mailtest.domain.com:80
ServerAdmin [email protected]
NameVirtualHost 19.200.2.15:80
<VirtualHost 19.200.2.15:80>
ServerName mailtest.domain.com
ServerAdmin [email protected]
DocumentRoot /usr/local/apache/htdocs
</VirtualHost>

8)# rm -rf /usr/local/apache/htdocs/*
9)# cd /usr/local/
10) 設定相關許可權
# chown -R root:root apache
# chmod 755 apache
# chmod -R u+x apache
# cd apache
# chmod -R u+x bin
# chgrp -R vchkpw cgi-bin
# chmod -R u+x,g+x cgi-bin
# chgrp -R vchkpw icons
# chmod -R g+rx icons
# chgrp -R vchkpw logs
# chmod g+wx logs
# chgrp -R vchkpw htdocs
# chmod -R g+rx htdocs

[ 本帖最後由 rongjun_cui 於 2009-3-25 15:10 編輯 ]
《解決方案》

繼續二

三、        安裝qmail
版本:netqmail-1.05.tar  qmail-1.03.tar.gz  qmail-smtpd-auth-0.31.tar
1) # tar xvf netqmail-1.05.tar
cd netqmail-1.05
./collate.sh
2) 安裝daemon(版本:daemontools-0.76.tar)
admin
admin/daemontools-0.76
admin/daemontools-0.76/package
admin/daemontools-0.76/package/README
admin/daemontools-0.76/package/files
admin/daemontools-0.76/package/sharing

# cd admin/daemontools
# patch -p1 < ../../netqmail-1.05/other-patches/daemontools-0.76.errno.patch
patching file src/error.h
# package/install
3) ps ax | grep svscan  \\驗證daemontools已經運行:
                        1242 ?        Ss     0:00 /bin/sh /command/svscanboot
                        1244 ?        S      0:00 svscan /service
                        1254 pts/2    S+     0:00 grep svscan
4) 創建目錄:
        mkdir -p /var/qmail/alias
5) 創建組和用戶:
        groupadd nofiles
        useradd -g nofiles -d /var/qmail/alias alias
        useradd -g nofiles -d /var/qmail qmaild
        useradd -g nofiles -d /var/qmail qmaill
        useradd -g nofiles -d /var/qmail qmailp
        groupadd qmail
        useradd -g qmail -d /var/qmail qmailq
        useradd -g qmail -d /var/qmail qmailr
        useradd -g qmail -d /var/qmail qmails
        groupadd vchkpw   \\這裡把vpopmail用戶也加上
        useradd -g vchkpw vpopmail
6)打補丁&編譯安裝:
        cd /usr/local/src(因為相關軟體都放在這個目錄下)
        tar zxf qmail-1.03.tar
   # tar -xvf qmail-smtpd-auth-0.31.tar
qmail-smtpd-auth-0.31/
qmail-smtpd-auth-0.31/auth.patch
qmail-smtpd-auth-0.31/CHANGES
qmail-smtpd-auth-0.31/base64.c
qmail-smtpd-auth-0.31/base64.h
qmail-smtpd-auth-0.31/README.au      
# cp qmail-smtpd-auth-0.31/base64.* qmail-1.03
    patch -d qmail-1.03 < qmail-smtpd-auth-0.31/auth.patch
    cd qmail-1.03
    # patch -p1 < ../qmail-103.patch
patching file dns.c
   # patch -p1 < ../qmailqueue-patch
patching file Makefile
Hunk #1 succeeded at 1487 (offset 4 lines).
patching file qmail.c
# patch -p1 < ../qmail-maildir++.patch
patching file Makefile
Hunk #1 succeeded at 894 (offset 4 lines).
patching file strtimet.c

  patch -p1 < ../qmail-1.03.errno.patch
  patch -p1 < ../qmail-1.03.qmail_local.patch
   vi qmail-smtpd.c  將函數straynewline中的451改為553
   cd ../netqmail-1.05
   bunzip2 -c ../qmail-toaster-0.6-1.patch.bz2 |patch -p0
   cd netqmail-1.05
    make
     make setup check
./install
./instcheck 說明安裝成功
     ./config-fast domain.com  \\domain.com為你的伺服器名

7)添加別名用戶
        touch /var/qmail/alias/.qmail-root
        touch /var/qmail/alias/.qmail-postmaster
        touch /var/qmail/alias/.qmail-mailer-daemon
         chmod 644 /var/qmail/alias/.qmail*
        echo '[email protected]' > ~alias/.qmail-root
echo '[email protected]' > ~alias/.qmail-postmaster
echo '[email protected]' > ~alias/.qmail-mailer-daemon

8)如果存在postfix和sendmail,將它們停用。
      killall sendmail
        cp /var/qmail/bin/sendmail /usr/sbin/qmail.sendmail
        rm -f /etc/alternatives/mta
        ln -s /usr/sbin/qmail.sendmail /etc/alternatives/mta
        rm -f /usr/lib/sendmail
        rm -f /usr/sbin/sendmail
        ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
        ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
        chmod 777 /usr/sbin/sendmail
        echo 1 > /var/qmail/control/mfcheck
        echo ./Maildir/ > /var/qmail/control/defaultdelivery
      make cert 按提示輸入公司信息
# make cert
Generating a 1024 bit RSA private key
.++++++
...................................................++++++
writing new private key to '/var/qmail/control/servercert.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) :CN
State or Province Name (full name) :GD
Locality Name (eg, city) :shunde
Organization Name (eg, company) :hnisi
Organizational Unit Name (eg, section) []:gov
Common Name (eg, your name or your server's hostname) []:mailtest     
Email Address []:[email protected]
        make tmprsadh
        用"crontab -e"在crontab里增加下面這條,每天晚上更新temp keys
                01 01 * * * /var/qmail/bin/update_tmprsadh > /dev/null 2>&1
        cd /home/qmail        
        tar zxf toaster-scripts-0.6.tar.gz



           

# ./config-fast  domain.com
Your fully qualified host name is domain.com.
Putting domain.com into control/me...
Putting gov.cn into control/defaultdomain...
Putting gov.cn into control/plusdomain...
Putting domain.com into control/locals...
Putting domain.com into control/rcpthosts...
Now qmail will refuse to accept SMTP messages except to domain.com.
Make sure to change rcpthosts if you add hosts to locals or virtualdomains!

# touch /var/qmail/alias/.qmail-root
# touch /var/qmail/alias/.qmail-postmaster
# touch /var/qmail/alias/.qmail-mailer-daemon
# chmod 644 /var/qmail/alias/.qmail*
# echo '[email protected]' > ~alias/.qmail-root
# echo '[email protected]' > ~alias/.qmail-postmaster
# echo '[email protected]' > ~alias/.qmail-mailer-daemon
make tmprsadh
用"crontab -e"在crontab里增加下面這條,每天晚上更新temp keys
                01 01 * * * /var/qmail/bin/update_tmprsadh > /dev/null 2>&1
        cd /home/qmail        
        tar zxf toaster-scripts-0.6.tar.gz
創建服務:
# mkdir -p /var/qmail/supervise/qmail-send/log
# mkdir -p /var/qmail/supervise/qmail-smtpd/log
# mkdir -p /var/qmail/supervise/qmail-pop3d/log
# mkdir -p /var/qmail/supervise/qmail-pop3ds/log
# chmod +t /var/qmail/supervise/qmail-send
# chmod +t /var/qmail/supervise/qmail-smtpd
# chmod +t /var/qmail/supervise/qmail-pop3d/log
# chmod +t /var/qmail/supervise/qmail-pop3ds/log
# cp /usr/local/src/qmail/toaster-scripts-0.6/send.run /var/qmail/supervise/qmail-send/run
# cp /usr/local/src/qmail/toaster-scripts-0.6/send.log.run /var/qmail/supervise/qmail-send/log/run
# cp /usr/local/src/qmail/toaster-scripts-0.6/smtpd.run /var/qmail/supervise/qmail-smtpd/run
# cp /usr/local/src/qmail/toaster-scripts-0.6/smtpd.log.run /var/qmail/supervise/qmail-smtpd/log/run
# cp /usr/local/src/qmail/toaster-scripts-0.6/pop3d.run /var/qmail/supervise/qmail-pop3d/run
# cp /usr/local/src/qmail/toaster-scripts-0.6/pop3d.log.run /var/qmail/supervise/qmail-pop3d/log/run
# cp /usr/local/src/qmail/toaster-scripts-0.6/pop3ds.log.run /var/qmail/supervise/qmail-pop3ds/log/run
# cp /usr/local/src/qmail/toaster-scripts-0.6/pop3ds.run /var/qmail/supervise/qmail-pop3ds/run
# echo 20 > /var/qmail/control/concurrencyincoming
# echo 'postmaster'      > /var/qmail/control/bouncefrom
# echo 'postmaster'      > /var/qmail/control/bouncefrom
# echo 'doublebounce' > /var/qmail/control/doublebounceto
# echo 'domain.com' >/var/qmail/control/doublebouncehost
# echo '#' > ~alias/.qmail-doublebounce
# echo '10000000' > /var/qmail/control/databytes
# echo '345600' > /var/qmail/control/queuelifetime
# echo 'domain.com' >/var/qmail/control/defaultdomain
# echo 'mailtest.domain.com' >/var/qmail/control/smtproutes

# chmod 644 /var/qmail/control/concurrencyincoming
# chmod -R 644 /var/qmail/control/
# chmod 755 /var/qmail/supervise/qmail-send/run
# chmod 755 /var/qmail/supervise/qmail-send/log/run
# chmod 755 /var/qmail/supervise/qmail-smtpd/run
# chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
# chmod 755 /var/qmail/supervise/qmail-pop3d/run
# chmod 755 /var/qmail/supervise/qmail-pop3d/log/run
# chmod 755 /var/qmail/supervise/qmail-pop3ds/run
# chmod 755 /var/qmail/supervise/qmail-pop3ds/log/run
# mkdir -p /var/log/qmail/smtpd
# mkdir -p /var/log/qmail/pop3d
# mkdir -p /var/log/qmail/pop3ds
# chown -R qmaill /var/log/qmail

啟動腳本
# cp /usr/local/src/qmail/toaster-scripts-0.6/rc /var/qmail/
# cp /usr/local/src/qmail/toaster-scripts-0.6/qmailctl /var/qmail/bin/
# chmod 755 /var/     
# chmod 755 /var/qmail/rc
# chmod 755 /var/qmail/bin/qmailctl
# ln -s /var/qmail/bin/qmailctl /usr/bin/
《解決方案》

繼續三

四、        安裝ucspi-tcp
  版本:ucspi-tcp-0.88.tar(還有相關補丁)
(ucspi-tcp-0.88.tar.gz) :ucspi-tcp包括tcpserver和tcpclient,一個命令行工具來建立client-server應用程序
tar xvf ucspi-tcp-0.88.tar
# ptch -p1 < ../ucspi-tcp-0.88.a_record.patch
-bash: ptch: command not found
# ptch -p1 < ../ucspi-tcp-0.88.a_record.patch
-bash: ptch: command not found
# patch -p1 <../ucspi-tcp-0.88.a_record.patch
patching file rblsmtpd.c
# patch -p1 <../ucspi-tcp-0.88.errno.patch
patching file error.h
# patch -p1 <../ucspi-tcp-0.88.nodefaultrbl.patch
patching file rblsmtpd.c
make
make setup check
# make setup check
./install
./instcheck
用daemontools來啟動qmail-send和qmail-smtpd
        ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
《解決方案》

繼續四

五、        Vpopmail安裝 (vpopmail是一個以qmail為基礎的虛擬域管理包)
版本:vpopmail-5.4.13.tar
vpopmail的用戶和組前面已經建立了 (vpopmail:vchkpw)
        
配置:
        mkdir -p /home/vpopmail/etc
設置默認域:domain.com為你要設置的域
        echo 'domain.com' > /home/vpopmail/etc/defaultdomain
設置SMTP規則,關閉open relays
        echo '127.0.0.1:allow,RELAYCLIENT=""' > /home/vpopmail/etc/tcp.smtp
        cd /home/vpopmail/etc
        tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp
設置MySQL信息,第一個vpopmail是帳號,xukixu為密碼,第二個vpopmail是資料庫
    echo "localhost|0|vpopmail|123456|vpopmail" > /home/vpopmail/etc/vpopmail.mysql
        chmod 640 /home/vpopmail/etc/vpopmail.mysql
        chown -R vpopmail.vchkpw /home/vpopmail/etc
在MySQL里添加vpopmail的帳號
          mysql> create database vpopmail;
            mysql> grant all on vpopmail.* to [email protected] identified by
'123456';
grant all on vpopmail.* to [email protected];(生產環境。8)
grant usage on *.* to [email protected]
          mysql> flush privileges  更新MySQL的許可權表,用grant的就不需要
          mysql> quit
安裝:
tar zxf vpopmail-5.4.13.tar
        cd vpopmail-5.2.1
        vi vmysql.h  修改文件
localhost|0|root|sdmgmysql|vpopmail (很重要,否則vpopmail跟資料庫通信有問題)
           添加下面幾行:(實際測試當中這個沒有起作用)
                #define UPDATE SERVER "localhost"
                #define UPDATE USER "vpopmail"
                #define UPDATE PASSWD "123456"

                #define READ SERVER "localhost"
                #define READ USER "vpopmail"
                #define READ PASSWD "123456"         
           如果版本較低的話,要這樣寫(具體的要看文件里的註釋):
                #define MYSQL_UPDATE_SERVER "localhost"
                #define MYSQL_UPDATE_USER "vpopmail"
                #define MYSQL_UPDATE_PASSWD "4321"

                #define MYSQL_READ_SERVER "localhost"
                #define MYSQL_READ_USER "vpopmail"
                #define MYSQL_READ_PASSWD "4321"

./configure --prefix=/home/vpopmail/ --enable-incdir=/usr/local/mysql/include/mysql/ --enable-libdir=/usr/local/mysql/lib/mysql/ --enable-auth-module=mysql --enable-passwd=n --enable-tcprules-prog=/usr/local/bin/tcprules --enable-tcpserver-file=/home/vpopmail/etc/tcp.smtp --enable-vpopuser=vpopmail --enable-vpopgroup=vchkpw --enable-ip-alias-domains=n --enable-logging=p --disable-passwd --enable-clear-passwd  --enable-auth-module=mysql --enable-auth-logging --enable-sql-logging --disable-valias
Make
Make install-strip
啟動腳本
        cp /home/software/toaster-scripts-0.6/vpopmailctl /var/qmail/bin/
        ln -s /var/qmail/bin/vpopmailctl /usr/bin/
        chmod 755 /var/qmail/bin/vpopmailctl
        ln -s /var/qmail/supervise/qmail-pop3d /service
        ln -s /var/qmail/supervise/qmail-pop3ds /service
       啟動,停止,重啟,查看隊列等
        vpopmailctl start|stop|restart|stat|pause|cont|help
   檢查服務
        netstat -an | grep 110
        ps -ef | grep qmail
        ps -efl | grep "service errors" | grep -v grep
   帶資料庫支持
        cd /home/software/netqmail-1.05/netqmail-1.05
        patch -p0 < /home/software/chkuser-0.6.mysql.patch
   修改libmysqlclient.a存在路徑
        vi conf-mysql
                改為/usr/local/lib/mysql/libmysqlclient.a
        make clean
        make
        qmailctl stop
        make setup check
        qmailctl start
《解決方案》

繼續五

、安裝courier-imap
版本:courier-imap-1.7.1.tar.gz
Courier-imap安裝:courier-imap-1.7.1
Su – vpopmail
./configure --prefix=/usr/local/courier-imap --disable-root-check --without-authpam --without-authldap --without-authpwd --without-authmysql --with-authshadow --without-authuserdb --without-authcustom --without-authcram --without-authdaemon --with-authvchpw
Make
Make install
# cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imap
cp: overwrite `/etc/rc.d/init.d/courier-imap'? y
# chmod 755 /etc/rc.d/init.d/courier-imap
# chkconfig --add courier-imap
# chkconfig --level 2345 courier-imap on
# for foo in *.dist;
> do cp $foo `basename $foo .dist`;
> done
vi /usr/local/courier-imap/etc/imapd
MAXDAEMONS=40
MAXPERIP=100
TCPDOPTS="-nodnslookup -noidentlookup -user=vpopmail -group=vchkpw"
AUTHMODULES="authvchkpw"
IMAP_EMPTYTRASH=Trash:7,Sent:30
IMAPDSTART=YES
vi /usr/lib/courier-imap/etc/imapd-ssl
   改為IMAPDSSLSTART=YES
《解決方案》

繼續六

六、        安裝cmd5checkpw
版本:cmd5checkpw-0.22.tar.gz

cmd5checkpw是一個和checkpasswd兼容的支持CRAM-MD5演算法進行認證的工具。只要支持checkpasswd進行系統用戶認證的程序均可以使用其來支持CRAM-MD5演算法對數據進行信息摘要,防止密碼被盜取。
        cd /home/software
        tar zxf cmd5checkpw-0.22.tar.gz
        cd cmd5checkpw-0.22
        make
        make install  如果出錯的話就修改Makefile文件:
                vi Makefile
                        將cp cmd5checkpw /bin/ ; cp cmd5checkpw.8 /usr/man/man8/
                        改為cp cmd5checkpw /bin/ ; cp cmd5checkpw.8 /usr/share/man/man8/

                make install
《解決方案》

繼續七

Autorespond安裝
  版本:autorespond-2.0.4.tar.tar
# tar zxvf autorespond-2.0.4.tar.tar
autorespond-2.0.4/
autorespond-2.0.4/README
autorespond-2.0.4/autorespond.c
autorespond-2.0.4/help_message
autorespond-2.0.4/qmail-auto
autorespond-2.0.4/Makefile
autorespond-2.0.4/autorespond.1
autorespond-2.0.4/ChangeLog
# cd autorespond-2.0.4
# ls
autorespond    autorespond.c  help_message  qmail-auto
autorespond.1  ChangeLog      Makefile      README
# make
make: Nothing to be done for `all'.
# make install
install -d /usr/bin /usr/share/man/man1
install autorespond /usr/bin
install autorespond.1 /usr/share/man/man1
《解決方案》

繼續八

ezmlm和ezmlm-idx安裝
版本:(ezmlm-0.53.tar.gz和ezmlm-idx-0.42.tar.gz)  

使qmail支持郵件列表功能,可以通過qmailadmin對其進行配置
  
        為了啟用maillist的MySQL支持,必須建立mysql管理用戶:
        mysql
          mysql> create database ezmlm;        
          mysql> grant all on ezmlm.* to [email protected] identified by 'ezmlm';
          mysql> flush privileges;   我用的是grant,所以這步可以不做
          mysql> exit
        tar zxf ezmlm-0.53.tar.gz
        tar zxf ezmlm-idx-0.42.tar.gz    # ezmlm-idx包含有對ezmlm的修正和補充,他們是一個整體
        cp -rf ezmlm-idx-0.42/* ezmlm-0.53/   將ezmlm-idx-0.40下的文件覆蓋到ezmlm-0.53下
        cd ezmlm-0.53
        patch < idx.patch
        make mysql #MySQL 支持
        make clean
        make man
        make ch_GB #漢字GB2312支持 這裡可能會提示錯誤"Permission denied",這是許可權問題,更改makelang的許可權:chmod 744 makelang 后就可以了
        修改下列文件:
                vi conf-sqlcc
                        內容為:-I/usr/local/mysql/include/mysql  
                vi conf-sqlld  
                        內容為: -L/usr/local/mysql/lib/mysql -lmysqlclient -lnsl -lm -lz  
                            -lz是增加zip壓縮支持  
                vi conf-bin  
                        第一行:/var/qmail/bin/ezmlm  
                vi conf-man  
                        第一行:/var/qmail/man  
                vi conf-qmail         
                        第一行:/var/qmail
        make setup
# make setup
./compile install.c
install.c: In function `main':
install.c:125: warning: return type of 'main' is not `int'
./load install getln.a strerr.a substdio.a stralloc.a \
alloc.a open.a error.a str.a fs.a
./install "`head -1 conf-bin`" < BIN
./install "`head -1 conf-man`" < MAN
# tar zxvf ezmlm-0.53.tar.gz
# tar zxvf ezmlm-idx-0.42.tar.gz
# cp -R ezmlm-idx-0.42/* ezmlm-0.53/
cp: overwrite `ezmlm-0.53/author.c'? y
cp: overwrite `ezmlm-0.53/auto_cron.h'? y
cp: overwrite `ezmlm-0.53/case_diffs.c'? y
cp: overwrite `ezmlm-0.53/case_starts.c'? y
cp: overwrite `ezmlm-0.53/CHANGES.idx'? y
cp: overwrite `ezmlm-0.53/checktag.c'? y
《解決方案》

繼續九

安裝qmaiadmin
    版本:qmailadmin-1.0.6.tar
tar xzf qmailadmin-1.0.6.tar
cd qmailadmin-1.0.6
./configure \
  --enable-htmldir=/usr/local/apache/htdocs \
  --enable-cgibindir=/usr/local/apache/cgi-bin \
  --enable-maxusersperpage=12 \
  --enable-maxaliasesperpage=12 \
  --enable-no-cache=y \
  --enable-modify-quota=n \
  --enable-help=n
  --enable-ezmlmdir=/var/qmail/bin/ezmlm/
# note, I chose to have 12 accounts per page in the config above,
# because this makes these particular screens fit nicely on my 1024*768 monitor
make
make install-strip
Test to see if it works
《解決方案》

繼續十

安裝igenus
版本:igenus_2_20030516_snap.tgz

作為webmail這個iGENUS使用上更符合中國人的習慣,功能也很強.
        tar zxf igenus_2.0.1_20040713_release.tgz -C /usr/local/apache/htdocs
        cd /usr/local/apache/htdocs/igenus/
        mkdir temp
        mkdir /home/netdisk
        chmod -R 0755 /home/netdisk/
        chown -R vpopmail.vchkpw /home/netdisk/
        chmod -R 0755 ../
        chown -R vpopmail.vchkpw ../
        vi /usr/local/apache/conf/httpd.conf  \\修改apache配置文件
                User vpopmail
                Group vchkpw

                AddType application/x-httpd-php .php
                AddType application/x-httpd-php-source .phps

                DirectoryIndex index.php index.html index.html.var

                NameVirtualHost *:80

                <VirtualHost *:80>
                ServerName mail.domain.net
                DocumentRoot /var/www/html
                </VirtualHost>

        /usr/local/apache/bin/apachectl restart  \\重啟apache
        vi config/config_inc.php  \\\修改config_inc.php文件
                $CFG_BASEPATH = "/usr/local/apache/htdocs/igenus";   \\改成你安裝的目錄
                $CFG_MYSQL_HOST = 'localhost';   
                $CFG_MYSQL_USER = 'vpopmail';        \\vpopmail訪問mysql的帳號
                $CFG_MYSQL_PASS = '123456';           \\ vpopmail訪問mysql的密碼
                $CFG_MYSQL_DB   = 'vpopmail';        \\資料庫
                $CFG_TEMP = $CFG_BASEPATH."/temp";   \\改成你安裝的目錄的當前目錄下
    重新編製Mysql資料庫表格:
        vdeldomain domain.com  \\刪除之前建立的虛擬域
        mysql vpopmail
          mysql> drop table 表名;  \\刪除vpopmail庫中的所有表
          mysql> quit
        vi docs/iGENUS.sql   \\修改iDENUS.sql文件
                CREATE TABLE `vpopmail` (^M
                          `pw_id` int(5) unsigned NOT NULL auto_increment,^M
                          `pw_name` varchar(32) NOT NULL default '',^M
                          `pw_domain` varchar(64) NOT NULL default '',^M
                          `pw_passwd` varchar(40) NOT NULL default '',^M
                          `pw_uid` int(11) default NULL,^M
                          `pw_gid` int(11) default NULL,^M
                        `pw_gecos` varchar(48) default NULL,^M
                        `pw_dir` varchar(255) default NULL,^M
                        `pw_shell` varchar(20) default NULL,^M
                        `pw_clear_passwd` varchar(16) default NULL,^M   \\添加這一行,寫後面的^M的方法是(Ctrl+v和Ctrl+m,這個是我偶然發現的哦 ^o^),有點麻煩,不如改的時候複製其它一行再修改就OK了
                        `createtime` timestamp(14) NOT NULL,^M
                          PRIMARY KEY  (`pw_id`),^M
                          KEY `pw_name` (`pw_name`,`pw_domain`)^M
                ) TYPE=MyISAM PACK_KEYS=1 ;^M
        mysql vpopmail < docs/iGENUS.sql  \\導入數據表
    設置igenus 定義允許上傳下載的郵件的大小:
        vi /etc/php.ini  \\修改PHP配置文件
                max_execution_time=60
                memory_limit=20M
                post_max_size = 10M
                file_uploads=on
                upload_max_filesize=10M
                register_globals=On
                session.bug_compat_42=0
                session.bug_compat_warn=0
                sendmail_path = /var/qmail/bin/qmail-inject

cd /usr/local/apache/htdocs/igenus/
      
# /usr/local/mysql/bin/mysql -uroot -psdmgmysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14 to server version: 4.0.21-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use vpopmail;
Database changed
mysql> show tables;
+--------------------+
| Tables_in_vpopmail |
+--------------------+
| address            |
| admin              |
| vpopmail           |
+--------------------+
3 rows in set (0.00 sec)

mysql> drop table address;
Query OK, 0 rows affected (0.00 sec)

mysql> drop table admin;
Query OK, 0 rows affected (0.00 sec)

mysql> drop table vpopmail;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
Php.ini文件配置:
include_path = ".:/usr/loca/apache/htdocs/igenus/conf:/usr/local/lib/php"
; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =root
; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =root
測試:
       http://maitest.domain.com/igenus

[火星人 ] 經過幾個星期測試完成的郵件系統(qmail)已經有756次圍觀

http://coctec.com/docs/service/show-post-17938.html