Annotation of researchv10dc/cmd/upas/config/smtponly/route, revision 1.1.1.1

1.1       root        1: #!/bin/sh
                      2: PATH=/bin:/usr/bin:/usr/lib/upas; export PATH
                      3: sender=$1;shift
                      4: system=$1;shift
                      5: sys=`cat /etc/whoami`
                      6: 
                      7: # save the mail
                      8: cat > /tmp/ur$$ || exit 1
                      9: 
                     10: #
                     11: # Try smtp via datakit.
                     12: # 
                     13: mydname=`qns value dk $sys,name`
                     14: hisdname=`qns value dk $system,name | egrep 'nj/((mercury|astro|phone)/.*|garage/(europa|bartok)$|zither/trevor$)'|egrep -v 'nj/astro/3k|nj/astro/arpa|nj/mercury/mharit'`
                     15: case $hisdname in
                     16: "")    ;;
                     17: *)     case $mydname in
                     18:        "")     ;;
                     19:        *)      smtpqer -u -a dk!$hisdname!smtp $sender $system $* < /tmp/ur$$
                     20:                rv=$?
                     21:                rm -f /tmp/ur$$
                     22:                exit $rv ;;
                     23:        esac ;;
                     24: esac
                     25: 
                     26: #
                     27: # Try queuing via uucp
                     28: #
                     29: uux - -a "$sender" "$system!rmail" "($*)" < /tmp/ur$$ &&
                     30:        rm -f /tmp/ur$$ &&
                     31:        exit 0
                     32: 
                     33: #
                     34: # Try queuing smtp via internet.
                     35: # 
                     36: myiname=`qns value dom $sys,dom`
                     37: lsystem=`echo $system | tr [A-Z] [a-z]`
                     38: hisiname=`(qns value dom $lsystem,dom |
                     39:        egrep 'tempo|mercury|phone|astro|lc|research') |
                     40:        sed 's/\.$//' || qns value dom $lsystem,dom tcpsmtp,svc`
                     41: case $hisiname in
                     42: "")    ;;
                     43: *)     case $myiname in
                     44:        "")     ;;
                     45:        *)      smtpqer $sender $hisiname $* < /tmp/ur$$
                     46:                rv=$?
                     47:                rm -f /tmp/ur$$
                     48:                exit $rv ;;
                     49:        esac ;;
                     50: esac
                     51: 
                     52: # get gateway system
                     53: gateway=`cat /usr/lib/upas/gateway`
                     54: case $gateway in
                     55: "") gateway=research ;;
                     56: esac
                     57: case $sys in
                     58: $gateway) rm -f /tmp/ur$$
                     59:          echo no route from gateway > /dev/stderr
                     60:          exit 1
                     61: esac
                     62: 
                     63: # expand the destination
                     64: expdest=
                     65: for i in $*; do expdest="$expdest $system!$i"; done
                     66: 
                     67: #
                     68: # Try smtp via datakit to gateway.
                     69: # 
                     70: hisdname=`qns value dk $gateway,name | egrep 'nj/((mercury|astro|phone)/.*|garage/(europa|bartok)$|zither/trevor$)'`
                     71: case $hisdname in
                     72: "")    ;;
                     73: *)     case $mydname in
                     74:        "")     ;;
                     75:        *)      smtpqer -u -a dk!$hisdname!smtp $sender $gateway $expdest < /tmp/ur$$
                     76:                rv=$?
                     77:                rm -f /tmp/ur$$
                     78:                exit $rv ;;
                     79:        esac ;;
                     80: esac
                     81: 
                     82: #
                     83: # Try smtp via internet to gateway.
                     84: # 
                     85: myiname=`qns value dom $sys,dom`
                     86: hisiname=`qns value dom $gateway,dom'`
                     87: case $hisiname in
                     88: "")            ;;
                     89: att.att.com)   ;;
                     90: *)     case $myiname in
                     91:        "")     ;;
                     92:        *)      smtpqer -u $sender $gateway $expdest < /tmp/ur$$
                     93:                rv=$?
                     94:                rm -f /tmp/ur$$
                     95:                exit $rv ;;
                     96:        esac ;;
                     97: esac
                     98: 
                     99: #
                    100: # Try queuing via uucp if all else fails
                    101: #
                    102: uux - -a "$sender" "$gateway!rmail" "($expdest)" < /tmp/ur$$
                    103: 
                    104: rv=$?
                    105: rm -f /tmp/ur$$
                    106: exit $rv

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.