  Sendmail DRAC ̿ Dynamic Relay(RedHat 7.0)

  Author - Colin Bloch bofh@lsn.net
  2000 12 04
  â  escargo@netsource.co.kr
  2001 1 19

    Sendmail Ͽ accessϰ DRAC(Dynamic Relay Autohriza
  tion Control) ̿     ̿뿡  ̴.
   Ǹ   Ŭ̾ Ʈ ϸ̸ ϰ ϴµ
  ִ   ϰ ִ. ̱ ϰ ̰ ø
   ֽ  Colin BlochԲ   帰.
  ______________________________________________________________________

  

  1. DRAC  
  2. ʿ Ű,  ġ, õ
     2.1 ⺻Ű (Standard RH7.0 distribution packages)
     2.2 ߰Ű
     2.3 Ű(Optional packages)
     2.4 2. ýغ DRACD(DRAC daemon) õ

  3. POP3,  غ ׽
     3.1 POP3 غ ׽
     3.2 DRAC ϰ Sendmail ϱ.
        3.2.1 DRAC ϰ Sendmail ڵ ϱ.
        3.2.2  sendmail.cf  

  4. sendmail, popper  drac  ۵ϴ  ׽Ʈϱ

  ______________________________________________________________________

  1.  DRAC  

  Sendmail(SMTP)  ֽŹ  Relay  Default Ǿ ־
  localhost Mail Relay /etc/mail/access Ͽ relay IP host
  ν ѵ,   DHCP IP  ο޴ 
  ǰ ƴ Ŭ̾Ʈ(ȣƮ) Relay    
   .   Relay ϵ sendmail.cf access
   ִ   ս ̱ ϰ, ̰ Spammer
  ֿŸŶ Ǿ   ϰ ֱ⵵ ϰ ٵ
  Relay ǹ̸ (?)ϴ   ̴. ̷ Ǹ
   Ŭ̾Ʈ Relay      
  ǵ Relay  θ ڵ ְų    
  ִ    ãƺٰ DRAC(Dynamic Relay Authoriazation
  Control)  ״ ' ' ̸  α׷
  ãҴ.   α׷ ˰ ִ  ְ , Ȥ 
  ϴ ̵鿡  ɱϿ DRAC ġ    
  Ͽ(⺸ٴ  ؿ  ϰڴ) غ Ѵ.
     Redhat 7.0ȯ濡 ν   Ͽ.
  ( ȯϿ  ߰ϰ      
  α׷ ߰ϰ Ǹ   üϰ Ѵ.

  DRAC Ǹ  ȣƮ ϸ̸ POP3  
  ī ͺ̽(/etc/mail/dracd.db) Ͽ ̸ 
  ϸ̸ ϴ daemon̴. ٽøϸ localhost ϼ 
    ִ  Relay    ȣƮ
  pop3 Ͽ pop3  ϸ ̸   
   ּҸ ͺ̽ȭϿ  ͸ ٰŷ  ǿ 
  ð  ̸ ϰѴ.(DRAC ⺻ ϸ ȿð
  30 ̰ ٸ  ϴ)  ð  Ǹ
  ٽ  Ƿμ ϸ ̴  ǰ ٽ  ڰ
  ٸ IP POP3  ϰ Ǹ ٽ    Ǵ
  ͺ̽ ϵǰ ǰ  Ƿ ٽ ϸ̰ ϰ
  Ǵ  α׷̶  ȴ.   ƴ 
  ׷ϱ  ϸ   ʿ κ
  /etc/mail/accss ̿ϸ ǰ  accss  DRAC
   override   Ѵ.

  2.  ʿ Ű,  ġ, õ

  2.1.  ⺻Ű (Standard RH7.0 distribution packages)

  1) xinetd (xinetd-2.1.8.9pre9-6.i386.rpm)  -- RedHat 7.0  inetd
  ȭ ̴.

  2) db3-devel (db3-devel-3.1.14-6.i386.rpm)

  3) sendmail (sendmail-8.11.0-8.i386.rpm)

  4) portmap (portmap-4.0-29.i386.rpm)

   Ű  7.0 ⺻Űε    ġǾ 
   ְ ׷    ִ.   Ȯغ ġǾ 
   ġش.

  ______________________________________________________________________
  *Ȯ
  $ rpm -q db3-devel    --   Ű 
  *ġ
  $ rpm -Uvh package_name
  ______________________________________________________________________

  2.2.  ߰Ű

  drac    ʿ Ű̴. ٿ ʼ.

  - DRAC : drac-1.11-1.i386.rpm <http://www.ls-
  l.net/drac/redhat/drac-1.11-1.i386.rpm>

  - qpopper w/drac : qpopper-3.1.2-1.i386.rpm <http://www.ls-
  l.net/drac/redhat/qpopper-3.1.2-1.i386.rpm>

   qmail  Maildir mbox ϴ pop3 ʿϴٸ
  http://www.ls-l.net/drac/qmail.html < http://www.ls-
  l.net/drac/qmail.html>  Ѵ.

  qpopper ġ ڵ xinetd ʿ ϵ ڵ ġϸ鼭
  xinetd õ ϰ Ǵµ ̶  xinetd õǾ ִ °
  ƴ϶ FAILD ޼ Ե µ ̴ α׷ ġ 
     ϶.

  2.3.  Ű(Optional packages)

  sendmail w/drac - sendmail-8.11.0-8.i386.rpm  <http://www.ls-
  l.net/drac/redhat/sendmail-8.11.0-8.i386.rpm>

   Ű DRAC  sendmail-cf 籸 ڵ ϴ
  Ű̴.    Ű ġϸ  sendmail.cf
  sendmail.cf.rpmsave üϱ  sendmail.cf 籸ؾѴ.
  2.4.  2. ýغ DRACD(DRAC daemon) õ

  1) portmap  ǰ ִ ȮϿ ׷  

  ______________________________________________________________________
  - Ȯ
    $ /etc/rc.d/init.d/portmap status
   - 
    $ /etc/rc.d/init.d/portmap start
  ______________________________________________________________________

  2) dracd  $ /etc/rc.d/init.d/dracd start  /etc/mail/
  dracd.dbȭ Ǿ Ȯ

  3.  POP3,  غ ׽

  3.1.  POP3 غ ׽

  1)  localhost pop-3 Ʈ Ͽ pop3 dracd DB
  ƮѴ.

  ______________________________________________________________________
  # telnet localhost 110
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    +OK QPOP (version 3.1.2) at mail.my.net starting.
    user foo         <--- localhost ̸ 
    +OK Password required for foo.
    pass bar        <--- н
    +OK foo has 0 visible messages (0 hidden) in 0 octets.
    quit
    +OK Pop server at mail.my.net signing off.
  ______________________________________________________________________

  2) /etc/mail/dracd.dbȭ ý date ġϴ Ȯ

  ______________________________________________________________________
  # ls -l /etc/mail/dracd.db
  # date
  ______________________________________________________________________

  3) dracd.db IP Address(⼱ 127.0.0.1) ϵǾ Ȯ

  ______________________________________________________________________
  # grep 127.0.0.1 dracd.db
  Binary file dracd.db matches   <---   Ǿ  ޼
  ______________________________________________________________________

  3.2.  DRAC ϰ Sendmail ϱ.

  3.2.1.  DRAC ϰ Sendmail ڵ ϱ.

   Optional Package  sendmail-8.11.0-8.i386.rpm  drac-enabled
  sendmail  drac  sendmail ϵ ڵ sendmail.cf
  Ѵ. ġ sendmail.cf 缳 ־ Ѵ. Ʒ 
  ΰ    ִ.(ΰ Ѱ )

  ______________________________________________________________________
  - 缳ġ
   # rpm -Uvh --force sendmail-.11.0-8.i386.rpm

  - νϰ 缳ġ
   # rpm -e --nodeps sendmail
   # rpm -Uvh sendmail-.11.0-8.i386.rpm

  ڵġ κ  ۵   ۵  Ʒ  
  ______________________________________________________________________

  3.2.2.   sendmail.cf  

  ______________________________________________________________________
  1) /etc/sendmail.cf   ȭ  Ʒ  local info  ؿ ߰.

  # dynamic relay authorization control map
    Kdrac btree /etc/mail/dracd

  2) Ʒ    "SLocal_check_rcpt"  ߰

    # allow recent POP/IMAP mail clients to relay
    R$*                             $: $&{client_addr}
    R$+                             $: $(drac $1 $: ? $)
    R?                              $@ ?
    R$+                             $@ $#OK
  )  space ƴ϶ tap Ű

  3) sendmail õ
  # /etc/rc.d/init.d/sendmail restart
  ______________________________________________________________________

  4.  sendmail, popper  drac  ۵ϴ  ׽Ʈϱ

  ______________________________________________________________________
  1) Relay  ȣƮκ smtp Ͽ relay ź Ȯ

  # telnet mail.my.net 25   <---ϼ ּ
    Trying 192.168.1.1...
    Connected to mail.my.net.
    Escape character is '^]'.
    220 mail.my.net ESMTP Sendmail 8.11.0/8.11.0; Tue, 21 Nov 2000 10:56:01 -0600
    helo blah    <-- ״  .
    250 mail.my.net Hello bofh [192.168.1.2], pleased to meet you
    mail from: bgates@microsoft.com
    250 2.1.0 bgates@microsoft.com... Sender ok
    rcpt to: president@whitehouse.gov
    550 5.7.1 president@whitehouse.gov... Relaying denied  <-- ̰ źεǾ.
    quit
    221 2.0.0 mail.my.net closing connection

  2)  pop-3 Ʈ Ͽ   ȹϱ

  # telnet mail.my.net 110
    Trying 192.168.1.1...
    Connected to mail.my.net.
    Escape character is '^]'.
    +OK QPOP (version 3.1.2) at mail.my.net starting.
    user foo      <--- Smtp  Ͼ̵
    +OK Password required for foo.
    pass bar
    +OK foo has 0 visible messages (0 hidden) in 0 octets.  <--   ȹ
    quit
    +OK Pop server at mail.my.net signing off.

  3) ٽ smtp Ʈ Ͽ ̸   ִ Ȯ

    [root@bofh /root]# telnet mail.my.net 25
    Trying 192.168.1.1...
    Connected to mail.my.net.
    Escape character is '^]'.
    220 mail.my.net ESMTP Sendmail 8.11.0/8.11.0; Tue, 21 Nov 2000 10:56:01 -0600
    helo blah
    250 mail.my.net Hello bofh [192.168.1.2], pleased to meet you
    mail from: bgates@microsoft.com
    250 2.1.0 bgates@microsoft.com... Sender ok
    rcpt to: president@whitehouse.gov
    250 2.1.5 president@whitehouse.gov... Recipient ok  <--  
    quit
    221 2.0.0 mail.my.net closing connection
  ______________________________________________________________________

     pop-3Ʈ  Ͽ ϰ ̵ 
  ϸ /etc/DRACd.db ӵǾ IP Ͽ  IP 
   Relay ϵ   ִ. ٽøϸ Mail Client
  α׷ pop-3Ʈ localhost ִ  ̵  
  ϱ⸸ ϸ  Relay ϰ ϰ ִ.  Ǹ 
  ִ    localhost  ϰ 
  sendmail /etc/mail/access  ʴ 󸶵 Relay
   Ͽ Relay ϰ ش.

   /etc/DRACd.db ϵǾ IP data ⺻ 30
  ȿð  http://mail.cc.umanitoba.ca/drac
  <http://mail.cc.umanitoba.ca/drac> 캸  ȿð  
  ִ.

    DRAC ̿  ϰ Ϸ PO3  POP3
   ϴ  Ǿ Ѵ.  DRAC  ȿð
  Ǿٸ  Relay ź ޼  ̴.

  ̱  Ǿ Ͱ ణ ٸ.   ʰ ǿ
  ߱ ̴.  ǹ޿  ̰   ȴ. 
   ϴ  http://www.ls-l.net/drac <http://www.ls-
  l.net/drac/> ϸ ȴ.

