開始行:
#html{{
<h1 style="color: red; background-color: #FFFFCC; padding...
Postfix(ポストフィックス)
</h1>
<div class="alert alert-warning" role="alert">
Postfix(ポストフィックス)は、メールの転送を目的としたオ...
メール転送エージェント(MTA)の一種で、Unix系のOSに対応し...
</div>
}}
//----------------------------------------
#contents
//----------------------------------------
//----------------------------------------
// 用語の定義
* Postfix(ポストフィックス)とは? [#definition]
メール送信用の[[メールサーバー]]の1つ。
Postfixにはメールの受信機能はありません。
メール受信のために、[[Dovecot]]と一緒によく使われています。
- Postfix - Google 検索
https://www.google.co.jp/search?q=Postfix
- Postfix - Wikipedia
https://ja.wikipedia.org/wiki/Postfix
>Postfix(ポストフィックス)は自由ソフトウェア・オープン...
先行して開発されていたSendmailとの操作上の互換性を確保し...
** 公式サイト [#k892ae55]
- The Postfix Home Page
https://www.postfix.org/
** 非公式サイト [#q7b608c3]
- GitHub - vdukhovni/postfix: Postfix MTA by Wietse Venema
https://github.com/vdukhovni/postfix
- Postfixのぺーじ
https://postfix-jp.info/
//----------------------------------------
* インストール [#m0965a48]
Ubuntu 24.04 LTSにPostfixをインストールするメモ。
** 参考 [#q114b502]
- Postfix インストール - Google 検索
https://www.google.co.jp/search?q=Postfix+%E3%82%A4%E3%83...
** aptコマンドでインストールできるバージョンの確認方法 [#...
Ubuntu 24.04 LTS において ''apt'' コマンドでインストール...
*** 方法1: ''apt show'' コマンドを使用する [#y79f817b]
apt show postfix
このコマンドを実行すると、''Version:'' の行にインストール...
出力例
Package: postfix
Version: 3.8.6-1build2
Priority: optional
Section: mail
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@list...
Original-Maintainer: LaMont Jones <lamont@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 4,195 kB
Provides: default-mta, mail-transport-agent
Pre-Depends: init-system-helpers (>= 1.54~)
Depends: adduser (>= 3.48), cpio, dpkg (>= 1.8.3), e2fsp...
Recommends: ca-certificates, python3
Suggests: libsasl2-modules | dovecot-common, mail-reader...
Conflicts: mail-transport-agent, smail
Replaces: mail-transport-agent
Homepage: https://www.postfix.org
Task: mail-server
Download-Size: 1,254 kB
APT-Sources: http://jp.archive.ubuntu.com/ubuntu noble/m...
Description: High-performance mail transport agent
Postfix is Wietse Venema's mail transport agent that st...
alternative to the widely-used Sendmail program. Postf...
be fast, easy to administer, and secure, while at the s...
sendmail compatible enough to not upset existing users....
has a sendmail-ish flavor, but the inside is completely...
*** 方法2: ''apt-cache policy'' コマンドを使用する [#q176...
apt-cache policy postfix
このコマンドを実行すると、以下のような出力が得られます。
出力例
postfix:
Installed: (none)
Candidate: 3.8.6-1build2
Version table:
3.8.6-1build2 500
500 http://jp.archive.ubuntu.com/ubuntu noble/ma...
''Candidate:'' に表示されているバージョンが、現在 ''apt''...
*** 方法3: ''apt list'' コマンドを使用する [#i4d00860]
apt list postfix
このコマンドを実行すると、次のような出力が得られます。
出力例
Listing... Done
postfix/noble 3.8.6-1build2 amd64
ここで ''3.8.6-1build2'' の部分が、インストールできるバー...
*** 方法4: ''apt-cache madison'' コマンドを使用する [#t5c...
apt-cache madison postfix
このコマンドでは、利用可能なすべてのバージョンが表示され...
出力例
postfix | 3.8.6-1build2 | http://jp.archive.ubuntu.com/u...
---
これらの方法で、Ubuntu 24.04 LTS で利用可能な Postfix の...
//----------------------------------------
* Ubuntu 24.04 に Postfix をインストールする方法 [#q1ed0c...
Ubuntu 24.04 で ''apt'' コマンドを使用して Postfix をイン...
** 1. システムの更新 [#d7920d16]
まず、パッケージリストを最新の状態に更新します。
sudo apt update
sudo apt upgrade -y
** 2. Postfix のインストール [#pe72ca01]
次に、Postfix をインストールします。
sudo apt install -y postfix
出力例
$ sudo apt install postfix
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libnsl2
Suggested packages:
mail-reader postfix-cdb postfix-doc postfix-ldap postf...
postfix-mta-sts-resolver postfix-mysql postfix-pcre po...
procmail sasl2-bin | dovecot-common
The following NEW packages will be installed:
libnsl2 postfix
0 upgraded, 2 newly installed, 0 to remove and 1 not upg...
Need to get 1,296 kB of archives.
After this operation, 4,321 kB of additional disk space ...
Do you want to continue? [Y/n] →Yと入力する。
** 3. インストール時の設定 [#qc9d3d11]
Postfix のインストール中に、Postfix Configuration のウィ...
以下のような設定オプションが選択できます。
*** メイン設定タイプの選択 [#db097c4d]
「Postfix Configuration」のプロンプトが表示されたら、以下...
- Internet Site(インターネット向けのメールサーバー)
- Smarthost(別のSMTPサーバーをリレーとして利用)
- Local only(ローカルネットワーク内のみで使用)
通常のメールサーバーとして使用する場合は、''Internet Site...
#ref(./Postfix_Package_configuration_Q1.png,800x)
~
-操作方法
-- OK:大文字の「O」を入力する ''「Shift」+「o」''
-- Cancel:大文字の「C」を入力する ''「Shift」+「c」''
-- 矢印キー「↑」、「↓」で選択肢を移動する
-- TABキーで選択肢を移動する
-- スペースキーで選択した状態にする
-- Enterキーで決定する
などで、この画面をキーボードで操作できます。
*** メール送信元の設定 [#z86870e2]
次に、System mail name(システムのメール名)を設定します...
デフォルトではホスト名が設定されますが、適宜 ''example.co...
#ref(./Postfix_Package_configuration_Q2.png,800x)
~
「myname @ mydomain.net」というメールアドレスを使いたい場...
** 4. Postfix の設定確認 [#p13d6ef0]
Postfix の設定ファイルは ''/etc/postfix/main.cf'' です。
インストール後、設定を確認し、必要に応じて修正してくださ...
*** Postfixの設定ファイルのバックアップ [#wc319510]
''main.cf'' を編集する前にバックアップを取っておきます。
万が一、設定ミスが発生した場合でも、バックアップから元の...
- バックアップの方法
以下のコマンドを実行すると、現在の ''main.cf'' のバックア...
sudo cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
これにより、''/etc/postfix/main.cf.bak'' というバックアッ...
以下のコマンドでバックアップファイルが作成されたか目視確...
ls -l /etc/postfix
- バックアップをリストア(復元)する方法
もし設定を変更した後に問題が発生した場合は、以下のコマン...
sudo cp /etc/postfix/main.cf.bak /etc/postfix/main.cf
その後、Postfix を再起動して変更を適用します。
sudo systemctl restart postfix
- 変更内容を確認する方法
''diff'' コマンドを使用すると、元の設定と編集後の設定の違...
diff /etc/postfix/main.cf /etc/postfix/main.cf.bak
*** Postfixの設定ファイルの編集 [#gd03d68b]
sudo nano /etc/postfix/main.cf
以下の項目を確認・編集してください。
ini
myhostname = mail.example.com # SMTPサーバーのFQDN(ホ...
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
設定を変更した場合は、Postfix を再起動します。
sudo systemctl restart postfix
** 5. Postfix の動作確認 [#u14d5d3e]
インストール後、Postfix のステータスを確認して、正常に動...
sudo systemctl status postfix
''Active: active (running)'' という表示が出ていれば正常に...
また、ポート 25 が開いているかを確認するには、以下のコマ...
sudo netstat -tulnp | grep :25
または、
sudo ss -tulnp | grep :25
** 6. 簡単なメール送信テスト [#kdc04e8a]
ローカルでメールを送信して動作を確認できます。
echo "Postfix テストメール" | mail -s "テストメール" ユ...
** 7. Postfix のログ確認 [#ce4a8bc1]
メールの送受信で問題が発生した場合は、ログを確認します。
sudo journalctl -u postfix --no-pager
または、
sudo tail -f /var/log/mail.log
以上で、Ubuntu 24.04 に Postfix をインストールする手順は...
//----------------------------------------
// *Amazon [#amazon]
#html{{
}}
//----------------------------------------
* 関連 [#m39471c0]
//----------------------------------------
-[[メールサーバー]]
-[[Dovecot]]
終了行:
#html{{
<h1 style="color: red; background-color: #FFFFCC; padding...
Postfix(ポストフィックス)
</h1>
<div class="alert alert-warning" role="alert">
Postfix(ポストフィックス)は、メールの転送を目的としたオ...
メール転送エージェント(MTA)の一種で、Unix系のOSに対応し...
</div>
}}
//----------------------------------------
#contents
//----------------------------------------
//----------------------------------------
// 用語の定義
* Postfix(ポストフィックス)とは? [#definition]
メール送信用の[[メールサーバー]]の1つ。
Postfixにはメールの受信機能はありません。
メール受信のために、[[Dovecot]]と一緒によく使われています。
- Postfix - Google 検索
https://www.google.co.jp/search?q=Postfix
- Postfix - Wikipedia
https://ja.wikipedia.org/wiki/Postfix
>Postfix(ポストフィックス)は自由ソフトウェア・オープン...
先行して開発されていたSendmailとの操作上の互換性を確保し...
** 公式サイト [#k892ae55]
- The Postfix Home Page
https://www.postfix.org/
** 非公式サイト [#q7b608c3]
- GitHub - vdukhovni/postfix: Postfix MTA by Wietse Venema
https://github.com/vdukhovni/postfix
- Postfixのぺーじ
https://postfix-jp.info/
//----------------------------------------
* インストール [#m0965a48]
Ubuntu 24.04 LTSにPostfixをインストールするメモ。
** 参考 [#q114b502]
- Postfix インストール - Google 検索
https://www.google.co.jp/search?q=Postfix+%E3%82%A4%E3%83...
** aptコマンドでインストールできるバージョンの確認方法 [#...
Ubuntu 24.04 LTS において ''apt'' コマンドでインストール...
*** 方法1: ''apt show'' コマンドを使用する [#y79f817b]
apt show postfix
このコマンドを実行すると、''Version:'' の行にインストール...
出力例
Package: postfix
Version: 3.8.6-1build2
Priority: optional
Section: mail
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@list...
Original-Maintainer: LaMont Jones <lamont@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 4,195 kB
Provides: default-mta, mail-transport-agent
Pre-Depends: init-system-helpers (>= 1.54~)
Depends: adduser (>= 3.48), cpio, dpkg (>= 1.8.3), e2fsp...
Recommends: ca-certificates, python3
Suggests: libsasl2-modules | dovecot-common, mail-reader...
Conflicts: mail-transport-agent, smail
Replaces: mail-transport-agent
Homepage: https://www.postfix.org
Task: mail-server
Download-Size: 1,254 kB
APT-Sources: http://jp.archive.ubuntu.com/ubuntu noble/m...
Description: High-performance mail transport agent
Postfix is Wietse Venema's mail transport agent that st...
alternative to the widely-used Sendmail program. Postf...
be fast, easy to administer, and secure, while at the s...
sendmail compatible enough to not upset existing users....
has a sendmail-ish flavor, but the inside is completely...
*** 方法2: ''apt-cache policy'' コマンドを使用する [#q176...
apt-cache policy postfix
このコマンドを実行すると、以下のような出力が得られます。
出力例
postfix:
Installed: (none)
Candidate: 3.8.6-1build2
Version table:
3.8.6-1build2 500
500 http://jp.archive.ubuntu.com/ubuntu noble/ma...
''Candidate:'' に表示されているバージョンが、現在 ''apt''...
*** 方法3: ''apt list'' コマンドを使用する [#i4d00860]
apt list postfix
このコマンドを実行すると、次のような出力が得られます。
出力例
Listing... Done
postfix/noble 3.8.6-1build2 amd64
ここで ''3.8.6-1build2'' の部分が、インストールできるバー...
*** 方法4: ''apt-cache madison'' コマンドを使用する [#t5c...
apt-cache madison postfix
このコマンドでは、利用可能なすべてのバージョンが表示され...
出力例
postfix | 3.8.6-1build2 | http://jp.archive.ubuntu.com/u...
---
これらの方法で、Ubuntu 24.04 LTS で利用可能な Postfix の...
//----------------------------------------
* Ubuntu 24.04 に Postfix をインストールする方法 [#q1ed0c...
Ubuntu 24.04 で ''apt'' コマンドを使用して Postfix をイン...
** 1. システムの更新 [#d7920d16]
まず、パッケージリストを最新の状態に更新します。
sudo apt update
sudo apt upgrade -y
** 2. Postfix のインストール [#pe72ca01]
次に、Postfix をインストールします。
sudo apt install -y postfix
出力例
$ sudo apt install postfix
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libnsl2
Suggested packages:
mail-reader postfix-cdb postfix-doc postfix-ldap postf...
postfix-mta-sts-resolver postfix-mysql postfix-pcre po...
procmail sasl2-bin | dovecot-common
The following NEW packages will be installed:
libnsl2 postfix
0 upgraded, 2 newly installed, 0 to remove and 1 not upg...
Need to get 1,296 kB of archives.
After this operation, 4,321 kB of additional disk space ...
Do you want to continue? [Y/n] →Yと入力する。
** 3. インストール時の設定 [#qc9d3d11]
Postfix のインストール中に、Postfix Configuration のウィ...
以下のような設定オプションが選択できます。
*** メイン設定タイプの選択 [#db097c4d]
「Postfix Configuration」のプロンプトが表示されたら、以下...
- Internet Site(インターネット向けのメールサーバー)
- Smarthost(別のSMTPサーバーをリレーとして利用)
- Local only(ローカルネットワーク内のみで使用)
通常のメールサーバーとして使用する場合は、''Internet Site...
#ref(./Postfix_Package_configuration_Q1.png,800x)
~
-操作方法
-- OK:大文字の「O」を入力する ''「Shift」+「o」''
-- Cancel:大文字の「C」を入力する ''「Shift」+「c」''
-- 矢印キー「↑」、「↓」で選択肢を移動する
-- TABキーで選択肢を移動する
-- スペースキーで選択した状態にする
-- Enterキーで決定する
などで、この画面をキーボードで操作できます。
*** メール送信元の設定 [#z86870e2]
次に、System mail name(システムのメール名)を設定します...
デフォルトではホスト名が設定されますが、適宜 ''example.co...
#ref(./Postfix_Package_configuration_Q2.png,800x)
~
「myname @ mydomain.net」というメールアドレスを使いたい場...
** 4. Postfix の設定確認 [#p13d6ef0]
Postfix の設定ファイルは ''/etc/postfix/main.cf'' です。
インストール後、設定を確認し、必要に応じて修正してくださ...
*** Postfixの設定ファイルのバックアップ [#wc319510]
''main.cf'' を編集する前にバックアップを取っておきます。
万が一、設定ミスが発生した場合でも、バックアップから元の...
- バックアップの方法
以下のコマンドを実行すると、現在の ''main.cf'' のバックア...
sudo cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
これにより、''/etc/postfix/main.cf.bak'' というバックアッ...
以下のコマンドでバックアップファイルが作成されたか目視確...
ls -l /etc/postfix
- バックアップをリストア(復元)する方法
もし設定を変更した後に問題が発生した場合は、以下のコマン...
sudo cp /etc/postfix/main.cf.bak /etc/postfix/main.cf
その後、Postfix を再起動して変更を適用します。
sudo systemctl restart postfix
- 変更内容を確認する方法
''diff'' コマンドを使用すると、元の設定と編集後の設定の違...
diff /etc/postfix/main.cf /etc/postfix/main.cf.bak
*** Postfixの設定ファイルの編集 [#gd03d68b]
sudo nano /etc/postfix/main.cf
以下の項目を確認・編集してください。
ini
myhostname = mail.example.com # SMTPサーバーのFQDN(ホ...
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
設定を変更した場合は、Postfix を再起動します。
sudo systemctl restart postfix
** 5. Postfix の動作確認 [#u14d5d3e]
インストール後、Postfix のステータスを確認して、正常に動...
sudo systemctl status postfix
''Active: active (running)'' という表示が出ていれば正常に...
また、ポート 25 が開いているかを確認するには、以下のコマ...
sudo netstat -tulnp | grep :25
または、
sudo ss -tulnp | grep :25
** 6. 簡単なメール送信テスト [#kdc04e8a]
ローカルでメールを送信して動作を確認できます。
echo "Postfix テストメール" | mail -s "テストメール" ユ...
** 7. Postfix のログ確認 [#ce4a8bc1]
メールの送受信で問題が発生した場合は、ログを確認します。
sudo journalctl -u postfix --no-pager
または、
sudo tail -f /var/log/mail.log
以上で、Ubuntu 24.04 に Postfix をインストールする手順は...
//----------------------------------------
// *Amazon [#amazon]
#html{{
}}
//----------------------------------------
* 関連 [#m39471c0]
//----------------------------------------
-[[メールサーバー]]
-[[Dovecot]]
ページ名: