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

Re: Aliases question

John Scharber writes:
> I would like to create an aliases for only one user in a domain and have the
> rest of the mail forward to the proper MX record, any ideals on how to do this ?

I use global aliases feature, like IDA sendmail. It may be added to
zmailer easily.

in cf/rrouter.cf :

  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

I use unordered file galiases, which looks like this:

user1@old.domain1   user1@new.domain1
user2@old.domain2   alias2@new.domain2

You may replace 'unordered' relation with sorted file or dbm database,
if you need many global aliases.

NB: this is for 2.2.1 version of zmailer. I believe, it will work
with any version, where sift is compatible, or you may substitute
sift with tsift. But rrouter.cf may look not the same.

Isn't the feature a solution to your problem?
Joint stock company "GVC Energeticy", North-Caucasian Branch, Pyatigorsk
Andrew Petrovich Kokarev, postmaster         andrew@skfgvc.pyatigorsk.su