sendmail.mcファイルの編集例
○ ファイルの場所
/etc/mail/sendmail.mc
○ ファイル内編集箇所
プロバイダ中継設定
dnl define('SMART_HOST','smtp.your.provider')
dnlを取り除きsmtp.your.providerの部分をサーバに割り当てられた送信サーバのドメインを入力します。
外部とのメールのやりとりを許可する。
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
※dnlを挿入することでコメントアウトしたことになります。
define(`confSMTP_LOGIN_MSG',`unknown')dnl
define(`confRECEIVED_HEADER',`$?sfrom $s $.$?_($?s$|from $.$_)
$.$?{auth_type}(authenticated)
$.by $j (unknown)$?r with $r$. id $i$?u
for $u; $|;
$.$b')dnl
mcファイルをcfファイルに変換local-host-namesファイルの編集例
○ ファイルの場所
/etc/mail/local-host-names
○ ファイル内修正箇所
# local-host-names - include all aliases for your machine here.
torhsi.sytes.net
accessファイルの編集例
○ ファイルの場所
/etc/mail/access
○ ファイル内修正箇所
接続の許可と拒否
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
192.168.0 RELAY
61.110.215.50 REJECT
china9988@21cn.com REJECT
.net.tw REJECT
.com.tw REJECT
.edu.tw REJECT
※ RELAYが許可、REJACTが拒否です。
修正後は必ず再起動を行う。
# service sendmail restart