rem: DEBUGCONDUIT << __FUNCTION__ << ": EDN=" << config.readEntry("explicitDomainName", "") << endl; DEBUGCONDUIT << __FUNCTION__ << ": useEDN=" << useExplicitDomainName << endl;
context: QString getFQDomainName (const KConfig& config){	QString fqDomainName;	// Has the user given an explicit domain name?	int useExplicitDomainName = 0;	if (!config.readEntry("explicitDomainName", "").isEmpty())		useExplicitDomainName = 1;	// Or was it given in the MAILDOMAIN environment variable?	if (!useExplicitDomainName && getenv ("MAILDOMAIN"))		useExplicitDomainName = 2;	DEBUGCONDUIT << __FUNCTION__ << ": EDN=" << config.readEntry("explicitDomainName", "") << endl;	DEBUGCONDUIT << __FUNCTION__ << ": useEDN=" << useExplicitDomainName << endl;	if (useExplicitDomainName > 0) {		// User has provided the FQDN either in config or in environment.		if (useExplicitDomainName == 2) {			fqDomainName = "$MAILDOMAIN";		} else {			// Use explicitly configured FQDN.			// The domain name can also be the name of an environment variable.			fqDomainName = config.readEntry("explicitDomainName", "$MAILDOMAIN");			DEBUGCONDUIT << __FUNCTION__ << ": got from config" << endl;		}		// Get FQDN from environment, from given variable.		if (fqDomainName.left(1) == "$") {			QString envVar = fqDomainName.mid (1);			char* envDomain = getenv (envVar.latin1());			if (envDomain) {				fqDomainName = envDomain;				DEBUGCONDUIT << __FUNCTION__ << ": got from env" << endl;			} else {				// Ummh... It didn't exist, fall back to using system domain name				useExplicitDomainName = false;				DEBUGCONDUIT << __FUNCTION__ << ": Promised domain name environment variable "							 << fqDomainName << " wasn't available." << endl;			}		}	}	if (useExplicitDomainName == 0) {		// We trust in the system FQDN domain name#ifdef HAVE_GETDOMAINNAME		char namebuffer [1024];		int ret;#ifdef __osf__		// OSF has a getdomainname that returns void.		//		//		getdomainname(namebuffer,1024);		ret=0;#else		ret = getdomainname (namebuffer, 1024);#endif		fqDomainName = namebuffer;		if (ret)			kdWarning() << __FUNCTION__ << ": getdomainname: " << strerror(errno) << endl;		else			DEBUGCONDUIT << __FUNCTION__ << ": Got domain name " << namebuffer  << endl;#else		struct utsname u;		uname (&u);		fqDomainName = u.nodename;		DEBUGCONDUIT << __FUNCTION__ << ": Got uname.nodename " << u.nodename << endl;#endif	}	return fqDomainName;}