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