sendmail ϱ ؼ DNS( , ) Ǿ ־ մϴ.
- nameserver
1. nameserver
ֶ Ϲ ġǾ ִٸ /user/sbin/in.named մϴ.
/etc/named.conf
ڰ ۼ մϴ. ⼭ ο ġ ʰ ü ġ
ɶ ġ bind ̿ Դϴ.
#/usr/sbin/in.named
#/etc/named.conf
ũƮ #/etc/init.d/inetsvc
2. named.conf .
named.conf --- DNS ȯ .
options {
directory "/var/named"; ------ zone ġ 丮
};
zone "." IN {
type hint;
file "named.cache"; ----- Ʈ Ӽ ִ ͺ̽
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
include "/var/named/rndc.key";
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "readytop.com" IN {
type master;
file "readytop.zone";
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "readytop.rev";
allow-update { none; };
};
wq!
3. ij named.cache
#dig > /var/named/named.cache
<<>> DiG 9.1.0 <<>>
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21546
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;. IN NS
;; ANSWER SECTION:
. 454234 IN NS E.ROOT-SERVERS.NET.
. 454234 IN NS F.ROOT-SERVERS.NET.
. 454234 IN NS G.ROOT-SERVERS.NET.
. 454234 IN NS H.ROOT-SERVERS.NET.
. 454234 IN NS I.ROOT-SERVERS.NET.
. 454234 IN NS J.ROOT-SERVERS.NET.
. 454234 IN NS K.ROOT-SERVERS.NET.
. 454234 IN NS L.ROOT-SERVERS.NET.
. 454234 IN NS M.ROOT-SERVERS.NET.
. 454234 IN NS A.ROOT-SERVERS.NET.
. 454234 IN NS B.ROOT-SERVERS.NET.
. 454234 IN NS C.ROOT-SERVERS.NET.
. 454234 IN NS D.ROOT-SERVERS.NET.
;; ADDITIONAL SECTION:
J.ROOT-SERVERS.NET. 604560 IN A 192.58.128.30
;; Query time: 14 msec
;; SERVER: 192.168.0.10#53(192.168.0.10)
;; WHEN: Tue Aug 23 10:10:58 2005
;; MSG SIZE rcvd: 244
4.localhost.zone
$TTL 86400;
@ IN SOA readytop.com. root.readytop.com. (
940004 ; serial
21600 ; refresh
900 ; retry
604800 ; expire
43200 ) ; minimum
1D IN NS localhost.
1D IN PTR localhost.
5. named.local
$TTL 86400;
@ IN SOA readytop.com. root.readytop.com. (
940004 ; serial
21600 ; refresh
900 ; retry
604800 ; expire
43200 ) ; minimum
IN NS localhost.
1D IN PTR localhost.
6. readytop.zone
$TTL 86400
@ IN SOA ns.readytop.com. root.readytop.com. (
2004082722 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
3600 ) ; negative TTL
IN NS ns.readytop.com.
IN MX 10 mail.readytop.com.
ns 1D IN A 192.168.0.200
www 1D IN A 192.168.0.200
mail 1D IN A 192.168.0.200
7. readytop.rev
$TTL 86400;
@ IN SOA ns.readytop.com. root.readytop.com. (
2004082722 ; Serial
28800 ; Refresh
7200 ; Retry
604800 ; Expire
3600 ) ; Minimum
IN NS ns.readytop.com.
200 IN PTR ns.readytop.com.
200 IN PTR www.readytop.com.
200 IN PTR mail.readytop.com.
8. named
#/usr/sbin/in.named
nslookup ̿Ͽ ã /etc/resolv.conf Ͽ
nameserver 192.168.0.200 ؾ մϴ. ó ִ nameserver
www.readytop.com ã ֽϴ.
#vi /etc/resolv.conf
nameserver 192.168.0.200
nameserver 168.126.63.1
9. nslookup Ȯ
(readytop>root)/etc# nslookup mail.readytop.com
Server: ns.readytop.com
Address: 192.168.0.200
Name: mail.readytop.com
Address: 192.168.0.200
(readytop>root)/etc#
10. named Ȯ
#tail -f /var/adm/messages
#ps -ef | grep named
-------- sendmail .
11. /etc/hosts
/etc/hosts Ͽ ̸
#
# Internet host table
#
127.0.0.1 localhost
192.168.0.200 readytop www.readytop.com loghost
(readytop>root)/etc#
12. sendmail backup sendmail
OS ġ ϸ ⺻ sendmail Բ ġ ˴ϴ. ġ Ǿ ִ sendmail
̿ ϰ ־ sendmail ġ ϱ sendmail ؾ մϴ.
sendmail file backup
/etc/mail 丮 ̸, /usr/lib sendmail ϵ ̸.
# cp –p /usr/lib/sendmail /usr/lib/sendmail.old
# cp -rp /etc/mail /etc/mail.old
#/etc/init.d/sendmail stop ----> sendmail
13. sendmail ޱ Ű ޱ
sendmail www.sunfreeware.com sunfreeware ִ
Դϴ.www.sendmail.org ֽ ֽϴ.
ڽ ִ OS ġ 쿡 ִ Ű sendmail
ġ DZ ġ ؾ մϴ.
gcc_small-3.4.2-sol8-sparc-local.gz
db-4.2.52.NC-sol8-sparc-local.gz
libgcc-3.3-sol8-sparc-local.gz
libiconv-1.9.2-sol8-sparc-local.gz
m4-1.4.2-sol8-sparc-local.gz
openssl-0.9.8b-sol8-sparc-local.gz
qpopper-4.0.5-sol8-sparc-local.gz
Ű www.sunfreeware.com ֽϴ.
Ű ġ
- gunzip -d gcc_small-3.4.2-sol8-sparc-local.gz
- pkagdd -d gcc_small-3.4.2-sol8-sparc-local
sendmail ޱ
www.sendmail.org ----> sendmail.8.13.2.tar.gz
14. sendmail
#gunzip sendmail.8.13.2.tar.gz
#tar xvf sendmail.8.13.2.tar
ϸ sendmail-8.13.2 丮
#cd sendmail-8.13.2
15. sendmail .
#cd devtools/Site ----> ̵
#vi site.config.m4
---> Site sit.config.m4.sample Բ ֽϴ.
̿ Ҽ ֽϴ.
#vi site.config.m4 Ͽ ߰
APPENDDEF(`confLIBDIRS', `-L/usr/local/BerkeleyDB.4.2/lib')
APPENDDEF(`confINCDIRS', `-I/usr/local/BerkeleyDB.4.2/include')
APPENDDEF(`confENVDEF', `-DNEWDB')
#/devtools/OS ش OS ´ .
#uname -a --- > OS Ȯ
#vi SunOS.5.8
define(`confMAPDEF', `-DNDBM -DNIS -DNISPLUS -DMAP_REGEX') -------> ( DNDBM -----> DNEWDB )
define(`confMAPDEF', `-DNEWDB -DNIS -DNISPLUS -DMAP_REGEX')
16. sendmail
#./Build -c
ld: ġ: ̺귯 -lphclient:() ϴ. Ұܿ ....
#nph-1.2.3.tar download ġ
#./configure
#make
#make install
- smmsp .
#groupadd smmsp
#useradd -g smmsp smmsp
#passmgmt -m -s /dev/null smmsp
#mkdir -p /usr/share/man/cat1
#mkdir /usr/share/man/cat5
#mkdir /usr/share/man/cat8
./Build install
17. config.mc .
# cd cf/cf ---- ̵
#cp generic-solaris.mc config.mc
#sh Build config.cf
#cp config.cf /etc/mail/sendmail.cf
18. sendmail ũƮ
#vi /etc/init.d/sendmail
#!/sbin/sh
case "$1" in
'start')
# Start the MTA
/usr/lib/sendmail -L sm-mta -bd -q1h
# Start the MSP
/usr/lib/sendmail -L sm-msp-queue -Ac -q30m
;;
'stop')
pid=`/usr/bin/ps -eo pid,comm | /usr/bin/awk '{ if ($2 == "/usr/lib/sendmail") print $1 }'`
if test "$pid"
then
/usr/bin/kill $pid
fi
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
wq!
root@test:/etc/init.d> chown root:sys /etc/init.d/sendmail
root@test:/etc/init.d> chmod 744 /etc/init.d/sendmail
19 sendmail db
#cd /etc/maill
#touch access mailertable aliases
#vi access
127.0.0.1 RELAY
#makemap hash access < access
#makemap hash mailertable < mailertab
#newaliases
#vi local-host-names
mail
readytop.com
mail.readytop.com
20. sendmail .
Ϸ Ǹ 丮 Ȯ Ҽ ֽϴ.
obj.SunOS.5.8.sun4
丮 ̵Ͽ.....
#cd obj.SunOS.5.8.sun4/sendmail
#cp sendmail /usr/lib/sendmail ----> obj.SunOS.5.8.sun4 sendmail 丮
ֽϴ.sendmail 丮 ʿ sendmail ִµ ̰ ...
/usr/lib/sendmail մϴ.
21. sendmail
#/etc/init.d/sendmail start
tail -f /var/log/syslog
Aug 31 15:28:15 readytop sm-mta[7636]: [ID 702911 mail.info] starting daemon (8.13.8): SMTP+queueing@01:00:00
Ǹ ps -ef | grep sendmail Ȯ
α Ͽ sendmail ¸ Ȯ Ҽ ֽϴ.
22. Ʈ
#/usr/lib/sendmail -v blackowl@readysystem.co.kr
test
test
.
blackowl@readysystem.co.kr... Connecting to [127.0.0.1] via relay...
220 www.readytop.com ESMTP Sendmail 8.13.8/8.13.8; Thu, 31 Aug 2006 17:11:07 +0900 (KST)
>>> EHLO www.readytop.com
250-www.readytop.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<root@www.readytop.com> SIZE=10
250 2.1.0 <root@www.readytop.com>... Sender ok
>>> RCPT To:<blackowl@readysystem.co.kr>
>>> DATA
250 2.1.5 <blackowl@readysystem.co.kr>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <blackowl@readysystem.co.kr>... Connecting to 218.145.65.249. via esmtp...
050 220 rmw-001.fmcity.com ESMTP
050 >>> EHLO www.readytop.com
050 250-rmw-001.fmcity.com
050 250-AUTH LOGIN PLAIN
050 250-AUTH=LOGIN PLAIN
050 250-STARTTLS
050 250-SIZE 0
050 250-PIPELINING
050 250 8BITMIME
050 >>> MAIL From:<root@www.readytop.com> SIZE=320
050 250 ok
050 >>> RCPT To:<blackowl@readysystem.co.kr>
050 >>> DATA
050 250 ok
050 354 go ahead
050 >>> .
050 250 ok 1157011026 qp 9934
050 <blackowl@readysystem.co.kr>... Sent (ok 1157011026 qp 9934)
250 2.0.0 k7V8B7t7007740 Message accepted for delivery
blackowl@readysystem.co.kr... Sent (k7V8B7t7007740 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 www.readytop.com closing connection
Ǹ Ȯ Ҽ ֽϴ.