1 diff -u mutt-1.5.3.orig/PATCHES mutt-1.5.3/PATCHES
2 --- mutt-1.5.3.orig/PATCHES 2002-12-17 10:47:20.000000000 +0100
3 +++ mutt-1.5.3/PATCHES 2003-01-14 18:21:16.000000000 +0100
5 +Debian.Md.etc_mailname_gethostbyname
6 diff -u mutt-1.5.3.orig/init.c mutt-1.5.3/init.c
7 --- mutt-1.5.3.orig/init.c 2002-12-11 16:13:49.000000000 +0100
8 +++ mutt-1.5.3/init.c 2003-01-14 18:27:54.000000000 +0100
12 #include <sys/utsname.h>
17 @@ -1748,6 +1749,31 @@
21 +int getmailname(char *s, size_t l)
27 + if ((f = fopen ("/etc/mailname", "r")) == NULL)
30 + if (fgets (tmp, 510, f) != NULL) {
31 + while (*p && !ISSPACE(*p) && l > 0) {
46 void mutt_init (int skip_sys_rc, LIST *commands)
49 @@ -1816,10 +1842,25 @@
50 Hostname = mutt_substrdup (utsname.nodename, p);
52 strfcpy (buffer, p, sizeof (buffer)); /* save the domain for below */
53 + Fqdn = safe_strdup (utsname.nodename);
56 Hostname = safe_strdup (utsname.nodename);
58 + /* if /etc/mailname exists use it and ignore everything else */
59 + if (getmailname(buffer, sizeof (buffer)) != -1)
60 + Fqdn = safe_strdup(buffer);
62 + /* try gethostbyname(3) if /etc/mailname does not exists */
66 + if ((hp = gethostbyname(Hostname)))
67 + Fqdn = safe_strdup(hp->h_name);
74 if (!p && getdnsdomainname (buffer, sizeof (buffer)) == -1)