xref: /csrg-svn/libexec/bugfiler/bug.h (revision 33416)
1 /*
2  * Copyright (c) 1986, 1987 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that this notice is preserved and that due credit is given
7  * to the University of California at Berkeley. The name of the University
8  * may not be used to endorse or promote products derived from this
9  * software without specific prior written permission. This software
10  * is provided ``as is'' without express or implied warranty.
11  *
12  *	@(#)bug.h	5.6 (Berkeley) 02/01/88
13  */
14 
15 #define BUGS_HOME	"owner-bugs@ucbvax.Berkeley.EDU"
16 #define BUGS_ID		"bugs"
17 #define MAIL_CMD	"/usr/lib/sendmail -i -t -F \"Bugs Bunny\" -f owner-bugs"
18 
19 /*
20  * the METOO definition has the bugfiler exit with an error (-1) status
21  * if there's a problem.  This causes sendmail to send off a copy of the
22  * report (as failed mail) to the "owner" of the mail alias that executed
23  * the bugfiler.  This is great if you would have otherwise lost the bug
24  * report.  It's not so great if you get a whole bunch of mail that you
25  * really don't want.
26  */
27 #define METOO
28 
29 /* files */
30 #define ACK_FILE	"bug:ack"		/* acknowledge file */
31 #define DIST_FILE	"bug:redist"		/* redistribution file */
32 #define ERROR_FILE	"log"			/* error file */
33 #define LOCK_FILE	"bug:lock"		/* lock file name */
34 #define SUMMARY_FILE	"summary"		/* summary file */
35 #define TMP_BUG		"errors/BUG_XXXXXX"	/* tmp bug report */
36 #define TMP_DIR		"errors"		/* tmp directory */
37 
38 #define CHN		(char *)NULL	/* null arg string */
39 #define COMMENT		'#'		/* comment in redist file */
40 #define EOS		(char)NULL	/* end of string */
41 #define ERR		-1		/* error return */
42 #define MAXLINELEN	200		/* max line length in message */
43 #define NO		0		/* no/false */
44 #define OK		0		/* okay return */
45 #define YES		1		/* yes/true */
46 
47 typedef struct {
48 	short	found,			/* line number if found */
49 		redist;			/* if part of redist headers */
50 	int	(*valid)();		/* validation routine */
51 	short	len;			/* length of tag */
52 	char	*tag,			/* leading tag */
53 		*line;			/* actual line */
54 } HEADER;
55 extern HEADER	mailhead[];
56 
57 #define DATE_TAG	0		/* "Date:" offset */
58 #define FROM_TAG	1		/* "From " offset */
59 #define CFROM_TAG	2		/* "From:" offset */
60 #define INDX_TAG	3		/* "Index:" offset */
61 #define MSG_TAG		4		/* "Message-Id:" offset */
62 #define RPLY_TAG	5		/* "Reply-To:" offset */
63 #define RET_TAG		6		/* "Return-Path:" offset */
64 #define SUBJ_TAG	7		/* "Subject:" offset */
65 #define TO_TAG		8		/* "To:" offset */
66 #define APPAR_TO_TAG	9		/* "Apparently-To:" offset */
67 
68 /* so sizeof doesn't return 0 */
69 #include <sys/param.h>
70 #include <sys/dir.h>
71 extern char	bfr[MAXBSIZE],			/* general I/O buffer */
72 		dir[MAXNAMLEN],			/* subject and folder */
73 		folder[MAXNAMLEN],
74 		tmpname[sizeof(TMP_BUG) + 5];	/* temp bug file */
75