[root@fedora ~]# yum -y install yum-utils ← yumでSRPMをダウンロードするyumdownloaderを含むyum-utilsをインストール
[root@fedora ~]# yumdownloader --noplugins --source dovecot ← DovecotのSRPMをダウンロード
[root@fedora ~]# rpm -ivh dovecot-1.0.0-11.fc7.src.rpm ← DovecotのSRPMを展開
※ユーザ、グループが存在しない旨の警告メッセージが表示されるが問題ない
[root@fedora ~]# vi /usr/src/redhat/SPECS/dovecot.spec ← specファイル編集
%configure \
INSTALL_DATA="install -c -p -m644" \
--with-doc \
--with-vpopmail \ ← 追加
[root@fedora ~]# rpmbuild -bb --clean /usr/src/redhat/SPECS/dovecot.spec ← DovecotのRPMを作成
※時間がかかる
※rpmbuildが「ビルド依存性の失敗」で異常終了した場合
[root@fedora ~]# /etc/rc.d/init.d/dovecot stop ← 起動済Dovecot停止
Dovecot Imap を停止中: [ OK ]
[root@fedora ~]# yum -y remove dovecot ← インストール済Dovecot削除
[root@fedora ~]# rpm -ivh /usr/src/redhat/RPMS/i386/dovecot-1.0.0-11.fc7.i386.rpm ← 作成したDovecotのRPMをインストール
[root@fedora ~]# /bin/mv /etc/dovecot.conf.rpmsave /etc/dovecot.conf ← 旧Dovecot設定ファイルを流用
[root@fedora ~]# vi /etc/dovecot.conf ← Dovecot設定ファイル編集
# vpopmail authentication
passdb vpopmail { ← コメント解除
# [cache_key=] - See cache_key in PAM for explanation.
#args =
} ← コメント解除
# vpopmail
userdb vpopmail { ← コメント解除
} ← コメント解除
# Valid UID range for users, defaults to 500 and above. This is mostly
# to make sure that users can't log in as daemons or other system users.
# Note that denying root logins is hardcoded to dovecot binary and can't
# be done even if first_valid_uid is set to 0.
#first_valid_uid = 500
first_valid_uid = 89 ← 追加
#last_valid_uid = 0
vpopmail導入により不要になったシステムアカウントによる認証設定を無効化する
※無効化しないと認証に時間(2〜3秒くらい)がかかり、/var/log/secureに認証エラーメッセージが記録される
# PAM authentication. Preferred nowadays by most systems.
# Note that PAM can only be used to verify if user's password is correct,
# so it can't be used as userdb. If you don't want to use a separate user
# database (passwd usually), you can use static userdb.
# REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM
# authentication to actually work.
#passdb pam { ← 行頭に#を追加(コメントアウト)
# [blocking=yes] [session=yes] [setcred=yes]
# [cache_key=] []
#
# By default a new process is forked from dovecot-auth for each PAM lookup.
# Setting blocking=yes uses the alternative way: dovecot-auth worker
# processes do the PAM lookups.
#
# session=yes makes Dovecot open and immediately close PAM session. Some
# PAM plugins need this to work, such as pam_mkhomedir.
#
# setcred=yes makes Dovecot establish PAM credentials if some PAM plugins
# need that. They aren't ever deleted though, so this isn't enabled by
# default.
#
# cache_key can be used to enable authentication caching for PAM
# (auth_cache_size also needs to be set). It isn't enabled by default
# because PAM modules can do all kinds of checks besides checking password,
# such as checking IP address. Dovecot can't know about these checks
# without some help. cache_key is simply a list of variables (see
# doc/wiki/Variables.txt) which must match for the cached data to be used.
# Here are some examples:
# %u - Username must match. Probably sufficient for most uses.
# %u%r - Username and remote IP address must match.
# %u%s - Username and service (ie. IMAP, POP3) must match.
#
# If service name is "*", it means the authenticating service name
# is used, eg. pop3 or imap (/etc/pam.d/pop3, /etc/pam.d/imap).
#
# Some examples:
# args = session=yes *
# args = cache_key=%u dovecot
#args = dovecot
#} ← 行頭に#を追加(コメントアウト)
# /etc/passwd or similar, using getpwnam(). In many systems nowadays this
# uses Name Service Switch, which is configured in /etc/nsswitch.conf.
#
#userdb passwd { ← 行頭に#を追加(コメントアウト)
# [blocking=yes] - By default the lookups are done in the main dovecot-auth
# process. This setting causes the lookups to be done in auth worker
# proceses. Useful with remote NSS lookups that may block.
# NOTE: Be sure to use this setting with nss_ldap or users might get
# logged in as each others!
#args =
#} ← 行頭に#を追加(コメントアウト)
[root@fedora ~]# /etc/rc.d/init.d/dovecot start ← Dovecot起動
Dovecot Imap を起動中: [ OK ]
[root@fedora ~]# chkconfig dovecot on ← Dovecot自動起動設定
[root@fedora ~]# rm -f dovecot-1.0.0-11.fc7.src.rpm ← ダウンロードしたファイルを削除
[root@fedora ~]# rm -f /usr/src/redhat/RPMS/i386/* ← 作成したRPMを削除
[root@fedora ~]# rpmbuild --rmsource --rmspec /usr/src/redhat/SPECS/dovecot.spec ← RPM作成後始末
[root@fedora ~]# vi /etc/yum.conf ← yum設定ファイル編集
exclude=dovecot ← 追加(Dovecotをyumによるアップデート対象外にする)
|
|