-
- Username = str_dup (pw->pw_name);
- if (!Homedir)
- Homedir = str_dup (pw->pw_dir);
-
- Realname = str_dup (mutt_gecos_name (rnbuf, sizeof (rnbuf), pw));
- Shell = str_dup (pw->pw_shell);
- }
- else {
- if (!Homedir) {
- mutt_endwin (NULL);
- fputs (_("unable to determine home directory"), stderr);
- exit (1);
- }
- if ((p = getenv ("USER")))
- Username = str_dup (p);
- else {
- mutt_endwin (NULL);
- fputs (_("unable to determine username"), stderr);
- exit (1);
- }
- Shell = str_dup ((p = getenv ("SHELL")) ? p : "/bin/sh");
- }
-
- debug_start(Homedir);
-
- /* And about the host... */
- uname (&utsname);
- /* some systems report the FQDN instead of just the hostname */
- if ((p = strchr (utsname.nodename, '.'))) {
- Hostname = str_substrdup (utsname.nodename, p);
- p++;
- strfcpy (buffer, p, sizeof (buffer)); /* save the domain for below */
- }
- else
- Hostname = str_dup (utsname.nodename);
-
-#ifndef DOMAIN
-#define DOMAIN buffer
- if (!p && getdnsdomainname (buffer, sizeof (buffer)) == -1)
- Fqdn = str_dup ("@");
- else
-#endif /* DOMAIN */
- if (*DOMAIN != '@') {
- Fqdn = mem_malloc (str_len (DOMAIN) + str_len (Hostname) + 2);
- sprintf (Fqdn, "%s.%s", NONULL (Hostname), DOMAIN); /* __SPRINTF_CHECKED__ */
- }
- else
- Fqdn = str_dup (NONULL (Hostname));
-
-#ifdef USE_NNTP
- {
- FILE *f;
- char *i;
-
- if ((f = safe_fopen (SYSCONFDIR "/nntpserver", "r"))) {
- buffer[0] = '\0';
- fgets (buffer, sizeof (buffer), f);
- p = (char*) &buffer;
- SKIPWS (p);
- i = p;
- while (*i && (*i != ' ') && (*i != '\t') && (*i != '\r')
- && (*i != '\n'))
- i++;
- *i = '\0';
- NewsServer = str_dup (p);
- fclose (f);
- }
- }
- if ((p = getenv ("NNTPSERVER")))
- NewsServer = str_dup (p);
-#endif
-
- if ((p = getenv ("MAIL")))
- Spoolfile = str_dup (p);
- else if ((p = getenv ("MAILDIR")))
- Spoolfile = str_dup (p);
- else {
-#ifdef HOMESPOOL
- mutt_concat_path (buffer, NONULL (Homedir), MAILPATH, sizeof (buffer));
-#else
- mutt_concat_path (buffer, MAILPATH, NONULL (Username), sizeof (buffer));
-#endif
- Spoolfile = str_dup (buffer);
- }
-
- if ((p = getenv ("MAILCAPS")))
- MailcapPath = str_dup (p);
- else {
- /* Default search path from RFC1524 */
- MailcapPath =
- str_dup ("~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR
- "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");