Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/mail/lib/altalias

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# altalias guest-domain user - look up aliases in a names file for a guest domain
# To use:
#	• Make an "namefiles.alt" containing only "names.local".
#	• Make a names.<whatever>, in the same format as names.local.
#	• Tell /mail/lib/rewrite to use altalias to translate that domain, eg:
#	(kremvax\.org)!(.+)		translate	"/mail/lib/altalias '\1' '\2'"

# use only the guest names file (and not the user's!)
rfork n
bind /mail/lib/namefiles.alt /mail/lib/namefiles
bind /mail/lib/names.`{echo $1 | tr A-Z a-z} /mail/lib/names.local
bind /n/none /mail/box

# bounce unknown addresses and make the guest domain the default
upas/aliasmail $2 | sed '
	s/^local!/error!/
	s/^here!/local!/
	s/^[^!@]+$/'$1'!&/
'

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].