Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 184588 Details for
Bug 106795
sys-process/dcron sends invalid mails that are not accepted by xmail
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to make mail header valid
dcron-3.2-mail-rfc2822-compliance.patch (text/plain), 1.43 KB, created by
Hypnos
on 2009-03-10 18:51:14 UTC
(
hide
)
Description:
Patch to make mail header valid
Filename:
MIME Type:
Creator:
Hypnos
Created:
2009-03-10 18:51:14 UTC
Size:
1.43 KB
patch
obsolete
>diff -urN dcron/job.c dcron_rfc2822/job.c >--- dcron/job.c 2006-04-30 01:49:48.000000000 +0900 >+++ dcron_rfc2822/job.c 2009-03-11 03:40:18.000000000 +0900 >@@ -11,11 +11,37 @@ > Prototype void RunJob(CronFile *file, CronLine *line); > Prototype void EndJob(CronFile *file, CronLine *line); > >+void >+maildate(char *date, int len) >+{ >+ char days[7][4] = {"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}; >+ char months[12][4] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", >+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; >+ time_t now = time(NULL); >+ /* >+ * Use GMT for simplicity >+ */ >+ struct tm nowbr = *gmtime(&now); >+ /* >+ * RFC2822 compliant date format >+ */ >+ snprintf(date, len, "%s, %d %s %d %02d:%02d:%02d +0000", >+ days[nowbr.tm_wday], >+ nowbr.tm_mday, >+ months[nowbr.tm_mon], >+ nowbr.tm_year+1900, >+ nowbr.tm_hour, >+ nowbr.tm_min, >+ nowbr.tm_sec >+ ); >+} >+ > void > RunJob(CronFile *file, CronLine *line) > { > char mailFile[128]; > int mailFd; >+ char date[128]; > > line->cl_Pid = 0; > line->cl_MailFlag = 0; >@@ -30,8 +56,14 @@ > > if (mailFd >= 0) { > line->cl_MailFlag = 1; >- fdprintf(mailFd, "To: %s\nSubject: cron: %s\n\n", >+ /* >+ * RFC2822 compliant mail header >+ */ >+ maildate(date, sizeof(date)); >+ fdprintf(mailFd, "To: %s@localhost\nFrom: %s@localhost\nDate: %s\nSubject: cron: %s\n\n", >+ file->cf_UserName, > file->cf_UserName, >+ date, > line->cl_Shell > ); > line->cl_MailPos = lseek(mailFd, 0, 1);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 106795
:
68937
| 184588