9 date 93.09.01.22.29.10; author jromine; state Exp;
14 date 93.09.01.22.27.24; author jromine; state Exp;
19 date 92.11.05.16.59.39; author jromine; state Exp;
24 date 92.02.04.00.00.37; author jromine; state Exp;
29 date 92.02.03.17.50.19; author jromine; state Exp;
34 date 92.01.31.21.37.07; author jromine; state Exp;
39 date 92.01.24.00.35.28; author jromine; state Exp;
44 date 90.04.05.15.28.59; author sources; state Exp;
49 date 90.04.05.14.42.15; author sources; state Exp;
54 date 90.03.17.09.55.46; author sources; state Exp;
59 date 90.03.17.09.55.12; author sources; state Exp;
70 @note mhlibdir subject to change
73 @/* config.c - master MH configuration file */
75 static char ident[] = "@@(#)$Id: config.c,v 1.10 1993/09/01 22:27:24 jromine Exp jromine $";
90 #define binpath(file) "@@(MHBINPATH)/"#file
91 #define etcpath(file) "@@(MHETCPATH)/"#file
93 #define binpath(file) "@@(MHBINPATH)/file"
94 #define etcpath(file) "@@(MHETCPATH)/file"
97 static char Config[] = "@@(#)Config: @@(MHCONFIGFILE)";
105 struct passwd *getpwnam ();
112 static char lpath[BUFSIZ];
133 if (cp = index (pp = file + 1, '/'))
138 if (pw = getpwnam (pp))
146 (void) sprintf (lpath, "%s/%s", pp, cp ? cp : "");
150 if (access (lpath, 04) != NOTOK)
151 return lpath; /* else fall */
156 if (access ((cp = m_mailpath (file)), 04) != NOTOK)
160 (void) sprintf (lpath, etcpath (%s), file);
161 return (access (lpath, 04) != NOTOK ? lpath : file);
167 * Standard yes/no switches structure
170 struct swit anoyes[] = {
182 char *components = "components";
183 char *current = "cur";
184 char *defalt = "inbox";
185 char *digestcomps = "digestcomps";
186 char *distcomps = "distcomps";
187 char *draft = "draft";
188 char *forwcomps = "forwcomps";
189 char *inbox = "inbox";
190 char *mh_defaults = etcpath (mh.profile);
191 char *mh_profile = ".mh_profile";
192 char *mhlformat = "mhl.format";
193 char *mhlforward = "mhl.forward";
194 char *nsequence = "Sequence-Negation";
195 char *pfolder = "Current-Folder";
196 char *psequence = "Previous-Sequence";
197 char *rcvdistcomps = "rcvdistcomps";
198 char *replcomps = "replcomps";
199 char *usequence = "Unseen-Sequence";
200 char *mhlibdir = "@@(MHETCPATH)"; /* NB: this will change */
204 * MH not-so constants
207 char *context = "context";
209 char *mh_seq = ".mh_sequences";
219 char ctxflags; /* status of user's context */
221 char *invo_name; /* pgm invocation name */
222 char *mypath; /* user's $HOME */
223 char *defpath; /* pathname of user's profile */
224 char *ctxpath; /* pathname of user's context */
226 struct node *m_defs; /* profile/context structure */
236 * mhl runs this program as a visual-end.
239 char *faceproc = NULL;
243 * This program is usually called directly by users, but it is
244 * also invoked by the post program to process an "fcc".
247 char *fileproc = binpath (refile);
251 * This program is called to incorporate messages into a folder.
254 char *incproc = binpath (inc);
258 * When a user runs an MH program for the first time, this program
259 * is called to create his MH profile, and mail directory.
262 char *installproc = etcpath (install-mh);
266 * This is the program invoked by a "list" response to "What now?"
267 * whereas, showproc is the program invoked by show, next, prev.
271 char *lproc = "/usr/ucb/more";
278 * This is the path for the Bell equivalent mail program.
281 char *mailproc = binpath (mhmail);
285 * mhl runs this program as a front-end.
289 char *moreproc = "/usr/ucb/more";
291 char *moreproc = MORE;
296 * This program is mhl - the nifty message lister
299 char *mhlproc = etcpath (mhl);
303 * This is the super handy BBoard reading program, which is really just the MH
307 char *mshproc = binpath (msh);
311 * This program is called to pack a folder.
314 char *packproc = binpath (packf);
318 * This is the delivery program called through send to
319 * actually deliver mail to users. This is the interface to
323 #if BERK && SENDMTS && !SMTP
324 char *postproc = etcpath (spost);
326 char *postproc = etcpath (post);
331 * This program is called to remove a folder.
334 char *rmfproc = binpath (rmf);
338 * This program is called to remove a message by rmm or refile -nolink.
339 * It's usually empty, which means to rename the file to a backup name.
342 char *rmmproc = NULL;
346 * This program is usually called by the user's whatnowproc, but it
347 * may also be called directly to send a message previously composed.
350 char *sendproc = binpath (send);
354 * This program is called to list messages by the show program.
355 * By setting showproc to mhl, the user can run mhl instead.
359 char *showproc = "/usr/ucb/more";
361 char *showproc = MORE;
366 * This program is called under stand-alone MH to deliver a message to
367 * a local user. Under other MTS's it can be used to emulate a
368 * MMDF-II .maildelivery mechanism.
371 char *slocalproc = etcpath (slocal);
375 * This program is called by vmh as the back-end to the window management
379 char *vmhproc = binpath (msh);
383 * This program is called after comp, et. al., have built a draft
386 char *whatnowproc = binpath (whatnow);
390 * This program is called to list/validate the addresses in a message.
393 char *whomproc = binpath (whom);
398 * This is the editor invoked by the various message composition
399 * programs. It SHOULD be a 2-D scope editor, such as Rand's ned
400 * or Berkeley's ex, but any editor will work. We use prompter as
401 * the default, since with -prepend it works just fine with forw.
404 char *sysed = "@@(MHEDITOR)";
408 * This is the MH alias file.
411 char *AliasFile = etcpath (MailAliases);
421 * Folders (directories) are created with this protection (mode)
425 #define FOLDPROT "0711"
426 #endif /* not FOLDPROT */
428 char *foldprot = FOLDPROT;
432 * Every NEW message will be created with this protection. When a
433 * message is filed it retains its protection, so this only applies
434 * to messages coming in through inc.
438 #define MSGPROT "0644"
439 #endif /* not MSGPROT */
441 char *msgprot = MSGPROT;
447 @add mhlibdir for mhparam
452 static char ident[] = "@@(#)$Id: config.c,v 1.9 1992/11/05 16:59:39 jromine Exp jromine $";
455 char *mhlibdir = "@@(MHETCPATH)";
466 static char ident[] = "@@(#)$Id: config.c,v 1.8 1992/02/04 00:00:37 jromine Exp jromine $";
478 static char ident[] = "@@(#)$Id: config.c,v 1.7 1992/02/03 17:50:19 jromine Exp jromine $";
539 static char ident[] = "@@(#)$Id: config.c,v 1.6 1992/01/31 21:37:07 jromine Exp jromine $";
551 static char ident[] = "@@(#)$Id: config.c,v 1.5 1992/01/24 00:35:28 jromine Exp jromine $";
559 @add config file string for "what"
564 static char ident[] = "@@(#)$Id: config.c,v 1.4 1990/04/05 15:28:59 sources Exp jromine $";
567 #if defined(__STDC__) && !defined(__HIGHC__)
585 static char ident[] = "@@(#)$Id:$";
597 static char ident[] = "$Id:";
603 @ANSI C fix from jeff honig