Solaris9でqpopper(APOP + SSL)




Solaris9にqpopperをAPOP,SSL対応でインストールする


opensslを使用するのでまず先にインストールする
URL:http://www.sunfreeware.com/
今回使用したものは、openssl-0.9.6i-sol9-sparc-local

# pkgadd -d openssl-0.9.6i-sol9-sparc-local


次に目的のqpopperをインストールする
最新のqpopperを入手する
URL:http://www.ring.gr.jp/
今回使用したものは、qpopper4.0.9

入手してきたqpopper4.0.9を解凍して適当なディレクトリにおく
# cd qpopper4.0.9
# ./configure --enable-apop=/etc/pop.auth --with-popuid=pop --with-openssl=/usr/local/ssl
checking whether make sets $(MAKE)... no
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.

config.logを見ろということなので見てみると
configure:1679: checking for C compiler version
configure:1682: gcc --version &5
ld.so.1: gcc: fatal: libiconv.so.2: open failed: No such file or directory
./configure: line 1:  1355 Killed                  $CC --version
configure:1685: $? = 137
configure:1687: gcc -v &5
ld.so.1: gcc: fatal: libiconv.so.2: open failed: No such file or directory
./configure: line 1:  1359 Killed                  $CC -v
configure:1690: $? = 137
configure:1692: gcc -V &5
ld.so.1: gcc: fatal: libiconv.so.2: open failed: No such file or directory
./configure: line 1:  1363 Killed                  $CC -V
configure:1695: $? = 137
configure:1719: checking for C compiler default output
configure:1722: gcc    conftest.c  >&5
ld.so.1: gcc: fatal: libiconv.so.2: open failed: No such file or directory
./configure: line 1:  1373 Killed                  $CC $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5
libiconvがない!ということらしい

ということで、libiconvをインストールする
今回使用したものは、libiconv-1.9.2-sol9-sparc-local
# pkgadd -d libiconv-1.9.2-sol9-sparc-local

再度qpopperのセットアップを試みる

# cd qpopper4.0.9
# ./configure --enable-apop=/etc/pop.auth --with-popuid=pop --with-openssl=/usr/local/ssl
エラー無し
続いて
# make
エラー無し
続いて
# make install
./install-sh -c -m 0644 -o root ./man/popper.8  /usr/local/man/man8/
echo "Installed man/popper.8 as /usr/local/man/man8/popper.8"
Installed man/popper.8 as /usr/local/man/man8/popper.8
./install-sh -c -m 0644 -o root ./man/popauth.8 /usr/local/man/man8/
echo "Installed man/popauth.8 as /usr/local/man/man8/popauth.8"
Installed man/popauth.8 as /usr/local/man/man8/popauth.8
cd ./popper  && make install
cd ../mmangle && make all
cd ../common && make all
gcc   pop_dele.o pop_dropcopy.o  pop_get_command.o pop_get_subcommand.o pop_init.o  pop_last.o pop_list.o pop_log.o pop_lower.o  pop_msg.o pop_parse.o pop_pass.o pop_quit.o  pop_rset.o pop_send.o pop_stat.o pop_updt.o  pop_user.o pop_xtnd.o pop_xmit.o popper.o  pop_bull.o xtnd_xlst.o pop_uidl.o mktemp.o  pop_rpop.o pop_apop.o md5.o pop_auth.o pop_pope.o  pop_extend.o scram.o hmac.o base64.o pop_util.o  get_sub_opt.o msg_ptr.o drac.o pop_config.o pop_tls.o  pop_tls_openssl.o pop_tls_sslplus.o sslplus_utils.o  main.o pop_cache.o genpath.o -o popper ../mmangle/libmangle.a \
        -I../common ../common/libcommon.a \
        -lnsl -lsocket -lresolv -lmail   -lnsl  -lposix4 -lcrypt -ldl -lpam -L/usr/local/ssl/lib -lssl -lcrypto 
.././install-sh -c -s -m 0755 -o root popper /usr/local/sbin/popper
echo "Installed popper as /usr/local/sbin/popper"
Installed popper as /usr/local/sbin/popper
if [ "x" != "x" ]; then \
    cd ../password && make install ;\
fi
if [ "xpopauth" != "x" ]; then \
    .././install-sh -c -s -m 4755 -o pop -g 0 popauth \
               /usr/local/sbin/popauth; \
    echo "Installed popauth as /usr/local/sbin/popauth " \
         "with uid pop"; \
    /usr/local/sbin/popauth -init -safe; \
fi
chown: unknown user id pop
*** Error code 2
make: Fatal error: Command failed for target `install'
Current working directory /export/home/nadmin/qpopper4.0.9/popper
*** Error code 1
make: Fatal error: Command failed for target `install'
エラーが発生!
ユーザIDがない!と言っているようだ
popというユーザとグループを追加して再度実行

# make install
./install-sh -c -m 0644 -o root ./man/popper.8  /usr/local/man/man8/
echo "Installed man/popper.8 as /usr/local/man/man8/popper.8"
Installed man/popper.8 as /usr/local/man/man8/popper.8
./install-sh -c -m 0644 -o root ./man/popauth.8 /usr/local/man/man8/
echo "Installed man/popauth.8 as /usr/local/man/man8/popauth.8"
Installed man/popauth.8 as /usr/local/man/man8/popauth.8
cd ./popper  && make install
cd ../mmangle && make all
cd ../common && make all
gcc   pop_dele.o pop_dropcopy.o  pop_get_command.o pop_get_subcommand.o pop_init.o  pop_last.o pop_list.o pop_log.o pop_lower.o  pop_msg.o pop_parse.o pop_pass.o pop_quit.o  pop_rset.o pop_send.o pop_stat.o pop_updt.o  pop_user.o pop_xtnd.o pop_xmit.o popper.o  pop_bull.o xtnd_xlst.o pop_uidl.o mktemp.o  pop_rpop.o pop_apop.o md5.o pop_auth.o pop_pope.o  pop_extend.o scram.o hmac.o base64.o pop_util.o  get_sub_opt.o msg_ptr.o drac.o pop_config.o pop_tls.o  pop_tls_openssl.o pop_tls_sslplus.o sslplus_utils.o  main.o pop_cache.o genpath.o -o popper ../mmangle/libmangle.a \
        -I../common ../common/libcommon.a \
        -lnsl -lsocket -lresolv -lmail   -lnsl  -lposix4 -lcrypt -ldl -lpam -L/usr/local/ssl/lib -lssl -lcrypto 
.././install-sh -c -s -m 0755 -o root popper /usr/local/sbin/popper
echo "Installed popper as /usr/local/sbin/popper"
Installed popper as /usr/local/sbin/popper
if [ "x" != "x" ]; then \
    cd ../password && make install ;\
fi
if [ "xpopauth" != "x" ]; then \
    .././install-sh -c -s -m 4755 -o pop -g 0 popauth \
               /usr/local/sbin/popauth; \
    echo "Installed popauth as /usr/local/sbin/popauth " \
         "with uid pop"; \
    /usr/local/sbin/popauth -init -safe; \
fi
Installed popauth as /usr/local/sbin/popauth  with uid pop
if [ "x" != "x" ]; then     \
        echo "Checking for pam.d file...";\
        PAMF="/etc/pam.d/";     \
        TEMP=".new";               \
        SAMPLE="../samples/qpopper.pam";  \
        if [ ! -e  ]; then         \
                if [ -e  ]; then     \
                        umask 0077;               \
                        cp  ;     \
                        echo "Created ";   \
                else                          \
                        echo "can't find  file"; \
                fi                            \
        fi                                \
fi
# 
エラー無し


○サービス起動のための設定
/etc/inetd.confに以下を追記
# POP3
pop3 stream tcp nowait root /usr/local/sbin/popper popper -s

○inetdの再起動
# ps -ef | grep inetd
# kill -HUP [pid]

○pop接続テスト
# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
ld.so.1: popper: 重大なエラー: libssl.so.0.9.8: open に失敗しました: ファイルもディレクトリもありません。
Connection closed by foreign host.
エラーが発生して接続できない!

○LD_RUN_PATHにopensslをインストールしたパスを指定
# vi $HOME/.profile
PATH=/usr/local/bin:/usr/ccs/bin:/usr/sbin:/usr/bin
LD_RUN_PATH=/usr/local/ssl/lib
export LD_RUN_PATH PATH

ログインし直して再度configure, make, make install
問題無し

○pop接続テスト
# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Qpopper (version 4.0.9) at [フルホスト名] starting.  <8919.1154414504@[フルホスト名]>

無事インストール完了