imapext-2007

view APOPtools/pop3-record @ 4:d741b3ecc917

imapext-2007f
author HIROSE Yuuji <yuuji@gentei.org>
date Thu, 30 Oct 2014 00:03:05 +0900
parents 28a55bc1110c
children
line source
1 #!/bin/sh -
2 # A sample "POP before SMTP"-enabler script for tcp_wrappers
3 # This script should be installed in /usr/local/etc
4 # If you are thinking of using this script on heavily loaded host,
5 # you had better to choose tcpserver instead of tcp_wrappers.
6 #
7 ALLOWTMP="/var/log/ATMP"
8 if [ -f /usr/local/etc/hosts.allow ]; then
9 ALLOW="/usr/local/etc/hosts.allow"
10 else
11 ALLOW=/etc/hosts.allow
12 fi
13 ALLOWSRC=${ALLOW}.src
14 ALLOWNEW=${ALLOW}.new
16 # for debug
17 # (env;echo "1=$1") | Mail -s pop3access yuuji
19 case $0 in
20 *record)
21 echo "tcp-env : $RELAYCLIENT : setenv = RELAYCLIENT" >> $ALLOWTMP.1
22 ;;
23 *age)
24 rm -f $ALLOWTMP.2
25 [ -f $ALLOWTMP.1 ] && mv -f $ALLOWTMP.1 $ALLOWTMP.2
26 ;;
27 *)
28 # else generate master hosts.allow file
29 ;;
30 esac
31 touch $ALLOWTMP.1 $ALLOWTMP.2
32 echo "#
33 # DO NOT EDIT THIS FILE!
34 # This file is generated from $ALLOWSRC file.
35 # Edit it!
36 #" > $ALLOWNEW
37 (cat $ALLOWTMP.[12] | sort -u; cat $ALLOWSRC) >> $ALLOWNEW
38 /bin/mv -f $ALLOWNEW $ALLOW
40 # pop3-{age,update,record} for tcp_wrappers ends here
41 # The following section is the sample routine for tcpserver(ucsp-tcp)
42 # If you use tcpserver, replace the above section after "case $0...esac"
43 # by the following section.
44 # Sample code was contributed by pirozeau(pirozeau@banana-fish.com).
46 #TCPREMOTEIP=${TCPREMOTEIP:-undefined}
47 #RELAYCLIENT=${RELAYCLIENT:-$TCPREMOTEIP}
48 #ALLOW=/usr/local/etc/smtprule
49 #case $0 in
50 # *record)
51 # echo "$RELAYCLIENT:allow,RELAYCLIENT=\"\"" >> $ALLOWTMP.1
52 # ;;
53 # *age)
54 # rm -f $ALLOWTMP.2
55 # [ -f $ALLOWTMP.1 ] && mv -f $ALLOWTMP.1 $ALLOWTMP.2
56 # ;;
57 # *)
58 # # else generate master tcprule file
59 # ;;
60 #esac
61 #touch $ALLOWTMP.1 $ALLOWTMP.2
62 #(cat $ALLOWTMP.[12] | sort -u; cat ${ALLOW}) | /usr/local/bin/tcprules ${ALLOW}.cdb ${ALLOW}.tmp
63 #!/bin/sh -
64 # A sample "POP before SMTP"-enabler script for tcp_wrappers
65 # This script should be installed in /usr/local/etc
66 # If you are thinking of using this script on heavily loaded host,
67 # you had better to choose tcpserver instead of tcp_wrappers.
68 #
69 ALLOWTMP="/var/log/ATMP"
70 if [ -f /usr/local/etc/hosts.allow ]; then
71 ALLOW="/usr/local/etc/hosts.allow"
72 else
73 ALLOW=/etc/hosts.allow
74 fi
75 ALLOWSRC=${ALLOW}.src
76 ALLOWNEW=${ALLOW}.new
78 # for debug
79 # (env;echo "1=$1") | Mail -s pop3access yuuji
81 case $0 in
82 *record)
83 echo "tcp-env : $RELAYCLIENT : setenv = RELAYCLIENT" >> $ALLOWTMP.1
84 ;;
85 *age)
86 rm -f $ALLOWTMP.2
87 [ -f $ALLOWTMP.1 ] && mv -f $ALLOWTMP.1 $ALLOWTMP.2
88 ;;
89 *)
90 # else generate master hosts.allow file
91 ;;
92 esac
93 touch $ALLOWTMP.1 $ALLOWTMP.2
94 echo "#
95 # DO NOT EDIT THIS FILE!
96 # This file is generated from $ALLOWSRC file.
97 # Edit it!
98 #" > $ALLOWNEW
99 (cat $ALLOWTMP.[12] | sort -u; cat $ALLOWSRC) >> $ALLOWNEW
100 /bin/mv -f $ALLOWNEW $ALLOW
102 # pop3-{age,update,record} for tcp_wrappers ends here
103 # The following section is the sample routine for tcpserver(ucsp-tcp)
104 # If you use tcpserver, replace the above section after "case $0...esac"
105 # by the following section.
106 # Sample code was contributed by pirozeau(pirozeau@banana-fish.com).
108 #TCPREMOTEIP=${TCPREMOTEIP:-undefined}
109 #RELAYCLIENT=${RELAYCLIENT:-$TCPREMOTEIP}
110 #ALLOW=/usr/local/etc/smtprule
111 #case $0 in
112 # *record)
113 # echo "$RELAYCLIENT:allow,RELAYCLIENT=\"\"" >> $ALLOWTMP.1
114 # ;;
115 # *age)
116 # rm -f $ALLOWTMP.2
117 # [ -f $ALLOWTMP.1 ] && mv -f $ALLOWTMP.1 $ALLOWTMP.2
118 # ;;
119 # *)
120 # # else generate master tcprule file
121 # ;;
122 #esac
123 #touch $ALLOWTMP.1 $ALLOWTMP.2
124 #(cat $ALLOWTMP.[12] | sort -u; cat ${ALLOW}) | /usr/local/bin/tcprules ${ALLOW}.cdb ${ALLOW}.tmp

UW-IMAP'd extensions by yuuji