sendmailの設定


sendmail.defの編集

(以下用に編集)

CF_TYPE=R8V8
OS_TYPE=linux
VERSION=3.7Wp12
MX_SENDMAIL=yes
MY_DOMAIN=kyushu-pc.ac.jp
MY_NAME=pc04
OFFICIAL_NAME='$w.$m'
FROM_ADDRESS='$m'
CANON=one       # if MX_SENDMAIL = yes
ACCEPT_ADDRS='$m'       # can be used with R8 sendmail
PROCMAIL_MAILER_PATH=/usr/bin/procmail
PROCMAIL_MAILER_ARGS='procmail Y m $h $g $u'
LOCALDELIVER_PROCMAIL=yes
DIRECT_DELIVER_DOMAINS=all
DIRECT_DELIVER_MAILER=smtp
ALIAS_FILE_PATH='/etc/mail/aliases'

ディレクトリーが/var/src/CF-3.7Wpl2であるか確認

[root@pc04 CF-3.7Wpl2]# make sendmail.cf

MASTERDIR=./Master TOOLDIR=./Tools \
./Tools/Configure sendmail.def > sendmail.cf.tmp
mv -f sendmail.cf.tmp sendmail.cf

バックファイルの作成

mv /etc/sendmail.cf /etc/sendmail.cf.old

/etcにコピー

cp sendmail.cf /etc/sendmail.cf
chmod 644 /etc/sendmail.cf

動作テスト


[root@pc04 CF-3.7Wpl2]# sendmail -bt -do < /dev/null

以下メッセージ
Version 8.9.3+3.2W
 Compiled with: LOG MATCHGECOS MIME7TO8 MIME8TO7 NAMED_BIND NETINET
                NETUNIX NEWDB QUEUE SCANF SMTP USERDB XDEBUG QUICK_RESPONSE
                MULTI_MAILER DYNAMIC_TOBUF MAILER_PREF CLIENT_SMTP_CONFIG
                CTE8CHECK BOUNCE_REASON OO_NULLSENDER CF_ALIASING MF_SEPARATE
                MASKED_ADDR SPR_CON_CACHE FORWARDPROGCTL MAILER_TIMEOUTS
                CHECK_WARNING

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = pc04
  (canonical domain name) $j = $w.$m
         (subdomain name) $m = kyushu-pc.ac.jp
              (node name) $k = pc04
========================================================

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>


[root@pc04 CF-3.7Wpl2]# sendmail bt ken < /dev/null
(以下メッセージ)
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>


[root@pc04 CF-3.7Wpl2]# sendmail -v ken@kyushu-pc.ac.jp < /dev/null
(以下メッセージ)
ken@kyushu-pc.ac.jp... Connecting to pmlocal...
ken@kyushu-pc.ac.jp... Sent

(sendmailの起動)
[root@pc04 CF-3.7Wpl2]# /etc/rc.d/init.d/sendmail start
Starting sendmail:
You have new mail in /var/spool/mail/ken

(POP3/IMAP4の設定)
「サービスの起動」
inetd.conf の編集
[root@pc04 CF-3.7Wpl2]# vi /etc/inetd.conf
# POP3 mail server
pop-3   stream  tcp     nowait  root    /usr/sbin/tcpd ipop3d
# IMAP mail server
imap    stream  tcp     nowait  root    /usr/sbin/tcpd imapd

(inetdの再起動)
[root@pc04 /etc]# /etc/rc.d/init.d/inet restart

(hosts.allowの設定)
[root@pc04 /etc]# vi /etc/hosts.allow
の追加記述を実施

ipop3d : 192.168.1.
imapd  : 192.168.1.

[root@pc04 ken]# ls 1 /var/spool/mail