當(dāng)前位置:首頁(yè)文章首頁(yè) IT學(xué)院 IT技術(shù)

詳解Linux下的postfix安裝

作者:  來源:  發(fā)布時(shí)間:2012-2-16 17:16:05  點(diǎn)擊:
  virtual_mailbox_extended = yes

  virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf

  virtual_mailbox_limit_override = yes

  virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please Tidy your mailbox and try again later.

  virtual_overquota_bounce = yes

  ##############END--############################################

  添加支持虛擬域和虛擬用戶所需要的配置文件

  [root@mail2 postfix]# vi mysql_virtual_domains_maps.cf

  user = extmail

  password = extmail

  hosts = localhost

  dbname = extmail

  table = domain

  select_field = description

  where_field = domain

  ~

  [root@mail2 postfix]# vi mysql_virtual_mailbox_limit_maps.cf

  user = extmail

  password = extmail

  hosts = localhost

  dbname = extmail

  table = mailbox

  select_field = quota

  where_field = username

  [root@mail2 postfix]# vi mysql_virtual_mailbox_maps.cf

  user = extmail

  password = extmail

  hosts = localhost

  dbname = extmail

  table = mailbox

  select_field = maildir

  where_field = username

  [root@mail2 postfix]# vi mysql_virtual_alias_maps.cf

  user = extmail

  password = extmail

  hosts = localhost

  dbname = extmail

  table = alias

  select_field = goto

  where_field = address

  ~

  四個(gè)配置文件

  第九,安裝courier-authlib

  Ok了,下面開始安裝

   courier-authlib

  [root@mail2 courier-authlib-0.63.0]# ./configure --prefix=/usr/local/courier-authlib --sysconfdir=/etc --without-authpam -without-authldap --without-authpwd --without-authshadow --without-authvchkpw --without-authpgsql --with-authmysql --with-mysql-libs=/usr/local/mysql/lib/mysql -with-mysql-includes=/usr/local/mysql/inculde/mysql --with-redhat --with-authmysqlrc=/etc/authmysqlrc --with-authdaemonrc=/etc/authdaemonrc CFLAGS="-march=x86-64 -O2 -fexpensive-optimizations" CXXFLAGS="-march=x86-64 -O2 -fexpensive-optimizations"

  其中有一個(gè)error,

  提示找不到expect not found - will not be able to change passwds 導(dǎo)致configure: error: --with-authmysql specified but no mysqlclient.so

  解決辦法:

  [root@mail2 lib]# cp /usr/local/mysql/lib/libmysqlclient.so /usr/lib/libmysqlclient.so

  之后重新編譯即可過去

  ./configure 過后,執(zhí)行make提示authmysql.h:8:19: 錯(cuò)誤:mysql.h:沒有那個(gè)文件或目錄

  authmysql.h:9:20: 錯(cuò)誤:errmsg.h:沒有那個(gè)文件或目錄

  make[2]: *** [authmysql.lo] 錯(cuò)誤 1

  Vi authmysql.h的文件

   Mysql/mysql.h

  保存即可

  [root@mail2 var]# chmod -R 755 /usr/local/courier-authlib/var/spool/authdaemon/

  進(jìn)入到目錄/etc/

  [root@mail2 etc]# cp authdaemonrc.dist authdaemonrc

  [root@mail2 etc]# cp authmysqlrc.dist authmysqlrc

  編輯文件authdaemonrc

  authmodulelistorig="authmysql"

  daemons=10

  authmodulelist="authmysql"

  編輯文件authmysql

   MYSQL_SERVER 127.0.0.1

  MYSQL_USERNAME extmail

  MYSQL_PASSWORD extmail

  MYSQL_SOCKET /data/mysql/mysql.sock 數(shù)據(jù)庫(kù)的監(jiān)聽文件

  MYSQL_PORT 3306 數(shù)據(jù)庫(kù)的端口

  MYSQL_DATABASE extmail 數(shù)據(jù)庫(kù)

  MYSQL_USER_TABLE mailbox 數(shù)據(jù)庫(kù)的表

  MYSQL_CRYPT_PWFIELD password 加密的字段

  MYSQL_UID_FIELD 503 郵件服務(wù)的屬主和屬組

  MYSQL_GID_FIELD 503

  MYSQL_HOME_FIELD concat('/var/mailbox/',maildir)

  MYSQL_NAME_FIELD name

  MYSQL_MAILDIR_FIELD concat('/var/mailbox/',maildir)

  ourier-authlib 的庫(kù)文件搜索路徑,并啟動(dòng)courier-authlib

  [root@mail2 postfix]# /usr/local/courier-authlib/sbin/authdaemond start

  [root@mail2 postfix]# echo "/usr/local/courier-authlib/lib/courier-authlib/lib" >> /etc/ld.so.conf

  [root@mail2 postfix]# ldconfig -v

  第十安裝IMAP服務(wù),

  安裝imap服務(wù)

  [root@mail2 postfix]# tar jxvf courier-imap-4.8.0.tar.bz2

  [root@mail2 ~]# ./configure --prefix=/usr/local/courier-imap --with-redhat --enable-unicode --disable-root-check --with-openssl --with-trashquota --without-ipv6 CPPFLAGS='-I/usr/local/courier-authlib/include' LDFLAGS='-L/usr/local/courier-authlib/lib/courier-authlib' COURIERAUTHCONFIG='/usr/local/courier-authlib/bin/courierauthconfig'

  Make && make install

  進(jìn)入到/usr/local/courier-imap/etc下面,去復(fù)制imap啟動(dòng)需要的配置文件

  [root@mail2 etc]# cp imapd-ssl.dist imapd-ssl

  [root@mail2 etc]# cp imapd.dist imapd

  [root@mail2 etc]# cp pop3d.dist pop3d

  [root@mail2 etc]# cp pop3d-ssl.dist pop3d-ssl

  配置courier-imap ,為用戶提供服務(wù)的類型,該處為用戶提供的是pop3d 服務(wù),如果為用戶提供IMAP 服務(wù),只需要修改對(duì)應(yīng)的選項(xiàng)

  IMAPDSTART=YES

  [root@mail2 etc]# vi pop3d

  POP3DSTART=YES

  將NO改為YES

  為虛擬用戶創(chuàng)建郵箱所在目錄,并修改權(quán)限.把其所屬主改為postfix

  [root@localhost mail]# mkdir -pv /var/mailbox/

上一篇:tar包的應(yīng)用 下一篇:

相關(guān)軟件

相關(guān)文章

文章評(píng)論

軟件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z