#!/usr/gnu/bin/perl --		# -*-Perl-*-
$ENV{"PATH"} = "/usr/lib/mail/surrcmd:/usr/bin:/bin";

if (open(RESOLV, "</etc/resolv.conf")) {
    while (<RESOLV>) {
	# GATEWAY is the name of our gateway as known to the MHS world
	if (/^domain\s+(\S+)/i) { printf "%s", $1; exit 0;}
	}
    close(RESOLV);
    }
if (open(MAILCNFG, "</etc/mail/mailcnfg")) {
    while (<MAILCNFG>) {
	# GATEWAY is the name of our gateway as known to the MHS world
	if (/^DOMAIN=(\S+)/i) { printf "%s", $1; exit 0;}
	}
    close(MAILCNFG);
    }
