<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>My Great Log</title>
<link>http://s9l.com/index.php</link>
<pubDate>Fri, 01 Jun 2007 14:57:53 </pubDate>
<description>
My Great Log - RSS 2.0 (Really Simple Syndication).
</description>
<item>
<title>Postfix + sasl + MySQL</title>
<link>http://s9l.com/article.php?id=3</link>
<pubDate>Fri, 01 Jun 2007 14:57:53 +0900</pubDate>
<description>Debian上でpostfixでsaslを設定
目標　saslauthd を使わないで管理
BarklayDBはsaslpasswd2 -c ユーザID
で /etc/sasldb2 が出来上がる
chown postfix:sasl /e...</description>
<content:encoded>
<![CDATA[<p>Debian上でpostfixでsaslを設定</p>
<p>目標　saslauthd を使わないで管理
BarklayDBはsaslpasswd2 -c ユーザID
で /etc/sasldb2 が出来上がる
chown postfix:sasl /etc/sasldb2
ln /etc/sasldb2 /var/spool/postfix/etc/sasldb2
でpostfix のchroot で動くディレクトリにハードリンクしておく</p>
<p>/etc/postfix/sasl ディレクトリにsmtpd.conf
pwcheck_method: auxprop
を記述することで上記BarklayDBで管理したsaslが可能になる。</p>
<p>さてここからMySQLの管理にするための設定
/etc/postfix/sasl ディレクトリにsmtpd.conf
pwcheck_method: auxprop
pwcheck_method: auxprop
auxprop_plugin: sql
allowanonymouslogin: no
allowplaintext: yes
mech_list: cram-md5 plain login
sql_engine: mysql
sql_user: sqluser ←任意
sql_passwd: saslsqlpass ←任意
sql_database: sasldb ←任意
sql_hostnames: localhost ←問題はココでした
sql_select: SELECT <code>%p</code> FROM user_table WHERE username = '%u' and realm = '%r'
sql_verbose: yes</p>
<p>と記述
データベースは
mysqladmin create sasldb  データベース作成
mysql sasldbとしてデータベースクライアント起動
CREATE TABLE <code>user_table</code> (
  <code>No</code> int(11) NOT NULL auto_increment,
  <code>username</code> varchar(128) NOT NULL,
  <code>realm</code> varchar(128) NOT NULL,
  <code>userPassword</code> varchar(128) default NULL,
  <code>cmusaslsecretPLAIN</code> varchar(128) default NULL,
  <code>cmusaslsecretCRAM-MD5</code> varchar(128) default NULL,
  PRIMARY KEY  (<code>No</code>)
) ENGINE=MyISAM;</p>
<p>insert <code>user_table</code> values (NULL,'testuser','testpass','testpass','testpass');</p>
<p>とすることでpostfixにアクセスしてauth cram-md5 などして
ユーザ認証できるはずなんですが、落とし穴がありました。
/etc/hosts には　localhost があってきちんと認識してます。
でも、postfixのchroot環境ではこの限りでは無かったわけで
 warning: SASL authentication failure: no secret in database
とmail.warn に記録されてます。
/var/spool/postfix/etc/hosts にもlocalhostは記述していたのですが、やはりうまくいきませんでした。
結局smtpd.confの記述を
sql_hostnames: localhost
↓
sql_hostnames: 127.0.0.1
とすることで解決</p>
<p>これを見つける結果につながったのはsmtpd.conf に
log_level: 5
とした時/var/log/auth.log に
sql plugin try and connect to a host
sql plugin trying to open db 'sasldb' on host 'localhost'
sql plugin could not connect to host localhost
sql plugin couldn't connect to any host
と出てきたからでした。</p>
]]>
</content:encoded>
</item><item>
<title>MySQLでアカウント管理(1)コンパイル</title>
<link>http://s9l.com/article.php?id=2</link>
<pubDate>Sat, 10 Mar 2007 13:25:18 +0900</pubDate>
<description>MySQL とlibnss-mysqlを組み合わせることでLinuxのアカウント管理ができるようになります
MySQL-5.0.36
libnss-mysql-1.5
の組み合わせで作ってみました

MySQL
./configure --...</description>
<content:encoded>
<![CDATA[<p>MySQL とlibnss-mysqlを組み合わせることでLinuxのアカウント管理ができるようになります</p>
<p>MySQL-5.0.36
libnss-mysql-1.5
の組み合わせで作ってみました</p>
<p>
<a href="http://www.mysql.com">MySQL</a>
./configure --prefix=/usr --exec-prefix=/usr --libexecdir=/usr/sbin --datadi
r=/usr/share --sysconfdir=/etc/mysql --localstatedir=/var/lib/mysql --includedir
=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --enable-shared
--enable-static --enable-local-infile --with-unix-socket-path=/var/run/mysqld/my
sqld.sock --with-mysqld-user=mysql --without-openssl --with-yassl --without-docs
 --without-bench --with-extra-charsets=all --without-innodb --without-embedded-s
erver --without-ndb-sci --without-ndb-test --with-charset=utf8</p>
<p>
<a href="http://libnss-mysql.sourceforge.net/">libnss-mysql</a>
 ./configure --prefix=/usr --sysconfdir=/etc/libnss --with-mysql=/usr</p>
]]>
</content:encoded>
</item><item>
<title>MySQL関連</title>
<link>http://s9l.com/article.php?id=1</link>
<pubDate>Sat, 03 Mar 2007 14:49:52 +0900</pubDate>
<description>とりあえず MySQL関連での作業記録を残すように書いてきます





...</description>
<content:encoded>
<![CDATA[<p>とりあえず MySQL関連での作業記録を残すように書いてきます</p>
<p>
<a href="http://hb.afl.rakuten.co.jp/hsc/043b11c3.d2e819e8.043b11c4.f205c9bd/" target="_blank">
<img src="http://hbb.afl.rakuten.co.jp/hsb/043b11c3.d2e819e8.043b11c4.f205c9bd/" border="0">
</a>
</p>
]]>
</content:encoded>
</item>
</channel>
</rss>