masqmail

changeset 333:0bd27f603910

Added debug level 9 for msgs to stderr during reading config See changes to man page, included in this changeset.
author markus schnalke <meillo@marmaro.de>
date Sat, 27 Aug 2011 16:54:14 +0200
parents 63efd381e27b
children 2c3242a360f0
files man/masqmail.conf.5 src/conf.c
diffstat 2 files changed, 26 insertions(+), 20 deletions(-) [+]
line diff
     1.1 --- a/man/masqmail.conf.5	Sat Aug 27 16:21:17 2011 +0200
     1.2 +++ b/man/masqmail.conf.5	Sat Aug 27 16:54:14 2011 +0200
     1.3 @@ -59,8 +59,14 @@
     1.4  \fBdebug_level = \fIn\fR
     1.5  
     1.6  Set the debug level.
     1.7 -Valid values are 0 to 6, increasing it further makes no difference.
     1.8 -Be careful if you set this as high as 5 or higher, the logs may very soon fill your hard drive.
     1.9 +Valid values are 0 to 6 and 9.
    1.10 +Be careful if you set this as high as 5 or higher,
    1.11 +the logs may very soon fill your hard drive.
    1.12 +Level 9 enables printing of debug messages to stderr during reading of
    1.13 +the config file.
    1.14 +The debug file comes available for the first time after this step.
    1.15 +Thus nothing but stderr is available.
    1.16 +Level 9 is almost never interesting.
    1.17  
    1.18  .TP
    1.19  \fBlog_dir = \fIfile\fR
     2.1 --- a/src/conf.c	Sat Aug 27 16:21:17 2011 +0200
     2.2 +++ b/src/conf.c	Sat Aug 27 16:54:14 2011 +0200
     2.3 @@ -62,7 +62,7 @@
     2.4  {
     2.5  	gchar **str;
     2.6  
     2.7 -	DEBUG(6) fprintf(stderr, "parse_boolean: %s\n", rval);
     2.8 +	DEBUG(9) fprintf(stderr, "parse_boolean: %s\n", rval);
     2.9  
    2.10  	str = true_strings;
    2.11  	while (*str) {
    2.12 @@ -100,7 +100,7 @@
    2.13  		fgets(buf, 255, fptr);
    2.14  		if (buf[0] && (buf[0] != '#') && (buf[0] != '\n')) {
    2.15  			g_strchomp(buf);
    2.16 -			DEBUG(6) fprintf(stderr,"parse_list_file: item = %s\n", buf);
    2.17 +			DEBUG(9) fprintf(stderr,"parse_list_file: item = %s\n", buf);
    2.18  			list = g_list_append(list, g_strdup(buf));
    2.19  		}
    2.20  	}
    2.21 @@ -117,7 +117,7 @@
    2.22  	gchar buf[256];
    2.23  	gchar *p, *q;
    2.24  
    2.25 -	DEBUG(6) fprintf(stderr, "parsing list %s, file?:%d\n", line, read_file);
    2.26 +	DEBUG(9) fprintf(stderr, "parsing list %s, file?:%d\n", line, read_file);
    2.27  
    2.28  	p = line;
    2.29  	while (*p != '\0') {
    2.30 @@ -134,7 +134,7 @@
    2.31  			/* just a normal item */
    2.32  			list = g_list_append(list, g_strdup(buf));
    2.33  
    2.34 -		DEBUG(6) fprintf(stderr, "item = %s\n", buf);
    2.35 +		DEBUG(9) fprintf(stderr, "item = %s\n", buf);
    2.36  
    2.37  		if (*p)
    2.38  			p++;
    2.39 @@ -226,7 +226,7 @@
    2.40  	gchar *p, *q;
    2.41  	interface *iface;
    2.42  
    2.43 -	DEBUG(6) fprintf(stderr, "parse_interface: %s\n", line);
    2.44 +	DEBUG(9) fprintf(stderr, "parse_interface: %s\n", line);
    2.45  
    2.46  	p = line;
    2.47  	q = buf;
    2.48 @@ -242,7 +242,7 @@
    2.49  		iface->port = atoi(p);
    2.50  	} else
    2.51  		iface->port = def_port;
    2.52 -	DEBUG(6) fprintf(stderr,"rval=%s, address:port=%s:%i\n",line, iface->address, iface->port);
    2.53 +	DEBUG(9) fprintf(stderr,"rval=%s, address:port=%s:%i\n",line, iface->address, iface->port);
    2.54  
    2.55  	return iface;
    2.56  }
    2.57 @@ -256,7 +256,7 @@
    2.58  	struct in_addr addr, mask_addr, net_addr, *p_net_addr;
    2.59  	guint n;
    2.60  
    2.61 -	DEBUG(6) fprintf(stderr, "parse_network: %s\n", line);
    2.62 +	DEBUG(9) fprintf(stderr, "parse_network: %s\n", line);
    2.63  
    2.64  	p = line;
    2.65  	q = buf;
    2.66 @@ -341,13 +341,13 @@
    2.67  	gint c;
    2.68  	gchar *ptr = buf;
    2.69  
    2.70 -	DEBUG(6) fprintf(stderr, "read_lval()\n");
    2.71 +	DEBUG(9) fprintf(stderr, "read_lval()\n");
    2.72  
    2.73  	if (!eat_spaces(in))
    2.74  		return FALSE;
    2.75  
    2.76  	c = fgetc(in);
    2.77 -	DEBUG(6) fprintf(stderr, "read_lval() 2\n");
    2.78 +	DEBUG(9) fprintf(stderr, "read_lval() 2\n");
    2.79  	while ((isalnum(c) || c == '_' || c == '-' || c == '.')
    2.80  	       && (ptr < buf + size - 1)
    2.81  	       && (c != EOF)) {
    2.82 @@ -367,7 +367,7 @@
    2.83  
    2.84  	eat_spaces(in);
    2.85  
    2.86 -	DEBUG(6) fprintf(stderr, "lval = %s\n", buf);
    2.87 +	DEBUG(9) fprintf(stderr, "lval = %s\n", buf);
    2.88  
    2.89  	return buf[0] != '\0';
    2.90  }
    2.91 @@ -378,7 +378,7 @@
    2.92  	gint c;
    2.93  	gchar *ptr = buf;
    2.94  
    2.95 -	DEBUG(6) fprintf(stderr, "read_rval()\n");
    2.96 +	DEBUG(9) fprintf(stderr, "read_rval()\n");
    2.97  
    2.98  	if (!eat_spaces(in))
    2.99  		return FALSE;
   2.100 @@ -415,7 +415,7 @@
   2.101  
   2.102  	eat_line_trailing(in);
   2.103  
   2.104 -	DEBUG(6) fprintf(stderr, "rval = %s\n", buf);
   2.105 +	DEBUG(9) fprintf(stderr, "rval = %s\n", buf);
   2.106  
   2.107  	return TRUE;
   2.108  }
   2.109 @@ -425,7 +425,7 @@
   2.110  {
   2.111  	gint c;
   2.112  
   2.113 -	DEBUG(6) fprintf(stderr, "read_statement()\n");
   2.114 +	DEBUG(9) fprintf(stderr, "read_statement()\n");
   2.115  
   2.116  	/* eat comments and empty lines: */
   2.117  	if (!eat_comments(in))
   2.118 @@ -435,14 +435,14 @@
   2.119  		return FALSE;
   2.120  	}
   2.121  
   2.122 -	DEBUG(6) fprintf(stderr, "  lval = %s\n", lval);
   2.123 +	DEBUG(9) fprintf(stderr, "  lval = %s\n", lval);
   2.124  	if ((c = fgetc(in) == '=')) {
   2.125  		if (read_rval(in, rval, rsize)) {
   2.126 -			DEBUG(6) fprintf(stderr, "  rval = %s\n", rval);
   2.127 +			DEBUG(9) fprintf(stderr, "  rval = %s\n", rval);
   2.128  			return TRUE;
   2.129  		}
   2.130  	} else {
   2.131 -		DEBUG(6) fprintf(stderr,"  '=' expected after %s, char was '%c'\n", lval, c);
   2.132 +		DEBUG(9) fprintf(stderr,"  '=' expected after %s, char was '%c'\n", lval, c);
   2.133  		fprintf(stderr, "'=' expected after %s, char was '%c'\n", lval, c);
   2.134  	}
   2.135  	return FALSE;
   2.136 @@ -469,7 +469,7 @@
   2.137  
   2.138  	gchar lval[256], rval[2048];
   2.139  	while (read_statement(in, lval, 256, rval, 2048)) {
   2.140 -		DEBUG(6) fprintf(stderr,"read_conf(): lval=%s\n", lval);
   2.141 +		DEBUG(9) fprintf(stderr,"read_conf(): lval=%s\n", lval);
   2.142  		if (strcmp(lval, "debug_level") == 0)
   2.143  			conf.debug_level = atoi(rval);
   2.144  		else if (strcmp(lval, "run_as_user") == 0) {
   2.145 @@ -585,7 +585,7 @@
   2.146  			conf.log_user = g_strdup(rval);
   2.147  		else if(strcmp(lval, "max_msg_size") == 0) {
   2.148  			conf.max_msg_size = atol(rval);
   2.149 -			DEBUG(6) fprintf(stderr,"rval=%s, conf.max_msg_size=%ld\n",
   2.150 +			DEBUG(9) fprintf(stderr,"rval=%s, conf.max_msg_size=%ld\n",
   2.151  			                 rval, conf.max_msg_size);
   2.152  		}
   2.153  		else