On Sunday 06 April 2008 14:16, [EMAIL PROTECTED] wrote: > Hello! > > Since BB has its own sendmail it is reasonable enough to make BB crond > be able to use it. This requires changes in both applets. > > Since big crond implementations do not agree with each other how to perform > mailing of > results I would like BB crond to behave in clear and intuitive way. > For that I added a per-line variable cl_MailTo which defaults to NULL but can > be set > via [EMAIL PROTECTED] line in crontab file. MAILTO=... can occur multiple > times > and, once occured, sets cl_MailTo field for all following lines till next > time occured. > If MAILTO= sets null address it means for the following lines no mailing is > performed. > That way crontab becomes significantly more flexible. > > Sendmail, on the other hand, must be able to read recipients, subject and > message body > right from stdin (as full-blown sendmail does). > > Attached is the patch to both crond and sendmail. > Please, do consider.
+# if ENABLE_SENDMAIL +# define SENDMAIL_ARGS "localhost", line->cl_MailTo +# else +# define SENDMAIL_ARGS "-ti", "oem" +# endif This kind of "assume that $prog is busybox applet" logic is fragile. Even though busybox binary may include support for $prog, user can install and use "standard" one. If you can, avoid this (usually by making applet's options compatible with "standard" $prog). + if (mailTo) + free(mailTo); free(NULL) works. + if (mailTo) + line->cl_MailTo = xstrdup(mailTo); Superfluous if(), and doesn't build if mailing support is off: miscutils/crond.c: In function 'SynchronizeFile': miscutils/crond.c:518: error: 'CronLine' has no member named 'cl_MailTo' make[1]: *** [miscutils/crond.o] Error 1 + free(s); + if (!*s) And you, Brutus... Applied with small changes, thanks. -- vda _______________________________________________ busybox mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/busybox
