Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 70623 | Differences between
and this patch

Collapse All | Expand All

(-)job.c (-13 / +10 lines)
Lines 199-208 Link Here
199
    /* is this a complete mail address ? (ie. with a "@", not only a username) */
199
    /* is this a complete mail address ? (ie. with a "@", not only a username) */
200
    char complete_adr = 0;
200
    char complete_adr = 0;
201
    int i;
201
    int i;
202
	/*used in the Date line */
202
203
	time_t t = time(NULL);
204
	char time_str[255];
205
	
206
    if ( mailf == NULL )
203
    if ( mailf == NULL )
207
	die_e("Could not fdopen() mailfd");
204
	die_e("Could not fdopen() mailfd");
208
205
Lines 222-245 Link Here
222
	for ( i = 0 ; line->cl_mailto[i] != '\0' ; i++ ) {
219
	for ( i = 0 ; line->cl_mailto[i] != '\0' ; i++ ) {
223
	    if ( line->cl_mailto[i] == '@' ) {
220
	    if ( line->cl_mailto[i] == '@' ) {
224
		complete_adr = 1;
221
		complete_adr = 1;
225
		fprintf(mailf, "\nFrom: Cron Daemon <%s>, line->cl_mailto");
226
		break;
222
		break;
227
	    }
223
	    }
228
	}
224
	}
229
	if ( ! complete_adr )
225
	if ( ! complete_adr )
230
	    fprintf(mailf, "@%s", hostname);
226
	    fprintf(mailf, "@%s", hostname);
231
		fprintf(mailf, "\nFrom: Cron Daemon <%s@%s>",line->cl_mailto, hostname);
227
    }
232
	}
233
#else
228
#else
234
    hostname[0] = '\0';
229
    hostname[0] = '\0';
235
#endif /* HAVE_GETHOSTNAME */
230
#endif /* HAVE_GETHOSTNAME */
236
231
237
    fprintf(mailf, "\nSubject: %s", line->cl_shell);
232
    if (subject)
238
	
233
	fprintf(mailf, "\nSubject: fcron <%s@%s> %s: %s\n\n", line->cl_file->cf_user,
239
	/*create an rfc-2822 compliant Date line*/
234
		( hostname[0] != '\0')? hostname:"?" , subject, line->cl_shell);
240
	strftime(time_str, sizeof(time_str), "%a, %d %b %Y %H:%M:%S %z", localtime(&t));
235
    else
241
	fprintf(mailf, "\nDate: %s\n\n", time_str);
236
	fprintf(mailf, "\nSubject: fcron <%s@%s> %s\n\n", line->cl_file->cf_user,
242
	
237
		( hostname[0] != '\0')? hostname:"?" , line->cl_shell);
238
239
243
    return mailf;
240
    return mailf;
244
}
241
}
245
242

Return to bug 70623