|
qmailadmin
|
|
|
ヴァーチャルメールサーバーを構築したいが、sqlはわからん人向け
メール利用のためだけにシステムアカウントを追加する必要がなくなる
qmail vpopmail admin dovecot |
|
|
|
|
インストール
|
|
Mailサーバー
|
qmailadmin
|
| |
|
|
|
|
|
# cd /usr/ports/mail/qmailadmin
# make install clean
===> SECURITY REPORT: This port has installed the following binaries which execute with increased privileges. /usr/local/www/cgi-bin.default/qmailadmin/qmailadmin
If there are vulnerabilities in these programs there may be a security risk to the system. FreeBSD makes no guarantee about the security of ports included in the Ports Collection. Please type 'make deinstall' to deinstall the port if this is a concern.
For more information, and contact details about the security status of this software, see the following webpage:
# cd /usr/ports/mail/vpopmail
# make install clean
# cd /usr/ports/mail/vqadmin
# make install clean
This port has installed the following binaries which execute with increased privileges. /usr/local/www/cgi-bin-dist/vqadmin/vqadmin.cgi
If there are vulnerabilities in these programs there may be a security risk to the system. FreeBSD makes no guarantee about the security of ports included in the Ports Collection. Please type 'make deinstall' to deinstall the port if this is a concern.
apacheを設定
Alias /qmailadmin/ "/usr/local/www/cgi-bin.default/qmailadmin"
Options ExecCGI Includes FollowSymLinks MultiViews -Indexes AllowOverride all Order allow,deny Allow from all
Alias /vqadmin/ "/usr/local/www/cgi-bin-dist/vqadmin"
Options ExecCGI Includes FollowSymLinks MultiViews -Indexes AllowOverride all Order allow,deny Allow from all
qmailのaliasの削除
qmailインストール直後には /var/qmail/alias配下に.qmail-*というaliasファイルがあります。既にqmailを利用している人もaliasファイルはこのディレクトリ上に作成していると思いますが、vpopmailを使用する場合、aliasの管理も vpopmailが/usr/local/vpopmail/domainsディレクトリ配下で管理しますので、全て一旦削除します。 # cd /var/qmail/alias # rm -f .qmail-*
Virtual Domainの作成
それでは必要なVirtual Domainを作成しましょう。今回はcitybsd.is-a-geek.comのドメインを作成します。
作り方ですが、/usr/local/vpopmail/binにあるvadddomainコマンドを使います。 vadddomainは指定ドメインの設定を行うほかに、「postmaster@指定ドメイン名」を作成しますので、 postmasterのメール受信パスワードの設定も同時に行います。
具体的には「vadddomain ドメイン名パスワード」の形式で実行します。パスワードはコマンドライン引数で省略した場合、コマンド実行後に聞いてきますのでそこで入力してもOKです。
「vdominfo ドメイン名」で作成されたドメイン情報が表示されます。ドメイン名を間違えて入力してしまったら、「vdeldomain ドメイン名」で削除もできます。
# cd /usr/local/vpopmail/bin # ./vadddomain citybsd.is-a-geek.com password01
確認 # ./vdominfo citybsd.is-a-geek.com domain: citybsd.is-a-geek.com uid: 89 gid: 89 dir: /usr/local/vpopmail/domains/citybsd.is-a-geek.com users: 1
ユーザの追加
ユーザの新規追加は「vadduser ユーザ名@ドメイン名」の形式で行います。 実行するとパスワード入力を二回聞かれますので、同じパスワードを入力してください。
追加確認は「vuserinfo ユーザ名@ドメイン名」でOKです。 また、ユーザ名を間違えてしまったら「vdeluser ユーザ名@ドメイン名」で削除します。
# ./vadduser hoe@citybsd.is-a-geek.com Please enter password for hoe@citybsd.is-a-geek.com:[パスワードを入力] enter password again:[パスワードを入力]
確認 # ./vuserinfo hoe@citybsd.is-a-geek.com name: hoe passwd: $1$o1AXafVj$mMC9X8tz.cEdxE3Nw7B1D0 clear passwd: uid: 1 gid: 0 flags: 0 gecos: hoe limits: No user limits set. dir: /usr/local/vpopmail/domains/citybsd.is-a-geek.com/hoe quota: NOQUOTA usage: NOQUOTA account created: Sat Nov 27 20:10:28 2004 last auth: Never logged in
aliasの設定
メールサーバを立ち上げると、 root,webmaster,postmaster,infoあたりのユーザにメールが必ずと行っていいほど来るようになりますね。 まあ基本的にはSPAMなんでしょうけど、その辺のメールをaliasで一人のユーザに転送する設定をしましょう。 postmaster はvadddomainで自動的に個別のアカウントが作成されますが、 aliasを設定すればそちらが優先されますので、転送しておいた方が便利です。
コマンドは「valias -i ユーザ名@ドメイン名 alias名@ドメイン名」となります。 一覧を見るには「valias -s ドメイン名」とします。aliasの削除は「valias -d alias名@ドメイン名」です。
# ./valias -i yotan@citybsd.is-a-geek.com asd@citybsd.is-a-geek.com # ./valias -s citybsd.is-a-geek.com root@citybsd.is-a-geek.com -> yotan@citybsd.is-a-geek.com webmaster@citybsd.is-a-geek.com -> yotan@citybsd.is-a-geek.com info@citybsd.is-a-geek.com -> yotan@citybsd.is-a-geek.com postmaster@citybsd.is-a-geek.com -> yotan@citybsd.is-a-geek.com asd@citybsd.is-a-geek.com -> yotan@citybsd.is-a-geek.com rabi# ./valias -d asd@citybsd.is-a-geek.com
dovecotの設定
[X] VPOPMAIL VPopMail support
にて コンパイルし直す
dovecot.conf を編集する。
passdb vpopmail { }
userdb vpopmail { }
メール保存場所の指定 mail_location = maildir:~/Maildir
※ この設定が大切 #first_valid_uid = 500 ↓ first_valid_uid = 50 (vpop uid)
ウェブミンなら↓

|
|
|