Postfix
更新中
Postfixとは
Sendmailの代替として開発され、セキュリティ、パフォーマンス、柔軟性を重視して設計 Postfixのアーキテクチャ(プロセス)
master: Postfixの親プロセスであり、他のデーモンを起動・監視
smtpd: SMTPプロトコルを使用して外部からのメール受信を処理
qmgr: キューマネージャーであり、メールキューの管理とメールの配送を調整
pickup: ローカルユーザーからのメールをキューに投入
cleanup: メールヘッダーの正規化やアドレスの書き換えなどを行う
配送エージェント
local: ローカルユーザーへのメール配送を処理
smtp: 外部へのメール送信を処理
pipe: コマンドへの配送を処理
virtual: バーチャルホスト用のメールボックスへの配送を処理
Postfixのファイル
Postfixのログ /var/log/maillogの見方
Postfixの動作を記録したログファイル。メールの送受信トラブルの調査に不可欠。
ログは /var/log/maillog または /var/log/mail.log にある。
ログの基本フォーマット
タイムスタンプ ホスト名 プロセス名[PID]: メッセージ
キューID (Queue ID) を見つけ、同じIDを持つログを追うのが基本。 図解
/icons/hr.icon
受信時
code:mmd
graph TD
D --> E{配送先は?};
K --> C;
subgraph Postfixシステム
direction LR
subgraph メールフロー
B
K
C
D
E
F
G
L
end
end
Master -.-> B
Master -.-> K
Master -.-> D
%% Postfixシステムのコンポーネントを青色で強調
classDef postfix_component fill:#d6eaff,stroke:#004080,stroke-width:2px
class Master,B,C,D,K,F,G postfix_component
%% 外部/終端ノードをピンク色で表現
classDef external_entity fill:#f9f,stroke:#333,stroke-width:2px
class A,J,H,I,M external_entity
/icons/hr.icon
送信時
code:mmd
graph TD
%% メール送信の開始点
subgraph Postfixシステム
direction LR
D --> E{配送先は?};
Master -.-> D
Master -.-> G
end
classDef postfix_component fill:#d6eaff,stroke:#004080,stroke-width:2px;
class Master,K,C,D,F,G postfix_component;
classDef external_entity fill:#f9f,stroke:#333,stroke-width:2px;
class A,H,I,M external_entity;
/icons/hr.icon
メール送信フロー(外部。例:Gmail)
code:mmd
flowchart TD
subgraph "送信元 (test@example.com)"
end
B --> C
subgraph "Postfix System"
D -- "2. ヘッダ/本文を正規化" --> E(incoming Queue)
E -- "3. キューイング" --> Fqmgr F -- "4. 配送先(外部)を判断しsmtpを起動" --> Gsmtp end
subgraph "宛先 (user@gmail.com)"
G -- "5. DNSにMXレコードを問い合わせ" --> H((DNS Server))
H -- "6. MXレコードを返却" --> G
end