Hi Marc Thanks for the patch. However I have some questions about it. See below.
On Sat, Jul 28, 2007 at 09:14:00AM +0200, Marc Haber wrote: > severity #369666 wishlist > retitle #369666 Fail more gracefully when mailx is not available. > tags #369666 patch > thanks > > On Fri, Jun 02, 2006 at 07:10:23AM +0200, Ola Lundqvist wrote: > > reopen 369666 > > severity wishlist > > retitle Fail more gracefully when mailx is not available. > > Fixing syntax errors. > > > Well that can be argued as it is the meaning with recommends, but > > I can reopen it as a wishlist bug. > > Attached patch will issue a warning if mail binary is not found. > > Greetings > Marc > > -- > ----------------------------------------------------------------------------- > Marc Haber | "I don't trust Computers. They | Mailadresse im Header > Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 > Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 > --- cron-apt.orig 2007-07-28 09:08:16.000000000 +0200 > +++ cron-apt 2007-07-28 09:12:10.000000000 +0200 > @@ -273,15 +273,19 @@ > rm -f "$RUNMAIL" > fi > if [ -f "$MAIL" ] ; then > - if [ -z "$HOSTNAME" ]; then > - HOSTNAME="$(uname -n)" > - fi > - SUBJECT="CRON-APT completed on $HOSTNAME [$CONFIG]" > - if [ -f "$ERROR" ] ; then > - SUBJECT="CRON-APT error on $HOSTNAME [$CONFIG]" > + if command -v mail >/dev/null; then Why do you use "command" instead of just checking with -x? Like if [ -x "$(which fmail)" ] ; then > + if [ -z "$HOSTNAME" ]; then > + HOSTNAME="$(uname -n)" > + fi > + SUBJECT="CRON-APT completed on $HOSTNAME [$CONFIG]" > + if [ -f "$ERROR" ] ; then > + SUBJECT="CRON-APT error on $HOSTNAME [$CONFIG]" > + fi > + mail -s "$SUBJECT" "$MAILTO" < "$MAIL" > + rm -f "$MAIL" > + else > + echo >&2 "cron-apt was configured to send e-mail, but no mail > binary found in path." > fi > - mail -s "$SUBJECT" "$MAILTO" < "$MAIL" > - rm -f "$MAIL" > fi Shouldn't this $MAIL file be removed even if the mail command can not be found? > if [ -f "$DIFF" ] ; then > rm -f "$DIFF" Best regards, // Ola -- --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering ---- / [EMAIL PROTECTED] Annebergsslingan 37 \ | [EMAIL PROTECTED] 654 65 KARLSTAD | | http://opalsys.net/ Mobile: +46 (0)70-332 1551 | \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 / --------------------------------------------------------------- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

