メールサーバ(Postfix)の設定 (2003/11/08)
 不正中継が怖くてなかなか手が出せなかったメールサーバ(Postfix)を恐る恐る立ち上げてみました。
密かに起動して1か月ほど様子を見てみましたが,不正中継の兆候はないようですから,いつものように設定をメモしておくことにします。

/etc/postfix/main.cf の編集
このページを参考にして /etc/postfix/main.cf を次のように書き替えます(赤字の部分)。

# 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
# a domain-wide alias database that aliases each user to
# user@that.users.mailhost.
#
#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].
#
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_interfaces = all

(中略)

# Specify "mynetworks_style = host" when Postfix should "trust"
# only the local machine.
# 
#mynetworks_style = class
mynetworks_style = subnet
#mynetworks_style = host

(中略)

# 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

(中略)

mydomain = physics.atnifty.com
mydestination = $myhostname, $mydomain
myhostname = physics.atnifty.com
smtpd_helo_required = yes
disable_vrfy_command = yes
strict_rfc821_envelopes = yes
allow_percent_hack = yes
swap_bangpath = yes
allow_untrusted_routing = no
smtpd_helo_restrictions = permit_mynetworks,reject_invalid_hostname,reject_unknown_client,permit
smtpd_recipient_restrictions = permit_mynetworks,reject_sender_login_mismatch,check_relay_domains
smtpd_sender_restrictions = reject_unknown_sender_domain,reject_sender_login_mismatch
smtpd_etrn_restrictions = permit_mynetworks,reject_invalid_hostname
@niftyのDDNSは,MXレコードの設定をしなくても大丈夫みたいで,Postfixを起動すれば,murata@physics.atnifty.com宛のメールを受け取れますし,送信することもできました。
(「murata」はVine Linuxのユーザ名です)
サーバ機と同一LAN内のクライアントPCで送受信するには,OutlookExpressなどのメーラーの設定を
受信メールサーバ( POP3 ):192.168.0.10 ( メールサーバ機のローカル IP アドレス )
送信メールサーバ( SMTP ):192.168.0.10 ( メールサーバ機のローカル IP アドレス )
としてやります。

メールエイリアスの設定
Webmaster@physics.atnifty.comとかadmin@physics.atnifty.com宛てのメールを,murata@physics.atnifty.comで受け取るには,メールエイリアスの設定をしてやります。
/etc/postfix/aliasesの最後に,次のような記述を書き加えておけばOKです。
Linuxユーザを増やさなくても,メールアドレスをどんどん作れますから便利ですね〜♪

webmaster: murata
admin: murata




Linuxで自宅サーバ 
\1980のジャンクPCで自宅サーバ  
ノートPCにNFSインストール  
自宅サーバでHPを公開しよう
CGIを使ってみよう
WebDAVを使ってみよう(1)
WebDAVを使ってみよう(2)
kernelの再構築(VineLinux2.5)
自宅サーバでLiveカメラ
自宅サーバでLiveカメラ(2)
Wormの攻撃
ADSLの導入とIPアドレス自動更新
DiCE for Linux
 メールサーバ(Postfix)の設定



【Top Page】