Linuxサーバ構築マニュアル
CentOS6.2
[ 提示用パソコン Cent OSサーバー機 製作:上江洲 卓 ]
平成24年10月
目
次
Ⅰ Linux基礎知識 ・・・・・・・・・・・・・・・・・・・ 1 1 Linuxとは ・・・・・・・・・・・・・・・・・・・ 1 2 オープンソースソフトウェア ・・・・・・・・・・・・・・・・・・・ 1 3 Linuxの特徴 ・・・・・・・・・・・・・・・・・・・ 1 4 カーネルとユーザランド ・・・・・・・・・・・・・・・・・・・ 2 5 Linuxディストリビューション ・・・・・・・・・・・・・・・・・・・ 2 Ⅱ CentOS基礎知識 ・・・・・・・・・・・・・・・・・・・ 4 1 CentOSとは ・・・・・・・・・・・・・・・・・・・ 4 2 ハードウェア推奨 ・・・・・・・・・・・・・・・・・・・ 5 Ⅲ Linuxのインストール ・・・・・・・・・・・・・・・・・・・ 5 1 Linuxをインストールする前に ・・・・・・・・・・・・・・・・・・・ 5 2 Linuxのインストール手順 ・・・・・・・・・・・・・・・・・・・ 6 Ⅳ Linuxのディレクトリ ・・・・・・・・・・・・・・・・・・・ 16 1 様々なディレクトリ ・・・・・・・・・・・・・・・・・・・ 16 (1) ルートディレクトリ ・・・・・・・・・・・・・・・・・・・ 16 (2) カレントディレクトリとホームディレクトリ ・・・・・・・・・・・・・・・・・・・ 16 Ⅴ コマンドラインについて ・・・・・・・・・・・・・・・・・・・ 17 1 コマンドラインからの操作 ・・・・・・・・・・・・・・・・・・・ 17 Ⅵ コマンドラインの基本的な使い方 ・・・・・・・・・・・・・・・・・・・ 17 1 「$」と「#」の意味 ・・・・・・・・・・・・・・・・・・・ 17 2 rootユーザの切り替え ・・・・・・・・・・・・・・・・・・・ 17 3 シャットダウン ・・・・・・・・・・・・・・・・・・・ 18 4 サービス管理 ・・・・・・・・・・・・・・・・・・・ 18 5 ディレクトリ移動 ・・・・・・・・・・・・・・・・・・・ 18 6 ファイル一覧表示 ・・・・・・・・・・・・・・・・・・・ 18 7 viエディタ ・・・・・・・・・・・・・・・・・・・ 19 (1) viエディタの起動 ・・・・・・・・・・・・・・・・・・・ 19 (2) viエディタの終了 ・・・・・・・・・・・・・・・・・・・ 19 (3) viエディタ コマンドモード ・・・・・・・・・・・・・・・・・・・ 20 8 IP及びネットワークの確認 ・・・・・・・・・・・・・・・・・・・ 20 9 メールの確認 ・・・・・・・・・・・・・・・・・・・ 20 Ⅶ メールサーバの構築 ・・・・・・・・・・・・・・・・・・・ 21 Postfixの設定 ・・・・・・・・・・・・・・・・・・・ 22 Ⅷ SMTP/IMAPサーバの設定 ・・・・・・・・・・・・・・・・・・・ 23 Dovecotの設定 ・・・・・・・・・・・・・・・・・・・ 23 パケットフィルタリングの設定 ・・・・・・・・・・・・・・・・・・・ 25 Ⅸ メールアドレスの作成 ・・・・・・・・・・・・・・・・・・・ 25 Ⅹ メールユーザの作成 ・・・・・・・・・・・・・・・・・・・ 25 付録資料Ⅰ
Linux(リナックス)基礎知識
1
Linuxとは
通常,一般に使用されている
PC は,Windows 等で動作する。Windows は,キーボー
ド,マウス,モニタ,ハードディスク,メモリのようなハードウェアを制御し,アプ
リケーションソフトを動作させるのに必要な基本的な機能を提供している。このよう
な機能のソフトウェアを,基本ソフトウェアと呼んでいる。
Linux は,この基本ソフト
ウェアの一種で,インターネットのサーバなどでよく使われている。最近では,スマ
ートフォン用の基本ソフトウェアとして
Android が注目されているが,Android も Linux
を基礎として開発されたものである。
2
オープンソースソフトウェア
Linuxは,
1991 年にフィンランドのヘルシンキ大学の大学院生(当時)Linus Torvalds
氏が中心となって開発している基本ソフトウェアである。Linux の最大の特徴は,オー
プンソースソフトウェアだということである。ソースコードと呼ばれる設計情報が全
面的に公開されていて,誰でも機能を修正したり付け加えたりすることができ,無料
で配布されている。そのため,全世界でたくさんの技術者が様々な形で
Linux に関わ
っている。こうした技術者や利用者の団体をコミュニティと呼ぶ。
Linux のコミュニティは,とても活発に活動しているので,非常に早く機能が追加さ
れ,ソースコード上に間違いなどがあっても迅速に修正が行われている。また,
Linux
上で動作する
Web サーバ,メールサーバ,データベースなどのソフトウェアもオープ
ンソースソフトウェアとして公開されていて,いろいろな用途で安くシステムを作る
ことができる。
3
Linuxの特徴
Linux の特徴としては,オープンソースソフトウェアであり,無償で使うことができ
ること以外にも,次のようなことがあげられる。
(1) 高品質
多くの人が参加した結果,不具合が迅速に修正され,
Linux はとても安定した品質
の良いシステムになっている。最近では,商用の
UNIX や Windows サーバなどと比べ
ても安定性が高いと言われており,24 時間 365 日の連続稼働にも耐えられる基本ソフ
(2) 軽量な基本ソフトウェア
様々な人が開発に参加した結果,
Linux にはとてもたくさんの機能が組み込まれて
いる。これらの機能は,利用者の必要に応じて選択して利用することができる。例え
ば,Linux では Windows のような GUI の画面も利用することができるが,それが不要
な場合には削除してしまうことすら可能である。このように,不要な機能を削除し,
必要な機能だけを利用すれば,
Linux は非常に軽量な基本ソフトウェアでもある。旧
型の性能の低いコンピュータ上でも,十分に動作することができる。
(3) 幅広い用途
Linux は,サーバとしてだけでなく様々な用途で使われている。例えば,スーパー
コンピュータの世界でも,標準的な基本ソフトウェアは
Linux で,世界のスーパーコ
ンピュータのランキングの上位
20 台のうち 19 台までもが Linux を採用している。最
近,Android のようなスマートフォン,カーナビのような組み込みデバイスでも頻繁
に使われるようになってきた。
このように,最近では
PC 以外のほとんどの分野で Linux が利用されるようになって
きている。
4
カーネルとユーザランド
Linux は基本ソフトウェアであるが,実際の Linux は次の2つ部分で構成されている。
(1) カーネル
ハードウェアを直接制御し,アプリケーションソフトウェアを動作させるのに必要
な基本的な機能を提供する。
(2) ユーザランド
コンピュータとしての基本的な機能を制御するソフトウェア群である。
Linux では
カーネル以外が直接ハードウェアを制御することはできない。そのため,ファイルの
管理,プログラムの実行の管理,ネットワークの設定管理などは,カーネル外のユー
ティリティプログラムがカーネルとの橋渡しをする役割を果たす。これらのユーティ
リティプログラムを総称してユーザランドと呼ぶ。
Linux は,カーネルだけでなくユ
ーザランドの部分まで,すべてオープンソースソフトウェアで構成されている。
5
Linuxディストリビューション
ソフトウェアが公開されている。こうしたソフトウェアの中から自分の好みに合うも
のを選んで使うことができる。
しかし,必要なソフトウェアを1つ1つ選ぶのはとても大変であり,ソフトウェア
同士の相性や技術的な難しさもある。そのため,Linux カーネルに様々なユーザランド
のプログラムやアプリケーションを組み合わせたものが,Linux ディストリビューショ
ンとしてまとめられている。
Linux ディストリビューションには,企業が提供する商用ディストリビューションと,
企業とは関係なくコミュニティで管理されるディストリビューションがある。日本国
内でよく使われている主なディストリビューションは次のようなものがある。
(1) RedHat Enterprise Linux
日本で一番よく使われている商用の
Linux ディストリビューションである。RedHat
社から提供されており,パッケージのアップデート,Q&A などの有償サポートがつ
いている。
(2) CentOS
RedHat Enterprise Linux と同じ設計情報(ソースコード)を使って作られた無償のディ
ストリビューションである。インターネット上でパッケージのアップデートを受ける
ことができるが,サポートはない。ただし,日本国内では書籍が一番充実している。
サポートへの問い合わせが不要で,書籍などの情報で自分で管理できる人がよく使っ
ているディストリビューションである。
今回は,
CentOS を活用してサーバの構築を行う。
(3) Scientific Linux
CentOS と同様に,RedHat Enterprise Linux と同じ設計情報(ソースコード)を使って
作られた無償のディストリビューションである。フェルミ国立加速器研究所(Fermi
National Accelerator Laboratory)と欧州原子核研究機構(CERN))が管理している。
CentOS よりも早く RedHat Enterprise Linux 6に対応したため,日本国内でも使われる
ようになった。
(4) Fedora
RedHat 社が主宰する Fedora プロジェクトが提供しているディストリビューション
である。年に1回から2回ほど新しいバージョンが出る。RedHat 社は,このプロジェ
クトでの成果をまとめて,数年に1度
RedHat Enterprise Linux をリリースしている。
最新の技術を使いたい上級者向けの
Linux である。
る。サポートは提供されていない。Fedora と同様に上級者向けの Linux である。
(6) SuSE Linux Enterprise Server
RedHat Enterprise Linux に次いで人気のある SuSE Linux の商用ディストリビューシ
ョンである。特にヨーロッパでは,RedHat Enterprise Linux よりも高いシェアを維持
している。
RedHat Enterprise Linux に比べ,やや先進的な機能を採用する傾向にある。
サポートも充実しているため,安心して利用することができる。
(7) OpenSuSE
OpenSuSE プロジェクトが主宰するディストリビューションで,無償で利用するこ
とができる。
SuSE Linux Enterprise Server は OpenSuSE の成果をまとめてリリースさ
れる。アップデートの頻度が高く,最新の技術をどんどん導入する傾向のある上級者
向
Ⅱ
CentOS(セント オーエス)基礎知識
1
CentOSとは
CentOS 6は,RedHat Enterprise Linux 6と同じソースコードから作られたディストリ
ビューションで,
2011 年7月にリリースされたディストリビューションである。CentOS
6の特徴は次の通りである。
(1) カーネル2.6
CentOS 5と同じカーネル 2.6 のより新しいバージョンを採用している。
(2) 64ビットCPUに対応したアプリケーション
32 ビット CPU と 64 ビット CPU の両方の版がリリースされている。64 ビット CPU
向けの機能がより拡充され,多くのアプリケーションが
64 ビットで動作するように
なっている。
(3) 大規模なシステムをサポート
4096 個の CPU,128TB までのメモリをサポートするなど,大規模なシステムでの利
用にも耐えられるようになった。
(4) 起動時間の短縮
従来に比べ,起動時間が非常に短くなっている。
(5) ext4の完全サポート
CentOS 5では限定的なサポートだった ext 4ファイルシステムが標準で利用される
CentOS 5がサポートしていた仮想化技術 Xen に替わり,新たな仮想化技術 KVM を
サポートした。
(7) SELinuxの完全サポート
CentOS 5で導入されていた拡張的なセキュリティである SELinux の利用範囲が大き
く拡充された。
CentOS 6では,SELinux の厳しいセキュリティ機能が標準的に有効に
なっていることを前提として,セキュリティ設計が行われている。それにもかかわら
ず,SELinux を意識しなくても利用できるように,様々な工夫が行われている。
(8) カーネルモードグラフィックドライバ
グラフィックドライバがカーネル内で動作するようになり,描画性能が向上してい
る。そのため,
GUI を使ってサーバを管理した場合のシステム負荷が小さくなった。
(9) その他
様々なアプリケーションがバージョンアップし,機能向上が図られている。
2
ハードウェア推奨
CentOS 6を利用できるハードウェア要件として決まっているのは次の通りである。
書籍についている
CentOS 6は,DVD で提供されているので,インストールには
DVD-ROM が附属されているパソコンが必要である。
Ⅲ
Linuxのインストール
1
Linuxをインストールする前に
下記の事項を決めておく。
root パスワード ( 例:admin2012 )表1
CentOS を利用できるハードウェア要件
CPU
Pentium Ⅱクラス以上
メモリ
1
GB 以上
ハードディスク
3
GB 以上
2
Linuxのインストール手順
1
インストーラの起動
サーバ
PC に CentOS6.2 の DVD-ROM をセ
ットし,電源を入れる。左の画面が表示され
ると
2
メディアテスト
※
DVD-ROM のメディアチェックを行う場合
は【OK】を選択するが,今回は必要はない。
3
インストールの開始
左のようなインストール開始画面が表示さ
れると
※もし,この画面が正常に表示されない場合
には,一度
PC の電源を切り,最初からやり
直す。ただし,最初のメニューで【
Install system
with basic video driver】を選んで起動する。
4
言語の設定
インストールが始まると,左のような言語
選択画面が表示される。
【
Install or upgrade an exisiting system】
を選択し,Enter キーを押す。
【
skip】を選択し,Enter キーを押す。
【
Next】をクリックする。
【
japanese(日本語)】を選択し,
【
Next】
5
キーボードの選択
キーボードのタイプを選択する画面が表示
され,
6
ディスクストレージのタイプ選択
パソコンが,使用するストレージデバイス
のタイプを選択する。
7
ハードディスクの初期化
初めて使うハードディスクや,Linux のイ
ンストールをまだ行ったことがないハードデ
ィスクは,ディスクを初期化して良いかを,
問い合わせるメッセージが
出てくる。
8
ホスト名の入力
ホスト名の欄に,パソコンにつけるホスト
名を入力する。ドメイン名なしのホスト名を
登録しても構わない。
【日本語】を選択し,【次】をクリッ
クする。
【【
Basics Storage Devices】を選択した
後【次】をクリックする。
【すべてを再初期化】または,【はい。
含まれていません。
】を選択した後,
【次】
をクリックする。
【ホ スト名】を入 力し,【
Configigure
Network】をクリックする。
9
ネットワークの接続
10
IPの設定
11
ネットワーク接続設定終了
12
ホスト名設定完了
【有線】と【
System eth0】を選択し,
【編
集】をクリックする。
【
IPv4 のセッティング】のタブを選択
し,【自動接続する】にチェックマーク
を入れ,【追加】をクリックし,【
IP ア
ドレス】,【ネットマスク】,【ゲートウェ
イ】,を指定し,【
DNS サーバー】を入
力し【適用】をクリックする
【閉じる】をクリックする。
【次】をクリックする。
13
地域の選択
14
Rootパスワードの設定
15
インストールタイプの設定
16
/boot/パーティーションの作成①
【カスタムレイアウトを作成する】を選択
すると,パーティションの設定画面が表示さ
れる。
CentOS6 は, OS である自分自身の起動のために "/boot" パーティションを独立して作成する。 "/boot" パーティションには CentOS6 の中核となる【アジア/東京】を選択し,【次】をク
リックする。
【
root パスワード】を選択した後【次】
をクリックする。
【カスタムレイアウトを作成】を選択
した後,【次】をクリックする。
【作成】をクリックする。
17
/boot/パーティーションの作成②
/boot/パーティションの設定から行う。
18
/boot/パーティションの作成③
19
LVM物理ボリュームの作成①
20
LVM物理ボリュームの作成②
【標準パーティション】を選択し,【作成】 をクリックする。マウントポイントを【
/boot/】に,サイ
ズを【
768】に,【基本パーティション】
にチェックマークを入れ,【
OK】をクリ
ックする。
【作成】を選択する。ストレージ作成の画面で【
LVM ボリュ
ームグループ】を選択し,【作成】をク
リックする。
21
LVM物理ボリュームの作成③
22
LVMボリュームグループの作成①
23
LVMボリュームグループの作成②
24
LVMボリュームグループの作成③
ファイルシステムタイプを【physical volume (LVM)】を選択,サイズを【200】を選択, 追加容量オプションを【最大許容量まで使用】 を選択し,【OK】をクリックする。 【作成】を選択する。ストレージ作成の画面で【
LVM ボリュ
ームグループ】を選択し,【作成】をク
リックする。
ボリュームグループは好きな名前をつ
けることが可能。物理ボリュームの【追
加】をクリックする。
25
LVMボリュームグループの作成④
26
LVMボリュームグループの作成⑤
27
LVMボリュームグループの作成⑥
28
ディスクフォーマットの確認
ファイルシステムタイプを【
swap】
を選択し,サイズ【
2048】を入力し,
【
OK】
をクリックする。
物理ボリュームの【追加】をクリック
する。
マウントポイントは【
/】を選択し,
【
OK】をクリックする。論理ボリュー
ムが2つ作成されていることを確認し
【
OK】をクリックする。
間違っていなければ【次】をクリック
し,消去して良ければ【フォーマット】
をクリックする。
29
書き込み
30
ソフトウェアセットの選択
31
ソフトウェアの選択①
32
ソフトウェアの選択②
【
Write changes to disk】をクリックす
る。
【
Desktop】にチェックマークを入れ,
【今すぐカスタマイズ】を選択し,
【次】
をクリックする。
【サーバー】をクリックし,【電子メ
ールサーバー】にチェックマークを入
れる。
【
Web サービス】をクリックし,
【
Web
サ ー バ ー 】 に チ ェ ッ ク マ ー ク を 入 れ
【次】をクリックする。
33 インストール開始
※時間が30 分ほどかかります34
インストール後の再起動
35
ようこそ画面
36
ライセンス情報
【再起動】をクリックする。
【進む】をクリックする。
【はい,ライセンス同意書に同意しま
す】にチェックマークをいれ,【進む】
をクリックする。
37 ユーザの作成
ユーザアカウントを作成する。
38
日付と時刻の設定
インターネットに接続できない場合は,こ
の画面で手動で日付と時刻を設定する。
39
Kdumpカーネルクラッシュダンプの設定
40
Linuxの起動
再起動し,ログイン後,
CentOS6.0 のデス
クトップ画面が現れる。インストール完了
【ユーザ名】
【フルネーム】
【パスワード】
を入力し【進む】をクリックする。
【終了】
をクリックする。
Ⅳ
Linuxのディレクトリ
表1 Linux(CentOS)のディレクトリ/sbin
システムの動作や管理に必要なプログラム
/lib
システムの動作に必要なライブラリ
/etc
システムの設定ファイル等
/usr
ユーザ用のプログラムやライブラリ
/var
システムの動作中に変更されるログやデータ
/root
root ユーザのホームディレクトリ
/home
root 以外のユーザのホームディレクトリ
/tmp
一時ファイル
/lost+found 電源断などでファイルやディレクトリが壊れたときに,修復プログラムが利
用する領域
1
様々なディレクトリ
(1) ルートディレクトリ
Linux のディレクトリー構造は,/(ルートと呼ぶ)ディレクトリを頂点とした,1
つのツリー構造になっている。
/ディレクトリにすべてのファイル,ディレクトリが含
まれる形となっている。Windows では,ハードディスクや CD-ROM ドライブなどが,
ドライブとして存在しているが,Linux の場合,ファイルやディレクトリだけでなく,
ハードディスクや
CD-ROM なども,/ディレクトリの中に含まれている。今現在自分
が注目しているディレクトリを,カレントディレクトリという。
(2)
カレントディレクトリとホームディレクトリ
自分が,今現在見ているディレクトリをカレントディレクトリという。カレントデ
ィレクトリを確認するためのコマンド(命令)は
P16 を参照。
一般にユーザを作成すると,/home ディレクトリにユーザ名と同じ名前のディレク
トリが作成される。一般ユーザでログインした直後は,そのユーザ名と同じ名前のデ
ィレクトリが,カレントディレクトリとなっており,このディレクトリをユーザ専用
のホームディレクトリと呼んでいる。
Ⅴ
コマンドラインについて
1
コマンドラインからの操作
Linux コマンドを活用するためにはアプリケーションソフトである「端末」を起動する
必要がある。
「端末」は「アプリケーション」-「システムツール」からコマンドを実行する「端
末」を起動する。
Ⅵ
コマンドの基本的な使い方
Linux では,利用者とのやりとりを文字だけで行う機能を頻繁に使用する。キーボードか
らの文字入力だけで,コンピュータへの指示を出すことができる。コンピュータに対して
出す命令(コマンド)を行単位で指示するため,このような使い方をコマンドラインと呼
んでいる。ここでは,基本的なコマンドを示す。
1
「$」と「#」の意味
コマンド入力する際,左側に「
$」と「#」の記号が出てくる。
●「$」の場合は一般ユーザで実行する
●「#」の場合はシステム管理者の root 権限で実行する
2
rootユーザの切り替え
$ su -
元のユーザに戻る場合
パスワード:*******
# exit
3
シャットダウン
root ユーザの権限でシャットダウンすることができる。
今すぐ電源停止
# shutdown -h now
今すぐ再起動
# shutdown -r now
「-h」はシステム電源停止,「-r」はシステム再起動,「now」は今すぐ,「now」の代わ
りに「03:15」の時間指定や,「+10」の 10 分後という指定もできる。
4
サービス管理
サービスの停止
サービスの再起動
# service 【ファイル名】 stop
# service 【ファイル名】 restart
サービスの起動
サービス設定の再読込
# service 【ファイル名】 start
# service 【ファイル名】 reload
5
ディレクトリ移動
カレントディレクトリの表示
絶対パスで移動
# pwd
# cd /【ディレクトリ名】
相対パスで移動(親ディレクトリに移動)
ホームディレクトリに移動
# cd ..
# cd
6
ファイル一覧表示
親ディレクトリ一覧
カレントディレクトリ一覧
# ls ..
# ls
カレントディレクトリ一覧詳細表示
# ls -l
7
viエディタ
vi エディタは,Linux に標準で搭載されているテキストエディタである。通常のテキ
ストエディタのように,一画面でカーソルを移動したり,文字を入力するのではなく,
「コマンドモード」と「入力モード」という
2 画面(2 つのモード)を使い分け,しか
も文字の削除やカーソル移動もキーボード上で行わなければならない。初めて
vi エデ
ィタを使う人は慣れるまで時間がかかる。
「i」キーを入力することでコマンドモードから入力モードへ,「ESC」キーを入
力することで入力モードからコマンドモードへ切り替わる。
(1) viエディタの起動
# vi 【ファイル名】
vi エディタを起動するには,vi のあとにスペースを空け,ファイル名を指定する。
この時
vi エディタを起動すると,「コマンドモード」で起動する。
(2) viエディタの終了
vi エディタを終了するには「コマンドモード」で終了コマンドを実行する必要が
あ
る。
vi の終了コマンドには様々なものが用意されており,状況によって使い分け
がで
きるようになっている。終了コマンドについては,表2を参照する。
表2 終了コマンド:
wq
保存して終了
:zz
保存して終了
:w !
強制
上書き保存:
q
保存せずに終了
:
q !
保存せずに強制終了
(3) viエディタ コマンドモード
vi エディタでファイルを開くと,まずコマンドモードで画面が起動する。
このコマンドモードでは,文字の入力を行うことはできず,文字の削除や挿入,置
換などを行うためのモードになる。
表3 その他のコマンドi
文字を挿入する(入力モードになる)
:
set number 行番号を表示
:行番号
指定した行へジャンプ
/○○○○
「○○○○」をファイルの先頭から
検索
?○○○○
「○○○○」をファイルの最後から
検索
^
行頭へ移動
$
行末へ移動
8
IP及びネットワークの確認
ネットワークの設定を行った後,自分の
IP アドレスの確認やネットワークが通って
いるか確認するためのコマンドを下に示す。
IP アドレスの確認
ネットワークが通っているか確認
# ifconfig
# ping 【IP アドレス】
9
メールの確認
メール送信コマンド
# mail 【メールアドレス】
mail コマンドを終了する場合は「Ctrl」キー+「D」キー
受信した直後のメールは
Maildir の new ディレクトリに保存される。
実際に作成されたファイルの確認
# ls -l /home/【メールユーザ名】/Maildir/new/
メール内容の確認
Ⅶ
メールサーバの構築
メールサーバを構築するためには,メール配送を行うための
SMTP サーバが必要となる。
SMTP サーバとして動作する Postfix ソフトウェアの設定を行う。
ここでは,
/etc/postfix/main.cf
のファイルを
vi エディタで編集する。
/ etc postfix
main.cf
rc.d init.d postfix
aliases
aliases.db
usr libexec postfix master
sbin postalias
var spool postfix
log maillog 図1 Postfix の主なファイルと保存場所 Postfix の設定ファイル Postfix の起動スクリプト エイリアス設定ファイル エイリアス設定ファイルの DB 形式 Postfix のメインプログラム aliases ファイルを DB 形式に変換するコマンド 配送前のメールが保管されるディレクトリ メールのログファイル
【Postfixの設定】
①
vi エディタで main.cf を開く
#
vi
/etc/postfix/main.cf
②行番号を表示する
:
set
number
③「i」キーを押して,入力モードにする
④
75 行目の#を外して,サーバのホスト名を設定する
myhostname
=
linux.【ホスト名】.com
⑤
83 行目の#を外して,ドメイン名を設定する
mydomain
=
【ドメイン名】.com
⑥
98 行目の#を外して,設定を有効にする
myorigin
=
$myhostname
⑦
113 行目の#を外して,設定を有効にする
inet_interfaces
=
all
⑧
116 行目の行頭に#を追加する
#inet_interfaces
=
localhost
⑨
164 行目の行頭に#を追加する
#mydestination
=
$myhostname,
localhost.$mydomain,
localhost
⑩
165 行目の#を外して,設定を有効にする
mydestination
=
$myhostname,
localhost.$mydomain,
localhost,
$mydomain
⑪
264 行目の#を外して,設定を次のようにする
mynetworks
=
192.168.0.0/24,
127.0.0.0/8
⑫
419 行目を変更する
home_mailbox
=
Maildir/
⑬「
ESC」キーを押して,コマンドモードにする
⑭保存して終了する
:wq
⑮
Postfix の設定チェックをする
#
service
postfix
check
⑰システム起動時に自動で
Postfix サービスを開始の設定をする
# chkconfig
postfix on
Ⅷ
POP/IMAPサーバの設定
Postfix はメール配信する SMTP サーバとしての機能しか持たないため,メールの読み出
しを行うことができない。そのため
POP/IMAP サーバである Dovecot を設定する必要があ
る。
こ こ で は ,
/etc/dovecot/dovecot.conf, /etc/dovecot/conf.d/10-auth.conf,
/etc/dovecot/conf.d/10-mail.conf
の3つのファイルを
vi エディタで編集する。
/ etc dovecot dovecot.conf
conf.d 10-auth.conf
10-mail.conf
rc.d init.d dovecot
sysconfig dovecot
usr sbin dovecot
図2 Dovecot の主なファイルと保存場所
【Dovecotの設定】
Dovecpt の基本設定ファイル Dovecot の詳細設定ファイをが保管 Dovecot 起動スクリプト Dovecot 起動オプション設定ファイル Dovecot のプログラム:
set
number
③「i」キーを押して,入力モードにする
④
21 行目に,protocols 行を pop3 のみになるように追加し,22 行目を 1 行あける
protocols = imap pop3
⑤「ESC」キーを押して,コマンドモードにする
⑥保存して終了する
:wq
⑦
vi エディタで 10-mail.cof を開く
#
vi
/etc/dovecot/conf.d/10-mail.conf
⑧行番号を表示する
:
set
number
⑨「i」又は「r」キーを押して,入力モードにする
⑩
31 行目に,Maildir 形式を有効にするように追加し,32 行目を 1 行あける
mail_location
=
maildir:~/Maildir
⑪「ESC」キーを押して,コマンドモードにする
⑫保存して終了する
:wq
⑬
vi エディタで 10-auth.conf を開く
#
vi
/etc/dovecot/conf.d/10-auth.conf
⑭行番号を表示する
:
set
number
⑮「i」又は「r」キーを押して,入力モードにする
⑯
9 行目の#を外し,no に変更する
disable_plaintext_auth
=
no
⑰「ESC」キーを押して,コマンドモードにする
⑱保存して終了する
:wq
⑲
dovecot サービスの起動を起動する
#
service
dovecot
start
⑳システム起動時に自動で
dovecot サービスを開始の設定をする
#
chkconfig
dovecot
on
【パケットフィルタリングの設定】
メールサーバでは,MTA(Mail Transter Agent)が動作していて,メールを受け取る。M
TAでは,SMTPプロトコルでTCPの25番ポートを使用する。また,POP3では,110番ポートと1
43番ポートをそれぞれ使用する。メールサービスを公開するためには,これらのポートが
利用できるようにパケットフィルタリングの設定を行う必要がある。
パケットフィルタリングの設定は,GUIで行うことができ,次のような設定をする。
①[システム]-[管理]-[ファイアウォール]から実行する。
②[信頼したサービス]で「SSL上のPOP-3」「メール(SMTP)
」を有効にする。
③[その他のポート]を選択し,右側の画面で[追加]ボタンをクリックする。
④ポートとプロトコルの一覧から,TCP のポート 110 と TCP のポート 143 の項目を選ん
で[OK]をクリックする。(実際に使うプロトコルに合わせて設定する。)
⑤最後に[適用]ボタンを押すと,設定が行われる。
⑥設定が終了したら,
iptables サービスを再起動する。
#
service
iptables restart
Ⅸ
メールアドレスの作成
メールアドレスは,新しくユーザを追加することにより作成可能になる。
【メールユーザの作成】
①メールユーザを作成する
#
useradd
-s
/sbin/nologin
【ユーザ名】でメール専用ユーザが作成される
②パスワードを設定する
#
passwd
【ユーザ名】
付録資料①
# Global Postfix configuration file. This file lists only a subset # of all parameters. For the syntax, and for a complete parameter # list, see the postconf(5) manual page (command: "man 5 postconf"). #
# For common configuration examples, see BASIC_CONFIGURATION_README # and STANDARD_CONFIGURATION_README. To find these documents, use # the command "postconf html_directory readme_directory", or go to # http://www.postfix.org/.
#
# For best results, change no more than 2-3 parameters at a time, # and test if Postfix still works after every change.
# SOFT BOUNCE #
# The soft_bounce parameter provides a limited safety net for
# testing. When soft_bounce is enabled, mail will remain queued that # would otherwise bounce. This parameter disables locally-generated # bounces, and prevents the SMTP server from rejecting mail permanently # (by changing 5xx replies into 4xx replies). However, soft_bounce # is no cure for address rewriting mistakes or mail routing mistakes. #
#soft_bounce = no
# LOCAL PATHNAME INFORMATION #
# The queue_directory specifies the location of the Postfix queue. # This is also the root directory of Postfix daemons that run chrooted. # See the files in examples/chroot-setup for setting up Postfix chroot # environments on different UNIX systems.
#
queue_directory = /var/spool/postfix
# The command_directory parameter specifies the location of all # postXXX commands.
#
command_directory = /usr/sbin
# The daemon_directory parameter specifies the location of all Postfix # daemon programs (i.e. programs listed in the master.cf file). This # directory must be owned by root.
#
data_directory = /var/lib/postfix # QUEUE AND PROCESS OWNERSHIP #
# The mail_owner parameter specifies the owner of the Postfix queue # and of most Postfix daemon processes. Specify the name of a user # account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS # AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In
# particular, don't specify nobody or daemon. PLEASE USE A DEDICATED # USER.
#
mail_owner = postfix
# The default_privs parameter specifies the default rights used by # the local delivery agent for delivery to external file or command. # These rights are used in the absence of a recipient user context. # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
#
#default_privs = nobody
# INTERNET HOST AND DOMAIN NAMES #
# The myhostname parameter specifies the internet hostname of this # mail system. The default is to use the fully-qualified domain name # from gethostname(). $myhostname is used as a default value for many # other configuration parameters.
#
myhostname = linux.okigiken.com
#myhostname = virtual.domain.tld
# The mydomain parameter specifies the local internet domain name. # The default is to use $myhostname minus the first component. # $mydomain is used as a default value for many other configuration # parameters.
#
mydomain = okigiken.com
# SENDING MAIL #
# The myorigin parameter specifies the domain that locally-posted # mail appears to come from. The default is to append $myhostname, # which is fine for small sites. If you run a domain with multiple # machines, you should (1) change this to $mydomain and (2) set up
# myorigin also specifies the default domain name that is appended # to recipient addresses that have no @domain part.
#
myorigin = $myhostname
#myorigin = $mydomain # RECEIVING MAIL
# The inet_interfaces parameter specifies the network interface # addresses that this mail system receives mail on. By default, # the software claims all active interfaces on the machine. The # parameter also controls delivery of mail to user@[ip.address]. #
# See also the proxy_interfaces parameter, for network addresses that # are forwarded to us via a proxy or network address translator. #
# Note: you need to stop/start Postfix when this parameter changes. #
inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost
# Enable IPv4, and IPv6 if supported inet_protocols = all
# The proxy_interfaces parameter specifies the network interface # addresses that this mail system receives mail on by way of a # proxy or network address translation unit. This setting extends # the address list specified with the inet_interfaces parameter. #
# You must specify your proxy/NAT addresses when your system is a # backup MX host for other domains, otherwise mail delivery loops # will happen when the primary MX host is down.
#
#proxy_interfaces =
#proxy_interfaces = 1.2.3.4
# The mydestination parameter specifies the list of domains that this # machine considers itself the final destination for.
#
# These domains are routed to the delivery agent specified with the # local_transport parameter setting. By default, that is the UNIX
# gateway, you should also include $mydomain. #
# Do not specify the names of virtual domains - those domains are # specified elsewhere (see VIRTUAL_README).
#
# Do not specify the names of domains that this machine is backup MX # host for. Specify those names via the relay_domains settings for # the SMTP server, or use permit_mx_backup if you are lazy (see # STANDARD_CONFIGURATION_README).
#
# The local machine is always the final destination for mail addressed # to user@[the.net.work.address] of an interface that the mail system # receives mail on (see the inet_interfaces parameter).
#
# Specify a list of host or domain names, /file/name or type:table # patterns, separated by commas and/or whitespace. A /file/name # pattern is replaced by its contents; a type:table is matched when # a name matches a lookup key (the right-hand side is ignored). # Continue long lines by starting the next line with whitespace. #
# See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS". #
#mydestination = $myhostname, localhost.$mydomain, localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, # mail.$mydomain, www.$mydomain, ftp.$mydomain
# REJECTING MAIL FOR UNKNOWN LOCAL USERS #
# The local_recipient_maps parameter specifies optional lookup tables # with all names or addresses of users that are local with respect # to $mydestination, $inet_interfaces or $proxy_interfaces.
#
# If this parameter is defined, then the SMTP server will reject # mail for unknown local users. This parameter is defined by default. #
# To turn off local recipient checking in the SMTP server, specify # local_recipient_maps = (i.e. empty).
#
# The default setting assumes that you use the default Postfix local # delivery agent for local delivery. You need to update the
# local_recipient_maps setting if: #
#
# - You redefine the local delivery agent in master.cf. #
# - You redefine the "local_transport" setting in main.cf. #
# - You use the "luser_relay", "mailbox_transport", or "fallback_transport" # feature of the Postfix local delivery agent (see local(8)).
#
# Details are described in the LOCAL_RECIPIENT_README file. #
# Beware: if the Postfix SMTP server runs chrooted, you probably have # to access the passwd file via the proxymap service, in order to # overcome chroot restrictions. The alternative, having a copy of # the system passwd file in the chroot jail is just not practical. #
# The right-hand side of the lookup tables is conveniently ignored. # In the left-hand side, specify a bare username, an @domain.tld # wild-card, or specify a [email protected] address.
#
#local_recipient_maps = unix:passwd.byname $alias_maps #local_recipient_maps = proxy:unix:passwd.byname $alias_maps #local_recipient_maps =
# The unknown_local_recipient_reject_code specifies the SMTP server # response code when a recipient domain matches $mydestination or # ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty # and the recipient address or address local-part is not found. #
# The default setting is 550 (reject mail) but it is safer to start # with 450 (try again later) until you are certain that your
# local_recipient_maps settings are OK. #
unknown_local_recipient_reject_code = 550 # TRUST AND RELAY CONTROL
# The mynetworks parameter specifies the list of "trusted" SMTP # clients that have more privileges than "strangers".
#
# In particular, "trusted" SMTP clients are allowed to relay mail # through Postfix. See the smtpd_recipient_restrictions parameter # in postconf(5).
# clients in the same IP subnetworks as the local machine.
# On Linux, this does works correctly only with interfaces specified # with the "ifconfig" command.
#
# Specify "mynetworks_style = class" when Postfix should "trust" SMTP # clients in the same IP class A/B/C networks as the local machine. # Don't do this with a dialup site - it would cause Postfix to "trust" # your entire provider's network. Instead, specify an explicit
# mynetworks list by hand, as described below. #
# Specify "mynetworks_style = host" when Postfix should "trust" # only the local machine.
#
#mynetworks_style = class #mynetworks_style = subnet #mynetworks_style = host
# Alternatively, you can specify the mynetworks list by hand, in # which case Postfix ignores the mynetworks_style setting. #
# Specify an explicit list of network/netmask patterns, where the # mask specifies the number of bits in the network part of a host # address.
#
# You can also specify the absolute pathname of a pattern file instead # of listing the patterns here. Specify type:table for table-based lookups # (the value on the table right-hand side is not used).
#
mynetworks = 192.168.0.0/24, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks #mynetworks = hash:/etc/postfix/network_table
# The relay_domains parameter restricts what destinations this system will # relay mail to. See the smtpd_recipient_restrictions description in # postconf(5) for detailed information.
#
# By default, Postfix relays mail
# - from "trusted" clients (IP address matches $mynetworks) to any destination, # - from "untrusted" clients to destinations that match $relay_domains or # subdomains thereof, except addresses with sender-specified routing. # The default relay_domains value is $mydestination.
#
# - destinations that match $virtual_mailbox_domains.
# These destinations do not need to be listed in $relay_domains. #
# Specify a list of hosts or domains, /file/name patterns or type:name # lookup tables, separated by commas and/or whitespace. Continue # long lines by starting the next line with whitespace. A file name # is replaced by its contents; a type:name table is matched when a # (parent) domain appears as lookup key.
#
# NOTE: Postfix will not automatically forward mail for domains that # list this system as their primary or backup MX host. See the # permit_mx_backup restriction description in postconf(5). #
#relay_domains = $mydestination # INTERNET OR INTRANET
# The relayhost parameter specifies the default host to send mail to # when no entry is matched in the optional transport(5) table. When # no relayhost is given, mail is routed directly to the destination. #
# On an intranet, specify the organizational domain name. If your # internal DNS uses no MX records, specify the name of the intranet # gateway host instead.
#
# In the case of SMTP, specify a domain, host, host:port, [host]:port, # [address] or [address]:port; the form [host] turns off MX lookups. #
# If you're connected via UUCP, see also the default_transport parameter. # #relayhost = $mydomain #relayhost = [gateway.my.domain] #relayhost = [mailserver.isp.tld] #relayhost = uucphost #relayhost = [an.ip.add.ress] # REJECTING UNKNOWN RELAY USERS #
# The relay_recipient_maps parameter specifies optional lookup tables # with all addresses in the domains that match $relay_domains.
#
# If this parameter is defined, then the SMTP server will reject # mail for unknown relay users. This feature is off by default.
#
#relay_recipient_maps = hash:/etc/postfix/relay_recipients # INPUT RATE CONTROL
#
# The in_flow_delay configuration parameter implements mail input # flow control. This feature is turned on by default, although it # still needs further development (it's disabled on SCO UNIX due # to an SCO bug).
#
# A Postfix process will pause for $in_flow_delay seconds before # accepting a new message, when the message arrival rate exceeds the # message delivery rate. With the default 100 SMTP server process # limit, this limits the mail inflow to 100 messages a second more # than the number of messages delivered per second.
#
# Specify 0 to disable the feature. Valid delays are 0..10. #
#in_flow_delay = 1s # ADDRESS REWRITING #
# The ADDRESS_REWRITING_README document gives information about # address masquerading or other forms of address rewriting including # username->Firstname.Lastname mapping.
# ADDRESS REDIRECTION (VIRTUAL DOMAIN) #
# The VIRTUAL_README document gives information about the many forms # of domain hosting that Postfix supports.
# "USER HAS MOVED" BOUNCE MESSAGES #
# See the discussion in the ADDRESS_REWRITING_README document. # TRANSPORT MAP
#
# See the discussion in the ADDRESS_REWRITING_README document. # ALIAS DATABASE
#
# The alias_maps parameter specifies the list of alias databases used # by the local delivery agent. The default list is system dependent.
#
# If you change the alias database, run "postalias /etc/aliases" (or # wherever your system stores the mail alias file), or simply run # "newaliases" to build the necessary DBM or DB file.
#
# It will take a minute or so before changes become visible. Use # "postfix reload" to eliminate the delay.
#
#alias_maps = dbm:/etc/aliases alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases #alias_maps = netinfo:/aliases
# The alias_database parameter specifies the alias database(s) that # are built with "newaliases" or "sendmail -bi". This is a separate # configuration parameter, because alias_maps (see above) may specify # tables that are not necessarily all under control by Postfix. #
#alias_database = dbm:/etc/aliases #alias_database = dbm:/etc/mail/aliases alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases # ADDRESS EXTENSIONS (e.g., user+foo)
#
# The recipient_delimiter parameter specifies the separator between # user names and address extensions (user+foo). See canonical(5), # local(8), relocated(5) and virtual(5) for the effects this has on # aliases, canonical, virtual, relocated and .forward file lookups. # Basically, the software tries user+foo and .forward+foo before # trying user and .forward.
#
#recipient_delimiter = + # DELIVERY TO MAILBOX #
# The home_mailbox parameter specifies the optional pathname of a # mailbox file relative to a user's home directory. The default # mailbox file is /var/spool/mail/user or /var/mail/user. Specify # "Maildir/" for qmail-style delivery (the / is required).
#
#home_mailbox = Mailbox
#
#mail_spool_directory = /var/mail #mail_spool_directory = /var/spool/mail
# The mailbox_command parameter specifies the optional external # command to use instead of mailbox delivery. The command is run as # the recipient with proper HOME, SHELL and LOGNAME environment settings. # Exception: delivery for root is done as $default_user.
#
# Other environment variables of interest: USER (recipient username), # EXTENSION (address extension), DOMAIN (domain part of address), # and LOCAL (the address localpart).
#
# Unlike other Postfix configuration parameters, the mailbox_command # parameter is not subjected to $parameter substitutions. This is to # make it easier to specify shell syntax (see example below).
#
# Avoid shell meta characters because they will force Postfix to run # an expensive shell process. Procmail alone is expensive enough. #
# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN # ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
#
#mailbox_command = /some/where/procmail
#mailbox_command = /some/where/procmail -a "$EXTENSION"
# The mailbox_transport specifies the optional transport in master.cf # to use after processing aliases and .forward files. This parameter # has precedence over the mailbox_command, fallback_transport and # luser_relay parameters.
#
# Specify a string of the form transport:nexthop, where transport is # the name of a mail delivery transport defined in master.cf. The # :nexthop part is optional. For more details see the sample transport # configuration file.
#
# NOTE: if you use this feature for accounts not in the UNIX password # file, then you must update the "local_recipient_maps" setting in # the main.cf file, otherwise the SMTP server will reject mail for # non-UNIX accounts with "User unknown in local recipient table". #
#
# mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp #
# The efficiency of LMTP delivery for cyrus-imapd can be enhanced via # these settings.
#
# local_destination_recipient_limit = 300 # local_destination_concurrency_limit = 5 #
# Of course you should adjust these settings as appropriate for the # capacity of the hardware you are using. The recipient limit setting # can be used to take advantage of the single instance message store # capability of Cyrus. The concurrency limit can be used to control # how many simultaneous LMTP sessions will be permitted to the Cyrus # message store.
#
# To use the old cyrus deliver program you have to set: #mailbox_transport = cyrus
# The fallback_transport specifies the optional transport in master.cf # to use for recipients that are not found in the UNIX passwd database. # This parameter has precedence over the luser_relay parameter.
#
# Specify a string of the form transport:nexthop, where transport is # the name of a mail delivery transport defined in master.cf. The # :nexthop part is optional. For more details see the sample transport # configuration file.
#
# NOTE: if you use this feature for accounts not in the UNIX password # file, then you must update the "local_recipient_maps" setting in # the main.cf file, otherwise the SMTP server will reject mail for # non-UNIX accounts with "User unknown in local recipient table". #
#fallback_transport = lmtp:unix:/var/lib/imap/socket/lmtp #fallback_transport =
# The luser_relay parameter specifies an optional destination address # for unknown recipients. By default, mail for unknown@$mydestination, # unknown@[$inet_interfaces] or unknown@[$proxy_interfaces] is returned # as undeliverable.
#
# The following expansions are done on luser_relay: $user (recipient # username), $shell (recipient shell), $home (recipient home directory),
#
# luser_relay works only for the default Postfix local delivery agent. #
# NOTE: if you use this feature for accounts not in the UNIX password # file, then you must specify "local_recipient_maps =" (i.e. empty) in # the main.cf file, otherwise the SMTP server will reject mail for # non-UNIX accounts with "User unknown in local recipient table". #
#luser_relay = [email protected] #luser_relay = [email protected] #luser_relay = admin+$local # JUNK MAIL CONTROLS
#
# The controls listed here are only a very small subset. The file # SMTPD_ACCESS_README provides an overview.
# The header_checks parameter specifies an optional table with patterns # that each logical message header is matched against, including
# headers that span multiple physical lines. #
# By default, these patterns also apply to MIME headers and to the # headers of attached messages. With older Postfix versions, MIME and # attached message headers were treated as body text.
#
# For details, see "man header_checks". #
#header_checks = regexp:/etc/postfix/header_checks # FAST ETRN SERVICE
#
# Postfix maintains per-destination logfiles with information about # deferred mail, so that mail can be flushed quickly with the SMTP # "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld". # See the ETRN_README document for a detailed description.
#
# The fast_flush_domains parameter controls what destinations are # eligible for this service. By default, they are all domains that # this server is willing to relay mail to.
#
#fast_flush_domains = $relay_domains # SHOW SOFTWARE VERSION OR NOT
#
# You MUST specify $myhostname at the start of the text. That is an # RFC requirement. Postfix itself does not care.
#
#smtpd_banner = $myhostname ESMTP $mail_name
#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) # PARALLEL DELIVERY TO THE SAME DESTINATION
#
# How many parallel deliveries to the same user or domain? With local # delivery, it does not make sense to do massively parallel delivery # to the same user, because mailbox updates must happen sequentially, # and expensive pipelines in .forward files can cause disasters when # too many are run at the same time. With SMTP deliveries, 10
# simultaneous connections to the same domain could be sufficient to # raise eyebrows.
#
# Each message delivery transport has its XXX_destination_concurrency_limit # parameter. The default is $default_destination_concurrency_limit for # most delivery transports. For the local delivery agent the default is 2. #local_destination_concurrency_limit = 2
#default_destination_concurrency_limit = 20 # DEBUGGING CONTROL
#
# The debug_peer_level parameter specifies the increment in verbose # logging level when an SMTP client or server host name or address # matches a pattern in the debug_peer_list parameter.
#
debug_peer_level = 2
# The debug_peer_list parameter specifies an optional list of domain # or network patterns, /file/name patterns or type:name tables. When # an SMTP client or server host name or address matches a pattern, # increase the verbose logging level by the amount specified in the # debug_peer_level parameter.
#
#debug_peer_list = 127.0.0.1 #debug_peer_list = some.domain
# The debugger_command specifies the external command that is executed # when a Postfix daemon program is run with the -D option.
#
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5 # If you can't use X, use this to capture the call stack when a # daemon crashes. The result is in a file in the configuration # directory, and is named after the process name and the process ID. #
# debugger_command =
# PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;
# echo where) | gdb $daemon_directory/$process_name $process_id 2>&1 # >$config_directory/$process_name.$process_id.log & sleep 5
#
# Another possibility is to run gdb under a detached screen session. # To attach to the screen sesssion, su root and run "screen -r
# <id_string>" where <id_string> uniquely matches one of the detached # sessions (from "screen -list").
#
# debugger_command =
# PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; screen # -dmS $process_name gdb $daemon_directory/$process_name # $process_id & sleep 1
# INSTALL-TIME CONFIGURATION INFORMATION #
# The following parameters are used when installing a new Postfix version. #
# sendmail_path: The full pathname of the Postfix sendmail command. # This is the Sendmail-compatible mail posting interface.
#
sendmail_path = /usr/sbin/sendmail.postfix
# newaliases_path: The full pathname of the Postfix newaliases command. # This is the Sendmail-compatible command to build alias databases. #
newaliases_path = /usr/bin/newaliases.postfix
# mailq_path: The full pathname of the Postfix mailq command. This # is the Sendmail-compatible mail queue listing command.
#
setgid_group = postdrop
# html_directory: The location of the Postfix HTML documentation. #
html_directory = no
# manpage_directory: The location of the Postfix on-line manual pages. #
manpage_directory = /usr/share/man
# sample_directory: The location of the Postfix sample configuration files. # This parameter is obsolete as of Postfix 2.1.
#
sample_directory = /usr/share/doc/postfix-2.6.6/samples # readme_directory: The location of the Postfix README files. #
付録資料②
## Dovecot configuration file
# If you're in a hurry, see http://wiki.dovecot.org/QuickConfiguration # "doveconf -n" command gives a clean output of the changed settings. Use it # instead of copy&pasting files when posting to the Dovecot mailing list. # '#' character and everything after it is treated as comments. Extra spaces # and tabs are ignored. If you want to use either of these explicitly, put the # value inside quotes, eg.: key = "# char and trailing whitespace "
# Default values are shown for each setting, it's not required to uncomment # those. These are exceptions to this though: No sections (e.g. namespace {}) # or plugin settings are added by default, they're listed only as examples. # Paths are also just examples with the real defaults being based on configure # options. The paths listed here are for configure --prefix=/usr
# --sysconfdir=/etc --localstatedir=/var # Protocols we want to be serving. #protocols = imap pop3 lmtp
protocols = imap pop3
# A comma separated list of IPs or hosts where to listen in for connections. # "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces. # If you want to specify non-default ports or anything more complex, # edit conf.d/master.conf.
#listen = *, ::
# Base directory where to store runtime data. #base_dir = /var/run/dovecot/
# Greeting message for clients. #login_greeting = Dovecot ready.
# Space separated list of trusted network ranges. Connections from these # IPs are allowed to override their IP addresses and ports (for logging and # for authentication checks). disable_plaintext_auth is also ignored for # these networks. Typically you'd specify your IMAP proxy servers here. #login_trusted_networks =
# Sepace separated list of login access check sockets (e.g. tcpwrap) #login_access_sockets =
# Should all processes be killed when Dovecot master process shuts down. # Setting this to "no" means that Dovecot can be upgraded without
# forcing existing client connections to close (although that could also be # a problem if the upgrade is e.g. because of a security fix).
#shutdown_clients = yes
# If non-zero, run mail commands via this many connections to doveadm server, # instead of running them directly in the same process.
#doveadm_worker_count = 0
# UNIX socket or host:port used for connecting to doveadm server #doveadm_socket_path = doveadm-server
##
## Dictionary server settings ##
# Dictionary can be used to store key=value lists. This is used by several # plugins. The dictionary can be accessed either directly or though a # dictionary server. The following dict block maps dictionary names to URIs # when the server is used. These can then be referenced using URIs in format # "proxy::<name>".
dict {
#quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext }
# Most of the actual configuration gets included below. The filenames are # first sorted by their ASCII value and parsed in that order. The 00-prefixes # in filenames are intended to make it easier to understand the ordering. !include conf.d/*.conf
# A config file can also tried to be included without giving an error if # it's not found:
付録資料③
##
## Mailbox locations and namespaces ##
# Location for users' mailboxes. The default is empty, which means that Dovecot # tries to find the mailboxes automatically. This won't work if the user
# doesn't yet have any mail, so you should explicitly tell Dovecot the full # location.
#
# If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u) # isn't enough. You'll also need to tell Dovecot where the other mailboxes are # kept. This is called the "root mail directory", and it must be the first # path given in the mail_location setting.
#
# There are a few special variables you can use, eg.: #
# %u - username
# %n - user part in user@domain, same as %u if there's no domain # %d - domain part in user@domain, empty if there's no domain # %h - home directory
#
# See doc/wiki/Variables.txt for full list. Some examples: # # mail_location = maildir:~/Maildir # mail_location = mbox:~/mail:INBOX=/var/mail/%u # mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n # # <doc/wiki/MailLocation.txt> # #mail_location = mail_location = maildir:~/Maildir
# If you need to set multiple mailbox locations or want to change default # namespace settings, you can do it by defining namespace sections. #
# You can have private, shared and public namespaces. Private namespaces # are for user's personal mails. Shared namespaces are for accessing other # users' mailboxes that have been shared. Public namespaces are for shared # mailboxes that are managed by sysadmin. If you create any shared or public # namespaces you'll typically want to enable ACL plugin also, otherwise all # users can access all the shared mailboxes, assuming they have permissions # on filesystem level to do so.