[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Specific alias for routed email?
Bruce Sterling Woodcock writes:
> However, in looking in zmailer I don't see an obvious way to do this.
> I guess what I'd really like is some sort of configuration so we can
> apply some sort of "alias" expansion on all incoming email going through
> that machine, so we can redirect certain messages and not others.
> Something like a channel designation that would allow for filtering
> specific addresses...
This is beginning of my cf/rrouter.cf, implementing functionality
somewhat like IDA sendmail global aliases. It's not perfect
(address should exactly match one in galiases db to be replaced),
but it's simple one.
provide rrouter
envelopeinfo=(message-id "<$USER.interactive@$hostname>" now 0)
: ${UNRESOLVABLEACTION:='error unresolvable'}
if [ -f $MAILVAR/db/galiases ] ; then
relation -lmt unordered -f $MAILVAR/db/galiases glob_alias
else
glob_alias() { return 1 }
fi
rrouter (address, A) {
local tmp tee seenuucp
# Do global aliases expanding
$(get $A recipient) &&
sift "$address" in
.*|.* ;;
.*
tmp=$(glob_alias $address) &&
address=$tmp ;;
tfis
seenuucp=false
...
Here is fragment from db/galiases:
#Old address New address
hospital@hospit.stavropol.su aihastavropo@glas.apc.org
Now try this:
> telnet . 25
Trying 0.0.0.0...
Connected to ..
Escape character is '^]'.
220 harpy.skfgvc.pyatigorsk.su Server SMTP ready at Thu, 18 Jul 1996 13:01:19 +0400
expn hospital@hospit.stavropol.su
250 smtp delivery to glas.apc.org for <aihastavropo@glas.apc.org>
quit
221 harpy.skfgvc.pyatigorsk.su Out
--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Joint stock company "GVC Energeticy", North-Caucasian Branch, Pyatigorsk
Andrew Petrovich Kokarev, postmaster andrew@skfgvc.pyatigorsk.su