[PREVIOUS CHAPTER] [NEXT CHAPTER]

3 POP before SMTP with Postfix

    postfix $B$G$N(B pop before smtp $B$K$D$$$F(B

    3.1	install postfix

    3.2	install DRAC (Dynamic Relay Authorization Control)

    http://mail.cc.umanitoba.ca/drac/index.html

    [drac $B$N$D$/$j$+$?(B]
    $B!&(BINSTALL$B$rFI$s$G!"(BOS$B$K$"$o$;$F(BMakefile$B$rD>$9!#(B
      $BCm0U(B: -DREQ_HASH $B$rK:$l$:$K(B

       INSTALL = install
       EBIN = /usr/local/sbin
       MAN = /usr/local/man/man
       DEFS = -DSOCK_RPC -DFCNTL_LOCK -DGETHOST -DDASH_C -DREQ_HASH
       CC = cc
       RANLIB = ranlib
       CFLAGS = $(DEFS) -g -I/usr/include
       LDLIBS =
       TSTLIBS = -L. -ldrac
       RPCGENFLAGS = -C
       MANLIB = 3
       MANADM = 8

    3.3	qpopper$B$N2~B$(B

    $B!&(BINSTALL$B$NCf$K$"$k(B pop_pass.c $B$X$N%Q%C%A$r$"$F$k!#(B
      $BI,MW$J$i<j$G$"$F$k(B

    $B!&(Bqpopper $B$r(Bcompile$B$9$k$H$-$K(B libdrac.a $B$,I,MW$J$N$GE,Ev$J>l=j$K$*$/(B
      Makefile$B$r$=$l$K$"$o$;$F=$@5!#(B

    *** pop_pass.c-nodrac	Sat Jun 27 10:56:00 1998
    --- pop_pass.c	Wed Jul 22 22:54:04 1998
    ***************
    *** 19,24 ****
    --- 19,28 ----

      #include <pwd.h>
      #include "popper.h"
    + #ifdef DRAC_AUTH
    + #include <netinet/in.h>
    + #include <arpa/inet.h>
    + #endif /* DRAC_AUTH */

      /* This error message is vague on purpose to help reduce help improve
    ***************
    *** 502,507 ****
    --- 506,519 ----

          /*  Initialize the last-message-accessed number */
          p->last_msg = 0;
    +
    + #ifdef DRAC_AUTH
    +     {
    + 	char *err;
    + 	if (dracauth("localhost", inet_addr(p->ipaddr), &err) != 0)
    + 	  pop_log(p,POP_PRIORITY,err);
    +     }
    + #endif /* DRAC_AUTH */

          /*  Authorization completed successfully */
          return (pop_msg (p,POP_SUCCESS,

    3. modify postfix /etc/postfix/main.cf.

            smtpd_recipient_restrictions =
                permit_mynetworks
                check_client_access hash:/etc/mail/dracd
                check_relay_domains
                reject

    4. mkdir /etc/mail.

    dracd users the directory "/etc/mail".

    5. run "rpc.dracd" as a daemon.

    [²òÀâ]

    $B2~B$$N7k2L(B popper $B$O(BPOP$B$NG'>Z$K@.8y$7$?D>8e$K(B dracd $B$X(BRPC(Remote
    Procedure Call)$B$G$=$N%G!<%?$rEO$9$h$&$K$J$k!#(Bdracd$B$O$=$l$r$&$1$F(B
    /etc/mail/dracd.db $B$H$$$&%U%!%$%k$K(B

       IP$B%"%I%l%9(B   $B2?;~$^$G$3$N%"%I%l%9$+$i$N(BSMTP$B$,M-8z$+!)(B(unix time)

    $B$N%O%C%7%e%F!<%V%k$r:n$k!#%G%U%)!<%k%H$G$O(B30$BJ,4VM-8z!#(B

    RPC$B$r;H$&$?$a(Bdracd$B$OF1$8%[%9%H>e$GF0$$$F$$$J$/$F$b9=$o$J$$!#$D$^$j(B pop
    $B%5!<%P$H(B MTA$B$OF1$8%[%9%H$G$"$kI,MW$,$J$$!#$3$3$,4N$J$o$1$@$1$I!"5U$K(B
    RPC$B4X78$N@_Dj$r4V0c$($k$H(BRPC$B$^$o$j$,@$3&$K"~8+$($H$$$&%5!<%P$,=PMh>e$,(B
    $B$k$H$b$$$($F5$$r$D$1$J$$$H$$$1$J$$!#(B

    postfix$B$N(B check_client_access maptype:mapname $B$O(B

       Search the named access database for the client hostname, parent
       domains, client IP address, or networks obtained by stripping least
       significant octets. Reject the request if the result is REJECT or
       "[45]XX text".  Permit the request if the result is OK or RELAY or
       all-numerical. Otherwise, treat the result as another list of UCE
       restrictions. The access_map_reject_code parameter specifies the
       response code for REJECT results (default: 554).

    $B$N$h$&$K$J$C$F$$$k$?$a!"%O%C%7%e%F!<%V%k$NCM$,?t;z$@$1$J$i(BOK$B$H$J$k!#(B

[PREVIOUS CHAPTER] [NEXT CHAPTER]