[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

enchanced uucproute function



Hi,

	As some might have noticed I am working on refined set of
zmailer configuration files... I just have found that uucproute
function sometimes does not really do what it is suppose to:

z# uucproute machine!alexis%local_machine@relay.nl
local_machine!machine!relay.nl!alexis


	I've got slightly enchanced uucproute function attached
below. It is not througly tested yet, so use at your own risk.

							alexis

PS Do we really get unquoted pipes and stuff? Cant we pass addresses
   withing routing/rewriting in sctrictly canonicalized form?

#
# Turns any address into pure bang notation.
#
uucproute (address) {
        ssift "$address" in
        ((\|.+)|(/.+)|(:include:.+))            # unqouted pipes and files
                return "$address"               # pass through
                ;;
        tfiss 
 
        tsift "$address" in
        (.*)<@(.*)>(.*)                         # defocus
                address="\1@\2\3"
                ;;
        ([^@]*)                                 # local part only
                address="@:\1"
                ;;
        ([^@].*)@(.*)                           # make a route address
                address="@\2:\1"
                ;;
        @(.*)[,:]@(.*)                          # turn into semi bang path
                address="@\1!\2"
                continue
                ;;
        @(.*)[,:](.+)@(.*)                      # turn into semi bang path 
                address="@\1!\3:\2"
                continue
                ;;
        @(.*):([^!]*)!(.*)                      # move pure bang path into path
                address="@\1!\2:\3"
                continue
                ;;
        @(.*):(.*)%(.*)                         # take care of '%'
                address="@\1!\3:\2"
                continue 
                ;;
        @?!?(.*):(.*)                           # clean up
                address="\1!\2" 
                continue
                ;;
        tfist
 
        return "$address"
}

-- 
		You can't teach a new mouse old clicks