Mercurial > hgrepos > hgweb.cgi > imapext
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/APOPtools/pop3-age Mon Sep 14 19:23:11 2009 +0900 @@ -0,0 +1,62 @@ +#!/bin/sh - +# A sample "POP before SMTP"-enabler script for tcp_wrappers +# This script should be installed in /usr/local/etc +# If you are thinking of using this script on heavily loaded host, +# you had better to choose tcpserver instead of tcp_wrappers. +# +ALLOWTMP="/var/log/ATMP" +if [ -f /usr/local/etc/hosts.allow ]; then + ALLOW="/usr/local/etc/hosts.allow" +else + ALLOW=/etc/hosts.allow +fi +ALLOWSRC=${ALLOW}.src +ALLOWNEW=${ALLOW}.new + +# for debug +# (env;echo "1=$1") | Mail -s pop3access yuuji + +case $0 in + *record) + echo "tcp-env : $RELAYCLIENT : setenv = RELAYCLIENT" >> $ALLOWTMP.1 + ;; + *age) + rm -f $ALLOWTMP.2 + [ -f $ALLOWTMP.1 ] && mv -f $ALLOWTMP.1 $ALLOWTMP.2 + ;; + *) + # else generate master hosts.allow file + ;; +esac +touch $ALLOWTMP.1 $ALLOWTMP.2 +echo "# +# DO NOT EDIT THIS FILE! +# This file is generated from $ALLOWSRC file. +# Edit it! +#" > $ALLOWNEW +(cat $ALLOWTMP.[12] | sort -u; cat $ALLOWSRC) >> $ALLOWNEW +/bin/mv -f $ALLOWNEW $ALLOW + +# pop3-{age,update,record} for tcp_wrappers ends here +# The following section is the sample routine for tcpserver(ucsp-tcp) +# If you use tcpserver, replace the above section after "case $0...esac" +# by the following section. +# Sample code was contributed by pirozeau(pirozeau@banana-fish.com). + +#TCPREMOTEIP=${TCPREMOTEIP:-undefined} +#RELAYCLIENT=${RELAYCLIENT:-$TCPREMOTEIP} +#ALLOW=/usr/local/etc/smtprule +#case $0 in +# *record) +# echo "$RELAYCLIENT:allow,RELAYCLIENT=\"\"" >> $ALLOWTMP.1 +# ;; +# *age) +# rm -f $ALLOWTMP.2 +# [ -f $ALLOWTMP.1 ] && mv -f $ALLOWTMP.1 $ALLOWTMP.2 +# ;; +# *) +# # else generate master tcprule file +# ;; +#esac +#touch $ALLOWTMP.1 $ALLOWTMP.2 +#(cat $ALLOWTMP.[12] | sort -u; cat ${ALLOW}) | /usr/local/bin/tcprules ${ALLOW}.cdb ${ALLOW}.tmp