wiflish
          Loving Life! Loving Coding!
          posts - 98,comments - 98,trackbacks - 0

          參考文檔:
          http://blog.5ilinux.com/archives/2006/05/postfix_cyrussa.html
          http://www.extmail.org/forum/archive/2/0510/563.html

          wget http://kent.dl.sourceforge.net/sourceforge/courier/courier-authlib-0.58.tar.bz2

          tar jvxf courier-authlib-0.58.tar.bz2

          ./configure --prefix=/usr/local/courier-authlib --without-stdheaderdir \
          --without-authuserdb --without-authpam --without-authldap --without-authpwd \
          --without-authshadow --without-authvchkpw --without-authpgsql --without-authcustom \
          --with-authmysql --with-mysql-libs=/usr/local/mysql/lib/ \
          --with-mysql-includes=/usr/local/mysql/include/ --with-redhat

          一個(gè)關(guān)鍵點(diǎn):
          如果courier-authlib安裝到非標(biāo)準(zhǔn)位置(例如安裝到/usr/local下),一定記得在./configure時(shí)增加-- without-stdheaderdir,這樣以后在編譯Courier-IMAP和maildrop的時(shí)候,不用特別指定courier- authlib的庫(kù)文件位置

          make
          make install
          make install-configure

          增加"/usr/local/courier-authlib/lib/courier-authlib"到你的"/etc/ld.so.conf",并執(zhí)行l(wèi)dconfig命令。
          chmod +x /usr/local/courier-authlib/var/spool/authdaemon

          vi /usr/local/courier-authlib/etc/authlib/authdaemonrc??? 可以不修改
          authmodulelist="authmysql"
          authmodulelistorig="authmysql"
          daemons=10

          vi /usr/local/courier-authlib/etc/authlib/authmysqlrc


          MYSQL_SERVER localhost
          MYSQL_USERNAME postfix
          MYSQL_PASSWORD yourpassword

          MYSQL_SOCKET /tmp/mysql.sock

          MYSQL_DATABASE postfix
          MYSQL_USER_TABLE mailbox

          MYSQL_CRYPT_PWFIELD password

          MYSQL_UID_FIELD 1002
          MYSQL_GID_FIELD 1002

          MYSQL_LOGIN_FIELD username
          MYSQL_HOME_FIELD '/opt/virtual' #設(shè)置postfix存儲(chǔ)郵件的目錄
          MYSQL_NAME_FIELD name

          MYSQL_MAILDIR_FIELD maildir
          MYSQL_QUOTA_FIELD quota
          MYSQL_WHERE_CLAUSE active='1'

          啟動(dòng)courier-authlib
          /usr/local/courier-authlib/sbin/authdaemond start

          設(shè)置Courier authentication library開(kāi)機(jī)自動(dòng)運(yùn)行,在/etc/rc.local中增加“/usr/local/courier-authlib/sbin/authdaemond start”。

          測(cè)試:

          通過(guò)以下命令獲得test@example.com的用戶名及密碼的BASE64編碼:

          perl -e 'use MIME::Base64; print encode_base64("test\@example.com")'
          dGVzdEBleGFtcGxlLmNvbQ==
          perl -e 'use MIME::Base64; print encode_base64("123")'
          MTIz
          telnet localhost 25
          Trying 127.0.0.1...
          Connected to localhost.localdomain (127.0.0.1).
          Escape character is '^]'.
          220 mail.xsbn.net ESMTP Postfix
          auth login
          334 VXNlcm5hbWU6
          dGVzdEBleGFtcGxlLmNvbQ==
          334 UGFzc3dvcmQ6
          MTIz
          235 Authentication successful
          quit
          221 Bye

          注:
          出現(xiàn)authentication error: Input/output error錯(cuò)誤的時(shí)候
          估計(jì)是查詢mysql時(shí),authdaemond出錯(cuò)了。具體要打開(kāi)authdaemonrc里的:

          DEBUG_LOGIN=2??? 原來(lái)默認(rèn)是0

          然后看看/var/log/maillog 在認(rèn)證失敗時(shí)有什么提示。根據(jù)提示去檢查問(wèn)題到底出在哪兒


          posted on 2006-12-01 14:44 想飛的魚(yú) 閱讀(3150) 評(píng)論(2)  編輯  收藏 所屬分類: linux

          FeedBack:
          # re: 安裝courier-authlib
          2007-09-03 16:26 | gdh
          # re: 安裝courier-authlib
          2007-09-03 16:27 | gdh
          主站蜘蛛池模板: 都兰县| 曲松县| 柯坪县| 周口市| 齐齐哈尔市| 于田县| 黎城县| 台东市| 扶风县| 宁阳县| 茌平县| 宁安市| 庆城县| 鹤山市| 丰镇市| 尼木县| 南京市| 荔波县| 仙居县| 康马县| 稷山县| 遂川县| 工布江达县| 渑池县| 金川县| 普洱| 台州市| 阿图什市| 二连浩特市| 水富县| 鹤庆县| 浪卡子县| 迁安市| 辉南县| 孝义市| 和林格尔县| 绥棱县| 玉环县| 栾城县| 拜城县| 阳朔县|