popd のインストール

Debian LS-AVL/A

sendmail がなんとか動き始めたので、 続いて popd をインストールする。

どのパッケージをインストールすれば良い?

root@av:~# apt-cache search pop3d
cvm-mysql - Credential Validation Modules (MySQL)
cvm-pgsql - Credential Validation Modules (PostgreSQL)
cvm - Credential Validation Modules
libcvm1-dev - Credential Validation Modules (development files, documentation)
libcvm1 - Credential Validation Modules (shared libraries)
cyrus-common-2.2 - Cyrus mail system - common files
cyrus-pop3d-2.2 - Cyrus mail system - POP3 support
dovecot-pop3d - secure POP3 server that supports mbox and maildir mailboxes
fakepop - fake pop3 daemon. delivers same messages to all users
kolab-cyrus-common - Kolab Cyrus mail system - common files
kolab-cyrus-pop3d - Kolab Cyrus mail system - POP3 support
mailutils-pop3d - GNU mailutils-based POP3 Daemon
solid-pop3d - POP3 server supporting Maildir, PAM, vhosting
tcllib - the Standard Tcl Library
root@av:~#
パッケージがたくさんあって選択肢があるのは良いけれど、 たくさんありすぎてどれをインストールすれば良いのかわからないのは Debian の欠点でもある。

今、インストーするなら dovecot-pop3d かな。

dovecot-pop3d のインストール

root@av:~# apt-get install dovecot-pop3d
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python2.6-minimal mime-support libgsasl7 libmailutils2 python2.6 libexpat1 guile-1.8-libs libpython2.6 file libntlm0 libltdl7 libmagic1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  dovecot-common libpq5 openssl ucf
Suggested packages:
  ca-certificates
The following NEW packages will be installed:
  dovecot-common dovecot-pop3d libpq5 openssl ucf
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 7377 kB of archives.
After this operation, 15.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main ucf all 3.0025+nmu1 [69.6 kB]
Get:2 http://ftp.jp.debian.org/debian/ squeeze/main libpq5 armel 8.4.10-0squeeze1 [153 kB]
Get:3 http://ftp.jp.debian.org/debian/ squeeze/main openssl armel 0.9.8o-4squeeze7 [1055 kB]
Get:4 http://ftp.jp.debian.org/debian/ squeeze/main dovecot-common armel 1:1.2.15-7 [5077 kB]
Get:5 http://ftp.jp.debian.org/debian/ squeeze/main dovecot-pop3d armel 1:1.2.15-7 [1023 kB]
Fetched 7377 kB in 2s (2823 kB/s)
Preconfiguring packages ...
Selecting previously deselected package ucf.
(Reading database ... 16881 files and directories currently installed.)
Unpacking ucf (from .../ucf_3.0025+nmu1_all.deb) ...
Moving old data out of the way
Selecting previously deselected package libpq5.
Unpacking libpq5 (from .../libpq5_8.4.10-0squeeze1_armel.deb) ...
Selecting previously deselected package openssl.
Unpacking openssl (from .../openssl_0.9.8o-4squeeze7_armel.deb) ...
Selecting previously deselected package dovecot-common.
Unpacking dovecot-common (from .../dovecot-common_1%3a1.2.15-7_armel.deb) ...
Selecting previously deselected package dovecot-pop3d.
Unpacking dovecot-pop3d (from .../dovecot-pop3d_1%3a1.2.15-7_armel.deb) ...
Processing triggers for man-db ...
Setting up ucf (3.0025+nmu1) ...
Setting up libpq5 (8.4.10-0squeeze1) ...
Setting up openssl (0.9.8o-4squeeze7) ...
Setting up dovecot-common (1:1.2.15-7) ...

Creating config file /etc/dovecot/dovecot.conf with new version

Creating config file /etc/dovecot/dovecot-ldap.conf with new version

Creating config file /etc/dovecot/dovecot-sql.conf with new version
Creating generic self-signed certificate: /etc/ssl/certs/dovecot.pem
This certificate will expire in 10 years.
(replace with hand-crafted or authorized one if needed).
Starting IMAP/POP3 mail server: dovecot.
Setting up dovecot-pop3d (1:1.2.15-7) ...
Restarting IMAP/POP3 mail server: dovecotIf you have trouble with authentication failures,
enable auth_debug setting. See http://wiki.dovecot.org/WhyDoesItNotWork
This message goes away after the first successful login.
.
!root@av:~#
インストールできたけど、、

カスタマイズ

mbox 形式を使う、pop3 だけを使うように設定
root@av:~# pushd /etc/dovecot/
root@av:/etc/dovecot# mv dovecot.conf{,.orig}
root@av:/etc/dovecot# cp dovecot.conf{.orig,}
root@av:/etc/dovecot# diff -c dovecot.conf.orig dovecot.conf
*** dovecot.conf.orig   Sat Feb 25 22:44:39 2012
--- dovecot.conf        Sat Feb 25 22:45:49 2012
***************
*** 22,28 ****
  # Protocols we want to be serving: imap imaps pop3 pop3s managesieve
  # If you only want to use dovecot-auth, you can set this to "none".
  #protocols = imap imaps
! protocols = pop3 pop3s

  # A space separated list of IP or host addresses where to listen in for
  # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
--- 22,29 ----
  # Protocols we want to be serving: imap imaps pop3 pop3s managesieve
  # If you only want to use dovecot-auth, you can set this to "none".
  #protocols = imap imaps
! #protocols = pop3 pop3s
! protocols = pop3

  # A space separated list of IP or host addresses where to listen in for
  # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
***************
*** 228,233 ****
--- 229,235 ----
  # </usr/share/doc/dovecot-common/wiki/MailLocation.txt>
  #
  #mail_location =
+ mail_location = mbox:/var/mail/%u

  # If you need to set multiple mailbox locations or want to change default
  # namespace settings, you can do it by defining namespace sections.
root@av:/etc/dovecot#
こんなところか?

再起動

root@av:/etc/dovecot# /etc/init.d/dovecot restart
Restarting IMAP/POP3 mail server: dovecot.
root@av:/etc/dovecot#
つないでみる
root@av:/etc/dovecot# telnet localhost pop3
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user yasunari
+OK
pass パスワード
 -ERR [IN-USE] Couldn't open INBOX: Internal error occurred. Refer to server log for more information. [2012-02-25 22:46:15]
Connection closed by foreign host.
root@av:/etc/dovecot#
あらら。
指示通りにログを見てみる。
root@av:/etc/dovecot# tail /var/log/mail.err
	:
	:
Feb 25 22:46:15 av dovecot: POP3(yasunari): mbox root directory can't be a file: /var/mail/yasunari/ (http://wiki.dovecot.org/MailLocation/Mbox)
Feb 25 22:46:15 av dovecot: POP3(yasunari): Couldn't open INBOX: Internal error occurred. Refer to server log for more information. [2012-02-25 22:46:15]
root@av:/etc/dovecot#
あれ? mail_location の指定が間違っている??

ドキュメントを見る

root@av:/etc/dovecot# less /usr/share/doc/dovecot-common/wiki/MailLocation.txt
/usr/share/doc/dovecot-common/wiki/MailLocation.txt: No such file or directory
root@av:/etc/dovecot#
がー。 http://wiki.dovecot.org/MailLocation/Mboxを見る
root@av:/etc/dovecot# vi dovecot.conf
	:
	:
root@av:/etc/dovecot# !diff
diff -c dovecot.conf.orig dovecot.conf
*** dovecot.conf.orig   Sat Feb 25 22:44:39 2012
--- dovecot.conf        Sat Feb 25 23:34:31 2012
***************
*** 22,28 ****
  # Protocols we want to be serving: imap imaps pop3 pop3s managesieve
  # If you only want to use dovecot-auth, you can set this to "none".
  #protocols = imap imaps
! protocols = pop3 pop3s

  # A space separated list of IP or host addresses where to listen in for
  # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
--- 22,29 ----
  # Protocols we want to be serving: imap imaps pop3 pop3s managesieve
  # If you only want to use dovecot-auth, you can set this to "none".
  #protocols = imap imaps
! #protocols = pop3 pop3s
! protocols = pop3

  # A space separated list of IP or host addresses where to listen in for
  # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
***************
*** 228,233 ****
--- 229,235 ----
  # </usr/share/doc/dovecot-common/wiki/MailLocation.txt>
  #
  #mail_location =
+ mail_location = mbox:~/mail:INBOX=/var/mail/%u

  # If you need to set multiple mailbox locations or want to change default
  # namespace settings, you can do it by defining namespace sections.
root@av:/etc/dovecot#
こんな感じ?
root@av:/etc/dovecot# !?restart
/etc/init.d/dovecot restart
Restarting IMAP/POP3 mail server: dovecot.
root@av:/etc/dovecot# !telnet
telnet localhost pop3
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user yasunari
+OK
pass パスワード
+OK Logged in.
list
+OK 0 messages:
.
quit
+OK Logging out.
Connection closed by foreign host.
root@av:/etc/dovecot#
いけたみたい。
実際のメールを置いて試す。
root@av:/etc/dovecot# date | mail yasunari
root@av:/etc/dovecot# !Mail
Mail -f /var/mail/yasunari
Heirloom mailx version 12.4 7/29/08.  Type ? for help.
"/var/mail/yasunari": 1 message 1 new
>N  1 root               Sat Feb 25 23:38   19/747
? x
root@av:/etc/dovecot# !tel
telnet localhost pop3
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user yasunari
+OK
pass パスワード
+OK Logged in.
list
+OK 1 messages:
1 715
.
retr 1
+OK 715 octets
Return-Path: <root @ yamasita.jp>
Received: from av.yamasita.jp (localhost [127.0.0.1])
        by av.yamasita.jp (8.14.3/8.14.3/Debian-9.4) with ESMTP id q1PEcANo012292
        for <yasunari @ av.yamasita.jp>; Sat, 25 Feb 2012 23:38:10 +0900
Received: (from root @ localhost)
        by av.yamasita.jp (8.14.3/8.14.3/Submit) id q1PEcAEh012289
        for yasunari; Sat, 25 Feb 2012 23:38:10 +0900
From: root <root @ yamasita.jp>
Message-Id: <201202251438.q1PEcAEh012289 @ av.yamasita.jp>
Date: Sat, 25 Feb 2012 23:38:10 +0900
To: yasunari @ yamasita.jp
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Sat Feb 25 23:38:10 JST 2012
.
dele 1
+OK Marked to be deleted.
quit
 +OK Logging out, messages deleted.
Connection closed by foreign host.
root@av:/etc/dovecot#
行けてそう


LS-AVL/A
楽天市場
Amazon
uWorks
ValuMore
Yahoo!ショッピング


sendmail のトラブル
ハックの記録
LinkStation/玄箱 をハックしよう

bind のインストール

Copyright (C) 2003-2012 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市