1 diff -Nur mutt-1.5.11.orig/configure.ac mutt-1.5.11/configure.ac
2 --- mutt-1.5.11.orig/configure.ac 2006-05-11 23:23:13.000000000 +0200
3 +++ mutt-1.5.11/configure.ac 2006-05-12 00:58:13.000000000 +0200
9 +AC_ARG_WITH(home-etc, [ --with-home-etc[=PFX] Use HOME-ETC library to allow user keeping it's configuration files in a non-standard place ],
11 + if test "$with_home_etc" != "no"
13 + if test "$with_home_etc" != "yes"
15 + LDFLAGS="$LDFLAGS -L$with_home_etc/lib"
20 + AC_CHECK_LIB(home_etc, get_home_etc_static,,
21 + AC_MSG_ERROR([could not find libhome_etc]),)
23 + AC_CHECK_HEADERS(home_etc.h)
25 + MUTTLIBS="$MUTTLIBS -lhome_etc"
27 + AC_DEFINE(USE_HOME_ETC,1,
28 + [ Define if want to use the HOME-ETC library. ])
32 +AM_CONDITIONAL(USE_HOME_ETC, test x$need_home_etc = xyes)
34 if test "$need_md5" = "yes"
36 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS md5c.o"
37 diff -Nur mutt-1.5.11.orig/doc/mutt.man mutt-1.5.11/doc/mutt.man
38 --- mutt-1.5.11.orig/doc/mutt.man 2005-08-18 21:38:54.000000000 +0200
39 +++ mutt-1.5.11/doc/mutt.man 2006-05-12 00:58:13.000000000 +0200
42 Full path of the user's spool mailbox. Commonly used when the spool
45 +Path to alternative configuration directory.
50 Specifies the editor to use when composing messages.
53 -.IP "~/.muttrc or ~/.mutt/muttrc"
54 +.IP "$HOME_ETC/.muttrc" or "$HOME_ETC/.mutt/muttrc" or "~/.muttrc" or "~/.mutt/muttrc"
55 User configuration file.
56 .IP "@sysconfdir@/Muttrc"
57 System-wide configuration file.
59 Temporary files created by Mutt.
61 +.IP "~/.mailcap or $HOME_ETC/.mailcap"
62 User definition for handling non-text MIME types.
63 .IP "@sysconfdir@/mailcap"
64 System definition for handling non-text MIME types.
66 +.IP "~/.mime.types or $HOME_ETC/.mime.types"
67 User's personal mapping between MIME types and file extensions.
68 .IP "@sysconfdir@/mime.types"
69 System mapping between MIME types and file extensions.
70 diff -Nur mutt-1.5.11.orig/init.c mutt-1.5.11/init.c
71 --- mutt-1.5.11.orig/init.c 2006-05-11 23:23:13.000000000 +0200
72 +++ mutt-1.5.11/init.c 2006-05-12 00:58:40.000000000 +0200
78 +#ifdef HAVE_HOME_ETC_H
79 +# include <home_etc.h>
80 +# define H_CFDIR _HEdir
82 +# define H_CFDIR Homedir
87 @@ -2334,7 +2339,21 @@
90 /* Default search path from RFC1524 */
91 - MailcapPath = safe_strdup ("~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");
93 +#define MAILCAPPATHS "~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap"
94 +#ifdef HAVE_HOME_ETC_H
96 + MailcapPath = safe_malloc (mutt_strlen (MAILCAPPATHS) + mutt_strlen (_HEdir) + 2);
97 + if (_HEdir != NULL && (mutt_strlen (_HEdir)) > 0)
98 + sprintf (MailcapPath, "%s:%s", _HEdir, MAILCAPPATHS); /* __SPRINTF_CHECKED__ */
100 + strcpy (MailcapPath, MAILCAPPATHS); /* __SPRCPY_CHECKED__ */
104 + MailcapPath = safe_strdup (MAILCAPPATHS);
109 Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/tmp");
110 @@ -2981,15 +2981,15 @@
114 - snprintf (buffer, sizeof(buffer), "%s/.muttrc-%s", NONULL(Homedir), MUTT_VERSION);
115 + snprintf (buffer, sizeof(buffer), "%s/.muttrc-%s", NONULL(H_CFDIR), MUTT_VERSION);
116 if (access(buffer, F_OK) == -1)
117 - snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(Homedir));
118 + snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(H_CFDIR));
119 if (access(buffer, F_OK) == -1)
120 - snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(Homedir), MUTT_VERSION);
121 + snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(H_CFDIR), MUTT_VERSION);
122 if (access(buffer, F_OK) == -1)
123 - snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(Homedir));
124 + snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(H_CFDIR));
125 if (access(buffer, F_OK) == -1) /* default to .muttrc for alias_file */
126 - snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(Homedir));
127 + snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(H_CFDIR));
130 Muttrc = safe_strdup (buffer);
131 @@ -2526,10 +2545,10 @@
135 - pathlen = strlen (Homedir) + sizeof("/.slrnfaces/")
136 + pathlen = strlen (H_CFDIR) + sizeof("/.slrnfaces/")
137 + strlen (u.nodename) + 30;
138 fifo = safe_malloc (pathlen);
139 - sprintf (fifo, "%s/.slrnfaces", Homedir);
140 + sprintf (fifo, "%s/.slrnfaces", H_CFDIR);
141 if (mkdir (fifo, 0700))
144 @@ -2544,7 +2563,7 @@
147 /* We'll abuse fifo filename memory here. It's long enough. */
148 - sprintf (fifo, "%s/.slrnfaces/README", Homedir);
149 + sprintf (fifo, "%s/.slrnfaces/README", H_CFDIR);
150 if ((fp = fopen (fifo, "w")) != NULL)
153 @@ -2560,7 +2579,7 @@
157 - status = snprintf (fifo, pathlen, "%s/.slrnfaces/%s.%ld", Homedir,
158 + status = snprintf (fifo, pathlen, "%s/.slrnfaces/%s.%ld", H_CFDIR,
159 u.nodename, (long)getpid());
162 diff -Nur mutt-1.5.11.orig/mutt_ssl.c mutt-1.5.11/mutt_ssl.c
163 --- mutt-1.5.11.orig/mutt_ssl.c 2005-08-03 11:17:46.000000000 +0200
164 +++ mutt-1.5.11/mutt_ssl.c 2006-05-12 00:58:13.000000000 +0200
166 #define HAVE_ENTROPY() (!access(DEVRANDOM, R_OK) || entropy_byte_count >= 16)
169 +#ifdef HAVE_HOME_ETC_H
170 +# include <home_etc.h>
171 +# define H_CFDIR _HEdir
173 +# define H_CFDIR Homedir
176 typedef struct _sslsockdata
180 /* load entropy from egd sockets */
182 add_entropy (getenv ("EGDSOCKET"));
183 - snprintf (path, sizeof(path), "%s/.entropy", NONULL(Homedir));
184 + snprintf (path, sizeof(path), "%s/.entropy", NONULL(H_CFDIR));
186 add_entropy ("/tmp/entropy");
188 diff -Nur mutt-1.5.11.orig/sendlib.c mutt-1.5.11/sendlib.c
189 --- mutt-1.5.11.orig/sendlib.c 2006-05-11 23:23:13.000000000 +0200
190 +++ mutt-1.5.11/sendlib.c 2006-05-12 00:58:13.000000000 +0200
192 #include <sys/wait.h>
195 +#ifdef HAVE_HOME_ETC_H
196 +# include <home_etc.h>
197 +# define H_CFDIR _HEdir
199 +# define H_CFDIR Homedir
202 #ifdef HAVE_SYSEXITS_H
203 #include <sysexits.h>
204 #else /* Make sure EX_OK is defined <philiph@pobox.com> */
207 /* Given a file with path ``s'', see if there is a registered MIME type.
208 * returns the major MIME type, and copies the subtype to ``d''. First look
209 - * for ~/.mime.types, then look in a system mime.types if we can find one.
210 - * The longest match is used so that we can match `ps.gz' when `gz' also
212 + * for either $HOME_ETC/.mime.types or ~/.mime.types, then look in a system
213 + * mime.types if we can find one. The longest match is used so that we can
214 + * match `ps.gz' when `gz' also exists.
217 int mutt_lookup_mime_type (BODY *att, const char *path)
222 - snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL(Homedir));
223 + snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL(H_CFDIR));
226 strfcpy (buf, SYSCONFDIR"/mime.types", sizeof(buf));