annotate APOPtools/pop3-age @ 1:28a55bc1110c imapext-2007-1

[mq]: imapext
author yuuji@gentei.org
date Mon, 14 Sep 2009 19:23:11 +0900
parents
children d741b3ecc917
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
1 #!/bin/sh -
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
2 # A sample "POP before SMTP"-enabler script for tcp_wrappers
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
3 # This script should be installed in /usr/local/etc
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
4 # If you are thinking of using this script on heavily loaded host,
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
5 # you had better to choose tcpserver instead of tcp_wrappers.
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
6 #
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
7 ALLOWTMP="/var/log/ATMP"
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
8 if [ -f /usr/local/etc/hosts.allow ]; then
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
9 ALLOW="/usr/local/etc/hosts.allow"
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
10 else
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
11 ALLOW=/etc/hosts.allow
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
12 fi
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
13 ALLOWSRC=${ALLOW}.src
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
14 ALLOWNEW=${ALLOW}.new
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
15
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
16 # for debug
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
17 # (env;echo "1=$1") | Mail -s pop3access yuuji
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
18
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
19 case $0 in
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
20 *record)
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
21 echo "tcp-env : $RELAYCLIENT : setenv = RELAYCLIENT" >> $ALLOWTMP.1
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
22 ;;
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
23 *age)
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
24 rm -f $ALLOWTMP.2
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
25 [ -f $ALLOWTMP.1 ] && mv -f $ALLOWTMP.1 $ALLOWTMP.2
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
26 ;;
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
27 *)
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
28 # else generate master hosts.allow file
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
29 ;;
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
30 esac
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
31 touch $ALLOWTMP.1 $ALLOWTMP.2
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
32 echo "#
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
33 # DO NOT EDIT THIS FILE!
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
34 # This file is generated from $ALLOWSRC file.
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
35 # Edit it!
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
36 #" > $ALLOWNEW
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
37 (cat $ALLOWTMP.[12] | sort -u; cat $ALLOWSRC) >> $ALLOWNEW
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
38 /bin/mv -f $ALLOWNEW $ALLOW
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
39
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
40 # pop3-{age,update,record} for tcp_wrappers ends here
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
41 # The following section is the sample routine for tcpserver(ucsp-tcp)
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
42 # If you use tcpserver, replace the above section after "case $0...esac"
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
43 # by the following section.
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
44 # Sample code was contributed by pirozeau(pirozeau@banana-fish.com).
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
45
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
46 #TCPREMOTEIP=${TCPREMOTEIP:-undefined}
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
47 #RELAYCLIENT=${RELAYCLIENT:-$TCPREMOTEIP}
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
48 #ALLOW=/usr/local/etc/smtprule
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
49 #case $0 in
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
50 # *record)
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
51 # echo "$RELAYCLIENT:allow,RELAYCLIENT=\"\"" >> $ALLOWTMP.1
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
52 # ;;
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
53 # *age)
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
54 # rm -f $ALLOWTMP.2
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
55 # [ -f $ALLOWTMP.1 ] && mv -f $ALLOWTMP.1 $ALLOWTMP.2
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
56 # ;;
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
57 # *)
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
58 # # else generate master tcprule file
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
59 # ;;
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
60 #esac
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
61 #touch $ALLOWTMP.1 $ALLOWTMP.2
28a55bc1110c [mq]: imapext
yuuji@gentei.org
parents:
diff changeset
62 #(cat $ALLOWTMP.[12] | sort -u; cat ${ALLOW}) | /usr/local/bin/tcprules ${ALLOW}.cdb ${ALLOW}.tmp

yatex.org