PATCH to qualify primary_hostname

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Neal Becker
日付:  
To: exim-users
題目: PATCH to qualify primary_hostname
This simple patch is all that's needed so that primary_hostname will
default to the FQDN of your machine even if uname() gives just the
short name.

At least, this works fine for me.

*** readconf.c    1996/03/19 17:03:47    1.1
--- readconf.c    1996/03/19 17:07:02
***************
*** 1159,1165 ****
    struct utsname s;
    if (uname(&s) < 0)
      log_write(LOG_PANIC_DIE, "Failed to compute host name");
!   primary_hostname = string_copy(s.nodename);
    }


  if (qualify_domain_sender == NULL) 
--- 1159,1170 ----
    struct utsname s;
    if (uname(&s) < 0)
      log_write(LOG_PANIC_DIE, "Failed to compute host name");
!   if (strchr (s.nodename, ".") == 0) {
!     struct hostent *h = gethostbyname (s.nodename);
!     primary_hostname = string_copy (h->h_name);
!   }
!   else 
!     primary_hostname = string_copy(s.nodename);
    }


if (qualify_domain_sender == NULL)