# Usenet
#
# Mail to newsgroups.  The newsgroup name is intended to be in . format
# instead of -, so you can look it up in the news active file.

#require
provide usenet

# optional: newsgroup database in news.group format
if [ -f $MAILVAR/db/active.pag ]; then

#| If the usenet protocol is loaded, we recognize mail to newsgroup names
#| by looking them up in the active file.  If the real active file is on
#| another system, this database should be a copy on local disk.  This
#| avoids the mailer hanging due to outages of the news server.

	relation -lmt ndbm -f $MAILVAR/db/active -b newsgroup
else
	newsgroup () { return 1 }
fi

usenet_neighbour () {
	return 1
}

localpart (address) {

#| This extracts the newsgroup name from the address.

	address=$(uucproute $address)
	sift $address in
	.*!([^!])	return \1 ;;
	.*		return $address ;;
	tfis
}	# end of localpart

