<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>肖建彬的博客 &#187; Authlib</title>
	<atom:link href="http://www.xiaojb.com/archives/tag/authlib/feed" rel="self" type="application/rss+xml" />
	<link>http://www.xiaojb.com</link>
	<description>奋斗无止境 爱拼才会赢</description>
	<lastBuildDate>Sun, 16 Oct 2011 14:27:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>unable to open Berkeley db /etc/sasldb2</title>
		<link>http://www.xiaojb.com/archives/mailtech/unable-to-open-berkeley-db.shtml</link>
		<comments>http://www.xiaojb.com/archives/mailtech/unable-to-open-berkeley-db.shtml#comments</comments>
		<pubDate>Sun, 21 Dec 2008 13:47:46 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[MailTech]]></category>
		<category><![CDATA[Authlib]]></category>
		<category><![CDATA[Cyrus-sasl2]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://www.xiaojb.com/?p=713</guid>
		<description><![CDATA[同事在迁移邮件系统的时候，发现邮件系统在新机器上报告这样的日志： warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory 我们使用的authdaemond的认证方式，所以出现这种情况肯定是sasl判断到最后使用了默认的sasldb来验证。由于我好久没看邮件系统，而且这个问题我碰到了多次，在blog上也没有记录，于是重新解决了一遍。思路如下： 1、要判断使用的sasl的版本 我是自己编译的sasl，安装目录是/home/postfix/sasl，使用ldd查看一下postfix使用的是系统的sasl2，还是自己编译的。 [root@squid5 ~]# ldd /home/postfix/sbin/postfix libmysqlclient.so.15 => /lib/libmysqlclient.so.15 (0x00a40000) libm.so.6 => /lib/tls/libm.so.6 (0&#215;00647000) libsasl2.so.2 => /home/postfix/sasl/lib/libsasl2.so.2 (0&#215;00558000) libssl.so.4 => /lib/libssl.so.4 (0x002c8000) libcrypto.so.4 => /lib/libcrypto.so.4 (0x001dc000) libpcre.so.0 => /lib/libpcre.so.0 (0x001b8000) libdb-4.2.so => /lib/tls/i686/libdb-4.2.so (0&#215;00717000) libnsl.so.1 => /lib/libnsl.so.1 (0x006d3000) [...]]]></description>
			<content:encoded><![CDATA[<p>同事在迁移邮件系统的时候，发现邮件系统在新机器上报告这样的日志：<br />
warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory</p>
<p>我们使用的authdaemond的认证方式，所以出现这种情况肯定是sasl判断到最后使用了默认的sasldb来验证。由于我好久没看邮件系统，而且这个问题我碰到了多次，在blog上也没有记录，于是重新解决了一遍。思路如下：</p>
<p>1、要判断使用的sasl的版本<br />
我是自己编译的sasl，安装目录是/home/postfix/sasl，使用ldd查看一下postfix使用的是系统的sasl2，还是自己编译的。<br />
[root@squid5 ~]# ldd /home/postfix/sbin/postfix<br />
        libmysqlclient.so.15 => /lib/libmysqlclient.so.15 (0x00a40000)<br />
        libm.so.6 => /lib/tls/libm.so.6 (0&#215;00647000)<br />
        libsasl2.so.2 => /home/postfix/sasl/lib/libsasl2.so.2 (0&#215;00558000)<br />
        libssl.so.4 => /lib/libssl.so.4 (0x002c8000)<br />
        libcrypto.so.4 => /lib/libcrypto.so.4 (0x001dc000)<br />
        libpcre.so.0 => /lib/libpcre.so.0 (0x001b8000)<br />
        libdb-4.2.so => /lib/tls/i686/libdb-4.2.so (0&#215;00717000)<br />
        libnsl.so.1 => /lib/libnsl.so.1 (0x006d3000)<br />
        libresolv.so.2 => /lib/libresolv.so.2 (0x006be000)<br />
        libc.so.6 => /lib/tls/libc.so.6 (0x002fc000)<br />
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x0068e000)<br />
        libdl.so.2 => /lib/libdl.so.2 (0&#215;00641000)<br />
        /lib/ld-linux.so.2 (0x004f9000)<br />
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x007fc000)<br />
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0&#215;00835000)<br />
        libcom_err.so.2 => /lib/libcom_err.so.2 (0x0066c000)<br />
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0&#215;00812000)<br />
        libz.so.1 => /usr/lib/libz.so.1 (0x0067c000)<br />
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0x006fd000)<br />
2、查看sasl的配置smtpd.conf<br />
系统的路径应该是/usr/lib/sasl2/smtpd.conf<br />
内容应该如下：<br />
pwcheck_method: authdaemond<br />
mech_list:PLAIN LOGIN<br />
使用了authdaemond应该还可以指定socket文件的位置，不过我忘了。<br />
如果自己编译的，这个文件的位置应该是 ~/lib/sasl2</p>
<p>3、authdaemond的socket文件的权限<br />
我使用的是<a href="http://sourceforge.net/projects/courier">Courier-Authlib</a>，socket文件默认的路径应该是~/var/socket,所有要认证的程序的执行用户，都要有访问这个socket的权限。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiaojb.com/archives/mailtech/unable-to-open-berkeley-db.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>courier-authlib的应用</title>
		<link>http://www.xiaojb.com/archives/mailtech/courier-authlib.shtml</link>
		<comments>http://www.xiaojb.com/archives/mailtech/courier-authlib.shtml#comments</comments>
		<pubDate>Thu, 20 Jan 2005 15:49:59 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[MailTech]]></category>
		<category><![CDATA[Authlib]]></category>
		<category><![CDATA[Courier]]></category>
		<category><![CDATA[Maildrop]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.xiaojb.com/wp/?p=41</guid>
		<description><![CDATA[从 Courier 0.48, Courier-IMAP 4.0, and SqWebMail 5.0.开始，这些产品都将使用一个模块courier-authlib，介绍一下使用authlib的一些经验。]]></description>
			<content:encoded><![CDATA[<p>从 Courier 0.48, Courier-IMAP 4.0, and SqWebMail 5.0,maildrop-1.8.0(authlib可选)开始，这些产品都使用一个模块courier-authlib，我的编译authlib时的选项是<br />
./configure &#8211;prefix=/home/postfix/authlib &#8211;without-authpam \<br />
&#8211;without-authcustom &#8211;without-authpgsql &#8211;without-authldap \<br />
&#8211;without-authuserdb &#8211;without-authpwd &#8211;without-authshadow \<br />
&#8211;without-authvchkpw &#8211;with-authmysql \<br />
&#8211;with-authdaemonvar=/home/postfix/authlib/var \<br />
&#8211;mandir=/home/postfix/man &#8211;without-stdheaderdir \<br />
&#8211;sysconfdir=/home/postfix/authlib/etc<br />
make<br />
make install<br />
make install-migrate<br />
make install-configure</p>
<p>因为改变了courier-authlib的安装位置，所以需要加选项&#8211;without-stdheaderdir,在编译imapd的时候需要设定环境变量COURIERAUTHCONFIG,它的值就是完整courierauthconfig的路径，configure通过运行这个命令得到authlib的头文件，库文件的位置。假如没有指定COURIERAUTHCONFIG,或者指定的courierauthconfig的路径是错误的，那么courier-imap将无法找到头文件和库文件。例子:<br />
/home/postfix/authlib/bin/courierauthconfig &#8211;ldflags<br />
程序输出-L/home/postfix/authlib/lib/authlib<br />
/home/postfix/authlib/bin/courierauthconfig &#8211;cppflags<br />
程序输出-I/home/postfix/authlib/include</p>
<p>我编译imapd的选项是：<br />
COURIERAUTHCONFIG=/home/postfix/authlib/bin/courierauthconfig ./configure &#8211;prefix=/home/postfix/imapd \<br />
        &#8211;silent &#8211;without-authpgsql &#8211;without-ipv6 \<br />
        &#8211;mandir=/home/postfix/man &#8211;disable-root-check<br />
编译通过。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiaojb.com/archives/mailtech/courier-authlib.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

