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

Rewrite rule




Most of our domain is simple.  If it's local, deliver locally.  If it's 
smtp, use smtp, if it's anything else, punt, and let the university 
server handle it.

Now our VAX is on SPAN (Space Physics Analysis Network).  It runs 
Multinet, which gives it smtp capability, and my professors have set up 
automatic forwarding so that their SPAN mail comes to their unix account.

Addresses from other SPAN machines have the form, 
"HOSTNAME::USERNAME"@canedm.space.ualberta.ca.

At present a reply to this address doesn't work, because rrouter thinks 
that this is a local address to be delivered locally.

I've hacked at canonicalize so that it puts the address in this form 
instead of changing it to ! format.  (I'm also trying to set it up so 
that a HOST::NAME address will get thrown at our vax (canedm) for 
forwarding on SPAN.)

However, there is something I don't understand about regex's as used by zsh.

I've added the following rule set to rrouter

	(.+)::(.+)@(.*) # SPAN address. smtp to canedm
		return (((smtp - "$address" $A)))

The following is done with trace functions and trace compare.
z# rrouter STEVAX::KAMIDE
    rrouter STEVAX::KAMIDE
        comparing ^(.*)<(.*)$ and 'STEVAX::KAMIDE'
        comparing ^(.*)>(.*)$ and 'STEVAX::KAMIDE'
        comparing ^.*$ and 'STEVAX::KAMIDE'
        canonicalize STEVAX::KAMIDE
            comparing ^<>$ and 'STEVAX::KAMIDE'
            comparing ^:include:.+$ and 'STEVAX::KAMIDE'
            comparing ^(.*)(bitnet)$ and 'STEVAX::KAMIDE'
            comparing ^(.*)(uucp)$ and 'STEVAX::KAMIDE'
            comparing ^(.*)<(.*)>(.*)$ and 'STEVAX::KAMIDE'
            comparing ^(.+)::(.+)$ and 'STEVAX::KAMIDE'
            echo "STEVAX::KAMIDE"@canedm.space.ualberta.ca
            return (return) <0>
?=1
?=1
?=1
?=1
        comparing ^(.*)<@(.+)\.uucp>(.*)$ and 
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^@$ and '"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^(.*)<@\[(.)\]>(.*)$ and 
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^(.*)<@(.*)\.>(.*)$ and 
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^(.*)<@(.*)(space.ualberta.ca)>(.*)$ and 
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^<@(space.ualberta.ca)>[:,](.+@.+)$ and 
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^(.*)<@(.+)>(.*)$ and 
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^<@>.(.*)$ and '"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^(.*)<@>$ and '"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
?=1
?=1
        comparing ^(.*)<@(.+)>(.*)$ and 
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^[/|].+$ and '"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^[^.:](\.[^.])+$ and 
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^(.+)::(.+)@(.*)$ and 
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        comparing ^.*$ and '"STEVAX::KAMIDE"@canedm.space.ualberta.ca'
        list (list local - '"STEVAX::KAMIDE"@canedm.space.ualberta.ca') <0>
        routeuser (local - '"STEVAX::KAMIDE"@canedm.space.ualberta.ca')
...
	Munch rest.

As you can see canonicalize appears to be working properly.
I don't understand why this match
        comparing ^(.+)::(.+)@(.*)$ and
'"STEVAX::KAMIDE"@canedm.space.ualberta.ca'

fails.



=> Sherwood Botsford                   sherwood@space.ualberta.ca <= 
=> University of Alberta         Lab Manager, Space Physics Group <=         
=> tel:403 492-3713                             fax: 403 492-4256 <=