masqmail

diff src/spool.c @ 422:bdbedce60247

Remove `input' dir in spool dir. Spooled files are in spool dir directly now. There's no more need to have any sub directories in the spool dir at all.
author markus schnalke <meillo@marmaro.de>
date Wed, 30 May 2012 10:27:10 +0200
parents 0430194f7ef8
children
line diff
     1.1 --- a/src/spool.c	Wed May 30 09:38:38 2012 +0200
     1.2 +++ b/src/spool.c	Wed May 30 10:27:10 2012 +0200
     1.3 @@ -96,7 +96,7 @@
     1.4  	gchar *spool_file;
     1.5  
     1.6  	DEBUG(5) debugf("spool_read_data entered\n");
     1.7 -	spool_file = g_strdup_printf("%s/input/%s-D", conf.spool_dir, msg->uid);
     1.8 +	spool_file = g_strdup_printf("%s/%s-D", conf.spool_dir, msg->uid);
     1.9  	DEBUG(5) debugf("reading data spool file '%s'\n", spool_file);
    1.10  	in = fopen(spool_file, "r");
    1.11  	if (!in) {
    1.12 @@ -127,7 +127,7 @@
    1.13  	gchar *spool_file;
    1.14  
    1.15  	/* header spool: */
    1.16 -	spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid);
    1.17 +	spool_file = g_strdup_printf("%s/%s-H", conf.spool_dir, msg->uid);
    1.18  	in = fopen(spool_file, "r");
    1.19  	if (!in) {
    1.20  		logwrite(LOG_ALERT, "could not open spool header file %s: %s\n",
    1.21 @@ -232,7 +232,7 @@
    1.22  	gboolean ok = TRUE;
    1.23  
    1.24  	/* header spool: */
    1.25 -	tmp_file = g_strdup_printf("%s/input/%d-H.tmp", conf.spool_dir, getpid());
    1.26 +	tmp_file = g_strdup_printf("%s/%d-H.tmp", conf.spool_dir, getpid());
    1.27  	DEBUG(4) debugf("tmp_file = %s\n", tmp_file);
    1.28  
    1.29  	if ((out = fopen(tmp_file, "w"))) {
    1.30 @@ -282,7 +282,7 @@
    1.31  		}
    1.32  		fclose(out);
    1.33  		if (ok) {
    1.34 -			spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid);
    1.35 +			spool_file = g_strdup_printf("%s/%s-H", conf.spool_dir, msg->uid);
    1.36  			DEBUG(4) debugf("spool_file = %s\n", spool_file);
    1.37  			ok = (rename(tmp_file, spool_file) != -1);
    1.38  			g_free(spool_file);
    1.39 @@ -319,7 +319,7 @@
    1.40  
    1.41  	if (ok && do_write_data) {
    1.42  		/* data spool: */
    1.43 -		tmp_file = g_strdup_printf("%s/input/%d-D.tmp", conf.spool_dir, getpid());
    1.44 +		tmp_file = g_strdup_printf("%s/%d-D.tmp", conf.spool_dir, getpid());
    1.45  		DEBUG(4) debugf("tmp_file = %s\n", tmp_file);
    1.46  
    1.47  		if ((out = fopen(tmp_file, "w"))) {
    1.48 @@ -338,7 +338,7 @@
    1.49  			}
    1.50  			fclose(out);
    1.51  			if (ok) {
    1.52 -				spool_file = g_strdup_printf("%s/input/%s-D", conf.spool_dir, msg->uid);
    1.53 +				spool_file = g_strdup_printf("%s/%s-D", conf.spool_dir, msg->uid);
    1.54  				DEBUG(4) debugf("spool_file = %s\n", spool_file);
    1.55  				ok = (rename(tmp_file, spool_file) != -1);
    1.56  				g_free(spool_file);
    1.57 @@ -428,14 +428,14 @@
    1.58  	}
    1.59  
    1.60  	/* header spool: */
    1.61 -	spool_file = g_strdup_printf("%s/input/%s-H", conf.spool_dir, msg->uid);
    1.62 +	spool_file = g_strdup_printf("%s/%s-H", conf.spool_dir, msg->uid);
    1.63  	if (unlink(spool_file) != 0) {
    1.64  		logwrite(LOG_ALERT, "could not delete spool file %s: %s\n", spool_file, strerror(errno));
    1.65  	}
    1.66  	g_free(spool_file);
    1.67  
    1.68  	/* data spool: */
    1.69 -	spool_file = g_strdup_printf("%s/input/%s-D", conf.spool_dir, msg->uid);
    1.70 +	spool_file = g_strdup_printf("%s/%s-D", conf.spool_dir, msg->uid);
    1.71  	if (unlink(spool_file) != 0) {
    1.72  		logwrite(LOG_ALERT, "could not delete spool file %s: %s\n", spool_file, strerror(errno));
    1.73  	}