Fedora13 postfix
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
] [
Trackback(0)
]
開始行:
#contents
*sendmailの停止 [#cb76acc7]
# /etc/rc.d/init.d/sendmail stop
sm-client を停止中: ...
sendmail を停止中: ...
# /sbin/chkconfig sendmail off
# /sbin/chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off ...
*postfixのインストール [#v47d51e9]
-インストール
# yum -y install postfix
-メール環境の切り替え
# alternatives --config mta
2 プログラムがあり 'mta' を提供します。
選択 コマンド
-----------------------------------------------
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix
Enter を押して現在の選択 [+] を保持するか、選択番号を入...
#br
# ls -la /etc/alternatives/ | grep mta
lrwxrwxrwx. 1 root root 26 2010-07-07 18:10 mta -> ...
lrwxrwxrwx. 1 root root 40 2010-07-07 18:10 mta-ali...
lrwxrwxrwx. 1 root root 22 2010-07-07 18:10 mta-mai...
lrwxrwxrwx. 1 root root 38 2010-07-07 18:10 mta-mai...
lrwxrwxrwx. 1 root root 27 2010-07-07 18:10 mta-new...
lrwxrwxrwx. 1 root root 43 2010-07-07 18:10 mta-new...
lrwxrwxrwx. 1 root root 23 2010-07-07 18:10 mta-pam...
lrwxrwxrwx. 1 root root 22 2010-07-07 18:10 mta-rma...
lrwxrwxrwx. 1 root root 25 2010-07-07 18:10 mta-sen...
lrwxrwxrwx. 1 root root 41 2010-07-07 18:10 mta-sen...
-自動起動するようにする
# /sbin/chkconfig --level 35 postfix on
# /sbin/chkconfig --list | grep postfix
postfix 0:off 1:off 2:off 3:on 4:off ...
-iptables の 25 番ポートをあけます
$ sudo /usr/bin/system-config-firewall
#ref(iptables25.png)
*/etc/postfix/main.cf の変更 [#n7a4d7dc]
-変更後と変更前の差分を見てみる
# diff -u main.cf.original main.cf
--- main.cf.original 2010-07-07 22:29:21.647280593 +0...
+++ main.cf 2010-07-07 22:43:23.115277889 +0900
-サーバのホスト名
@@ -74,6 +74,7 @@
#
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
+myhostname = orange.hondou.homedns.org
# The mydomain parameter specifies the local internet d...
# The default is to use $myhostname minus the first com...
-ドメイン名
@@ -81,6 +82,7 @@
# parameters.
#
#mydomain = domain.tld
+mydomain = hondou.homedns.org
# SENDING MAIL
#
-メール送信時につけるドメイン名
@@ -96,7 +98,7 @@
# to recipient addresses that have no @domain part.
#
#myorigin = $myhostname
-#myorigin = $mydomain
+myorigin = $mydomain
# RECEIVING MAIL
-SMTPを受け付けるインタフェースを全てのインタフェースにす...
@@ -110,10 +112,10 @@
#
# Note: you need to stop/start Postfix when this parame...
#
-#inet_interfaces = all
+inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
-inet_interfaces = localhost
+#inet_interfaces = localhost
# Enable IPv4, and IPv6 if supported
inet_protocols = all
-MTA(送信元)をLAN内からだけにする
@@ -161,8 +163,8 @@
#
# See also below, section "REJECTING MAIL FOR UNKNOWN L...
#
-mydestination = $myhostname, localhost.$mydomain, local...
-#mydestination = $myhostname, localhost.$mydomain, loca...
+#mydestination = $myhostname, localhost.$mydomain, loca...
+mydestination = $myhostname, localhost.$mydomain, local...
#mydestination = $myhostname, localhost.$mydomain, loca...
# mail.$mydomain, www.$mydomain, ftp.$mydomain
-LANの範囲を設定する
@@ -264,6 +266,7 @@
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table
+mynetworks = 192.168.1.0/24, 127.0.0.0/8, [::1]/128
IPv6 のアドレスを加えなきゃいけなくなった。時代はちょっと...
-メールの保存先を 各自のホームディレクトリ以下 (~/Maildir...
# The relay_domains parameter restricts what destinatio...
# relay mail to. See the smtpd_recipient_restrictions ...
@@ -416,7 +419,7 @@
# "Maildir/" for qmail-style delivery (the / is require...
#
#home_mailbox = Mailbox
-#home_mailbox = Maildir/
+home_mailbox = Maildir/
# The mail_spool_directory parameter specifies the dire...
# UNIX-style mailboxes are kept. The default setting de...
-最大送信サイズを 100MB にする
@@ -674,3 +677,17 @@
# readme_directory: The location of the Postfix README ...
#
readme_directory = /usr/share/doc/postfix-2.7.0/README_...
+
+# Size Limit (1GB / 100MB)
+mailbox_size_limit = 1073741824
+message_size_limit = 104857600
-OP25B対策 (Biglobe では 25 番ポートがブロックされている...
+
+# OP25B(Outbound Port 25 Blocking)
+relayhost = [msagw.biglobe.ne.jp]
+smtp_sasl_type = cyrus
+smtp_sasl_auth_enable = yes
+smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
+smtp_sasl_security_options = noanonymous
+smtp_sasl_mechanism_filter = cram_md5,plain,login
-以前の設定では送信元が逆引きできない場合には無視する
+# Reject any mail clients which has not host name. (Pe...
+smtpd_client_restrictions = permit_mynetworks,reject_un...
--デフォルト値は、permit_mynetworks, reject_unauth_destin...
--http://www.postfix-jp.info/trans-2.2/jhtml/postconf.5.h...
*プロバイダの中継サーバの認証情報を作成する [#s64aaffe]
# cd /etc/postfix/
# vi sasl_password
msagw.biglobe.ne.jp ※ユーザ名※:※パスワード※
# chmod 700 sasl_password
# postmap sasl_password
# ls | grep sasl
sasl_password
sasl_password.db
postfix からは sasl_password.db が使われる。&br;
#br
なお、SASL につかう cyrus は、既にインストールされていた
# yum list installed | grep cyrus
cyrus-sasl.i686 2.1.23-11.fc13 ...
cyrus-sasl-gssapi.i686 2.1.23-11.fc13 ...
cyrus-sasl-lib.i686 2.1.23-11.fc13 ...
cyrus-sasl-md5.i686 2.1.23-11.fc13 ...
cyrus-sasl-plain.i686 2.1.23-11.fc13 ...
*メールボックスの作成 [#k884e4d7]
-既存のユーザ&br;
こんな感じの Shell Script で Maildir を作成
# cat mkmailbox.sh
#!/bin/bash
for user in `ls /home/`
do
if [ $user != "lost+found" ]
then
HOMEDIR=/home/$user
mkdir -p $HOMEDIR/Maildir/new
mkdir -p $HOMEDIR/Maildir/cur
mkdir -p $HOMEDIR/Maildir/tmp
chown $user:$user -R $HOMEDIR/Maildir
chmod -R 700 $HOMEDIR/Maildir
fi
done
-新規ユーザ
--ひな形 (/etc/skel)
# mkdir -p /etc/skel/Maildir/new
# mkdir -p /etc/skel/Maildir/cur
# mkdir -p /etc/skel/Maildir/tmp
# chmod -R 700 /etc/skel/Maildir/
--メールユーザ(ログインできないユーザ)の作成
# useradd -s /sbin/nologin ※ユーザ名※
# passwd ※ユーザ名※
*設定の確認 [#meb7898f]
-postfix の起動
# /etc/init.d/postfix start
postfix を起動中: ...
-テストメールの送信 (EOT は Ctrl+D or .+Enter)
# mail kagyuu
Subject: TEST
MAIL TEST
EOT
-テストメールの受信確認
$ cat ~/Maildir/new/1278523187.Vfd02Ie80165M31567.orange...
Return-Path: <root@hondou.homedns.org>
X-Original-To: kagyuu
Delivered-To: kagyuu@hondou.homedns.org
Received: by orange.hondou.homedns.org (Postfix, from us...
id B0F17415F3; Thu, 8 Jul 2010 02:08:26 +0900 (...
Date: Thu, 08 Jul 2010 02:08:26 +0900
To: kagyuu@hondou.homedns.org
Subject: TEST
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <20100707170858.B0F17415F3@orange.hondou.hom...
From: root@hondou.homedns.org (root)
MAIL TEST
*セキュリティの確認 [#x9460130]
-http://www.rbl.jp/svcheck.php で、第三者転送ができないか...
----
[[Fedora 13 Server]]
終了行:
#contents
*sendmailの停止 [#cb76acc7]
# /etc/rc.d/init.d/sendmail stop
sm-client を停止中: ...
sendmail を停止中: ...
# /sbin/chkconfig sendmail off
# /sbin/chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off ...
*postfixのインストール [#v47d51e9]
-インストール
# yum -y install postfix
-メール環境の切り替え
# alternatives --config mta
2 プログラムがあり 'mta' を提供します。
選択 コマンド
-----------------------------------------------
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix
Enter を押して現在の選択 [+] を保持するか、選択番号を入...
#br
# ls -la /etc/alternatives/ | grep mta
lrwxrwxrwx. 1 root root 26 2010-07-07 18:10 mta -> ...
lrwxrwxrwx. 1 root root 40 2010-07-07 18:10 mta-ali...
lrwxrwxrwx. 1 root root 22 2010-07-07 18:10 mta-mai...
lrwxrwxrwx. 1 root root 38 2010-07-07 18:10 mta-mai...
lrwxrwxrwx. 1 root root 27 2010-07-07 18:10 mta-new...
lrwxrwxrwx. 1 root root 43 2010-07-07 18:10 mta-new...
lrwxrwxrwx. 1 root root 23 2010-07-07 18:10 mta-pam...
lrwxrwxrwx. 1 root root 22 2010-07-07 18:10 mta-rma...
lrwxrwxrwx. 1 root root 25 2010-07-07 18:10 mta-sen...
lrwxrwxrwx. 1 root root 41 2010-07-07 18:10 mta-sen...
-自動起動するようにする
# /sbin/chkconfig --level 35 postfix on
# /sbin/chkconfig --list | grep postfix
postfix 0:off 1:off 2:off 3:on 4:off ...
-iptables の 25 番ポートをあけます
$ sudo /usr/bin/system-config-firewall
#ref(iptables25.png)
*/etc/postfix/main.cf の変更 [#n7a4d7dc]
-変更後と変更前の差分を見てみる
# diff -u main.cf.original main.cf
--- main.cf.original 2010-07-07 22:29:21.647280593 +0...
+++ main.cf 2010-07-07 22:43:23.115277889 +0900
-サーバのホスト名
@@ -74,6 +74,7 @@
#
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
+myhostname = orange.hondou.homedns.org
# The mydomain parameter specifies the local internet d...
# The default is to use $myhostname minus the first com...
-ドメイン名
@@ -81,6 +82,7 @@
# parameters.
#
#mydomain = domain.tld
+mydomain = hondou.homedns.org
# SENDING MAIL
#
-メール送信時につけるドメイン名
@@ -96,7 +98,7 @@
# to recipient addresses that have no @domain part.
#
#myorigin = $myhostname
-#myorigin = $mydomain
+myorigin = $mydomain
# RECEIVING MAIL
-SMTPを受け付けるインタフェースを全てのインタフェースにす...
@@ -110,10 +112,10 @@
#
# Note: you need to stop/start Postfix when this parame...
#
-#inet_interfaces = all
+inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
-inet_interfaces = localhost
+#inet_interfaces = localhost
# Enable IPv4, and IPv6 if supported
inet_protocols = all
-MTA(送信元)をLAN内からだけにする
@@ -161,8 +163,8 @@
#
# See also below, section "REJECTING MAIL FOR UNKNOWN L...
#
-mydestination = $myhostname, localhost.$mydomain, local...
-#mydestination = $myhostname, localhost.$mydomain, loca...
+#mydestination = $myhostname, localhost.$mydomain, loca...
+mydestination = $myhostname, localhost.$mydomain, local...
#mydestination = $myhostname, localhost.$mydomain, loca...
# mail.$mydomain, www.$mydomain, ftp.$mydomain
-LANの範囲を設定する
@@ -264,6 +266,7 @@
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table
+mynetworks = 192.168.1.0/24, 127.0.0.0/8, [::1]/128
IPv6 のアドレスを加えなきゃいけなくなった。時代はちょっと...
-メールの保存先を 各自のホームディレクトリ以下 (~/Maildir...
# The relay_domains parameter restricts what destinatio...
# relay mail to. See the smtpd_recipient_restrictions ...
@@ -416,7 +419,7 @@
# "Maildir/" for qmail-style delivery (the / is require...
#
#home_mailbox = Mailbox
-#home_mailbox = Maildir/
+home_mailbox = Maildir/
# The mail_spool_directory parameter specifies the dire...
# UNIX-style mailboxes are kept. The default setting de...
-最大送信サイズを 100MB にする
@@ -674,3 +677,17 @@
# readme_directory: The location of the Postfix README ...
#
readme_directory = /usr/share/doc/postfix-2.7.0/README_...
+
+# Size Limit (1GB / 100MB)
+mailbox_size_limit = 1073741824
+message_size_limit = 104857600
-OP25B対策 (Biglobe では 25 番ポートがブロックされている...
+
+# OP25B(Outbound Port 25 Blocking)
+relayhost = [msagw.biglobe.ne.jp]
+smtp_sasl_type = cyrus
+smtp_sasl_auth_enable = yes
+smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
+smtp_sasl_security_options = noanonymous
+smtp_sasl_mechanism_filter = cram_md5,plain,login
-以前の設定では送信元が逆引きできない場合には無視する
+# Reject any mail clients which has not host name. (Pe...
+smtpd_client_restrictions = permit_mynetworks,reject_un...
--デフォルト値は、permit_mynetworks, reject_unauth_destin...
--http://www.postfix-jp.info/trans-2.2/jhtml/postconf.5.h...
*プロバイダの中継サーバの認証情報を作成する [#s64aaffe]
# cd /etc/postfix/
# vi sasl_password
msagw.biglobe.ne.jp ※ユーザ名※:※パスワード※
# chmod 700 sasl_password
# postmap sasl_password
# ls | grep sasl
sasl_password
sasl_password.db
postfix からは sasl_password.db が使われる。&br;
#br
なお、SASL につかう cyrus は、既にインストールされていた
# yum list installed | grep cyrus
cyrus-sasl.i686 2.1.23-11.fc13 ...
cyrus-sasl-gssapi.i686 2.1.23-11.fc13 ...
cyrus-sasl-lib.i686 2.1.23-11.fc13 ...
cyrus-sasl-md5.i686 2.1.23-11.fc13 ...
cyrus-sasl-plain.i686 2.1.23-11.fc13 ...
*メールボックスの作成 [#k884e4d7]
-既存のユーザ&br;
こんな感じの Shell Script で Maildir を作成
# cat mkmailbox.sh
#!/bin/bash
for user in `ls /home/`
do
if [ $user != "lost+found" ]
then
HOMEDIR=/home/$user
mkdir -p $HOMEDIR/Maildir/new
mkdir -p $HOMEDIR/Maildir/cur
mkdir -p $HOMEDIR/Maildir/tmp
chown $user:$user -R $HOMEDIR/Maildir
chmod -R 700 $HOMEDIR/Maildir
fi
done
-新規ユーザ
--ひな形 (/etc/skel)
# mkdir -p /etc/skel/Maildir/new
# mkdir -p /etc/skel/Maildir/cur
# mkdir -p /etc/skel/Maildir/tmp
# chmod -R 700 /etc/skel/Maildir/
--メールユーザ(ログインできないユーザ)の作成
# useradd -s /sbin/nologin ※ユーザ名※
# passwd ※ユーザ名※
*設定の確認 [#meb7898f]
-postfix の起動
# /etc/init.d/postfix start
postfix を起動中: ...
-テストメールの送信 (EOT は Ctrl+D or .+Enter)
# mail kagyuu
Subject: TEST
MAIL TEST
EOT
-テストメールの受信確認
$ cat ~/Maildir/new/1278523187.Vfd02Ie80165M31567.orange...
Return-Path: <root@hondou.homedns.org>
X-Original-To: kagyuu
Delivered-To: kagyuu@hondou.homedns.org
Received: by orange.hondou.homedns.org (Postfix, from us...
id B0F17415F3; Thu, 8 Jul 2010 02:08:26 +0900 (...
Date: Thu, 08 Jul 2010 02:08:26 +0900
To: kagyuu@hondou.homedns.org
Subject: TEST
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <20100707170858.B0F17415F3@orange.hondou.hom...
From: root@hondou.homedns.org (root)
MAIL TEST
*セキュリティの確認 [#x9460130]
-http://www.rbl.jp/svcheck.php で、第三者転送ができないか...
----
[[Fedora 13 Server]]
ページ名:
ISBN10
ISBN13
9784061426061