前準備
# cat /etc/group | grep smmsp
# groupadd -g 25 smmsp
# cat /etc/group | grep smmsp
smmsp:x:25:
# cat /etc/passwd | grep smmsp
# useradd -g smmsp -d /var/spool/clientmqueue -s /bin/false -u 25 smmsp
# cat /etc/passwd | grep smmsp
smmsp:x:25:25::/var/spool/clientmqueue:/bin/false
# pwd
/etc
# cp aliases 005_aliases_cp
# mv 005_aliases_cp 001_backup/
# ls /var/spool/ | grep mqueue
# mkdir /var/spool/mqueue
# ls /var/spool/ | grep mqueue
mqueue/
# cd /usr/local/src/006_sendmail/
# tar zxvf sendmail.8.13.4.tar.gz 2>&1 | tee untar_sendmail
# cd sendmail-8.13.4/
# sh Build 2>&1 | tee sh_build
# sh Build install 2>&1 | tee sh_bu_install
$ cp /usr/local/src/006_sendmail/sendmail-8.13.4/cf/cf/generic-linux.mc .
$ cp generic-linux.mc sendmail.mc
$ emacs sendmail.mc &
$ diff -s generic-linux.mc sendmail.mc
25a26,30
> FEATURE(relay_hosts_only)dnl
> FEATURE(`no_default_msa')dnl
> FEATURE(`access_db',`DATABASE_MAP_TYPE -T /etc/mail/access')dnl
> FEATURE(`use_cw_file',`/etc/mail/local-host-names')dnl
> define(`confPRIVACY_FLAGS',`goaway')dnl
sendmail.mc の 内容は
$ sed -e '/^#/d' sendmail.mc
divert(-1)
divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
FEATURE(relay_hosts_only)dnl
FEATURE(`no_default_msa')dnl
FEATURE(`access_db',`DATABASE_MAP_TYPE -T /etc/mail/access')dnl
FEATURE(`use_cw_file',`/etc/mail/local-host-names')dnl
define(`confPRIVACY_FLAGS',`goaway')dnl
MAILER(local)dnl
MAILER(smtp)dnl
# cd cf/cf/
# pwd
/usr/local/src/006_sendmail/sendmail-8.13.4/cf/cf
# cp /home/mm/test/sendmail.mc .
# sh Build sendmail.cf 2>&1 | tee cf_send_bu
# sh Build install-cf 2>&1 | tee cf_inst_bu
# cd /etc/mail
# pwd
/etc/mail
# echo bcnet.ne.jp > local-host-names
# echo "192.168.0 RELAY " > access
# echo "127.0.0.1 RELAY " >> access
# cat access
192.168.0 RELAY
127.0.0.1 RELAY
# cat local-host-names
bcnet.ne.jp
此処までは過不足は 別として 良いと判断
今回は postfix を pkgtool で 削除をしていない
# cp ../001_backup/005_aliases_cp .
# mv 005_aliases_cp aliases
# makemap hash /etc/mail/access < /etc/mail/access
# cd ../
# pwd
/etc
# mv postfix/ bk_postfix/
# cd mail
# pwd
/etc/mail
# newaliases
newaliases: fatal: open /etc/postfix/main.cf: No such file or directory
# mv ../bk_postfix/ ../postfix/
# newaliases
newaliases: warning: My hostname nl is not a fully qualified name - set myhostna
me or mydomain in /etc/postfix/main.cf
postalias: warning: My hostname nl is not a fully qualified name - set myhostnam
e or mydomain in /etc/postfix/main.cf
なにか 動作がおかしい?
# find / -name newaliases
/usr/bin/newaliases
ls -l /usr/bin/newaliases
lrwxrwxrwx 1 root root 23 Jul 9 22:32 /usr/bin/newaliases -> .
./../usr/sbin/sendmail*
# ls -l /usr/sbin/sendmail
-rwxr-xr-x 1 root root 804484 Jan 26 2004 /usr/sbin/sendmail*
# find / -name sendmail
/usr/sbin/sendmail
/usr/local/src/006_sendmail/sendmail-8.13.4/sendmail
/usr/local/src/006_sendmail/sendmail-8.13.4/include/sendmail
/usr/local/src/006_sendmail/sendmail-8.13.4/obj.Linux.2.4.27.i686/sendmail
/usr/local/src/006_sendmail/sendmail-8.13.4/obj.Linux.2.4.27.i686/sendmail/sendm
ail
# ls -l /usr/local/src/006_sendmail/sendmail-8.13.4/obj.Linux.2.4.27.i686\
/sendmail/sendmail
-rwxr-xr-x 1 root root 585570 Jul 15 13:19 \
/usr/local/src/006_sendmail/sendmail-8.13.4/obj.Linux.2.4.27.i686/sendmail/sendmail*
# file /usr/local/src/006_sendmail/sendmail-8.13.4/obj.Linux.2.4.27.i686\
/sendmail/sendmail
/usr/local/src/006_sendmail/sendmail-8.13.4/obj.Linux.2.4.27.i686/sendmail\
/sendmail: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), \
for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped
# file /usr/sbin/sendmail
/usr/sbin/sendmail: ELF 32-bit LSB executable, Intel 80386, version 1(SYSV), \
for GNU/Linux 2.0.0, dynamically linked (uses shared libs), stripped
ファイルというより 見に行くものが異なっているようだ
# pwd
/usr/sbin
# mv sendmail sendmail_postfix
# cp /usr/local/src/006_sendmail/sendmail-8.13.4/obj.Linux.2.4.27.i686/sendmail/
sendmail .
# cd /etc/mail
# newaliases
/etc/mail/aliases: 15 aliases, longest 10 bytes, 162 bytes total
# ls -l sendmail*
-rwxr-xr-x 1 root root 585570 Jul 15 14:58 sendmail*
-rwxr-xr-x 1 root root 804484 Jan 26 2004 sendmail_postfix*
# chmod go-w / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
# chown root / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
にゃんたろう 拝!
2005年 7月20日 (水) 21:19:06 JST 作成