Re: [opensuse] cron job email attachment.bin



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


The Monday 2007-01-29 at 19:19 +0100, Sandy Drobic wrote:

Dave Howorth wrote:

I don't want to seem ungrateful but I'd rather not do this. It's just
papering over the cracks. There's no good reason why cron shouldn't
carry on mailing these messages as text exactly as it has done for ages.
I want to find the cause of the current problem, not just mask its effect.

Well, cron uses the system "mail" command, which was changed not long ago
to "nail" (perhaps with 9.2, maybe 9.1). I understand that 10.2 has
changed again to a new one, mailx
(<http://heirloom.sourceforge.net/mailx.html>), which seems to be the new
name or version of "nail". Perhaps the OP could try updating it, to see if
it behaves differently.

I see, a man of principles. In that case you might want to investigate the
programs that are called in cron. cron does not control what these programs
write to standard out, so it is reasonable to assume that some programs will
produce output that causes nail to regard the text as not ascii7.

I had the same problem a year ago when I set up cron to update antivir. I
finally gave in and ran the output through "tr" to replace the characters
causing nail to attach the text as a binary.


I'm starting to understand. yes, I also got emails from cron jobs as
attachments and I didn't know why. Now I do.

- From another post from the OP:

| It's cron. /etc/crontab => /usr/lib/cron/run-crons => etc etc =>
| /root/bin/cron.daily.local
|
| (/usr/lib/cron/run-crons is the script that actually create and sends
| the mail, I think:
| if [ -n "${STATUS}" -o "$SEND_MAIL_ON_NO_ERROR" = true ] ; then
| mail ${SEND_TO} -s "${TITLE}" < ${CONTROL_MAIL}
| fi
| )

So, the text to be mailed is piped to the standard input. If it could be
given as a file via command, we could play with the filename extension to
change the mime type used by nail. But I don't see how to do that.

Perhaps using -q file, but the mail is not ended, it still wants stdin.


An alternative would be to use the sendmail binary, old style, instead of
nail.

Perhaps:

sendmail -B 8BITMIME -F root@localhost ${SEND_TO} < ${CONTROL_MAIL}


I don't see how to specify the subject, though, unless it is by including
it inside the piped text.

- --
Cheers,
Carlos E. R.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Made with pgp4pine 1.76

iD8DBQFFvl/AtTMYHG2NR9URAhkgAJ4wi7HiGmyic/IF28GEUC1hygszYQCdGQ9S
iuURS5mpHhwHf+1crV6VJIQ=
=ZusP
-----END PGP SIGNATURE-----

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: [opensuse] cron job email attachment.bin
    ... the only control characters I can see are TAB and NL. ... There's no good reason why cron shouldn't ... programs will produce output that causes nail to regard the text as not ascii7. ...
    (SuSE)
  • email not working from cron.
    ... I'm not sure what changed if anything, but for some reason, my Solaris 9 ... server which can send email fine from the command line is not sending ... email or pages from scripts running from cron. ...
    (SunManagers)
  • Re: Cron Job
    ... If you mean the computer itself, put that command ... The standard 'cron' runs jobs at a specific time/date. ... Init or @reboot run jobs when ... Sunday night at 02:00) then copy the script and cron entry. ...
    (comp.os.linux.misc)
  • Re: Cygwin problem with cron and networked drives
    ... command line it is recognized. ... Is the cron job running on a linux system or an MS Windows system? ... versus the user running the cron job. ...
    (comp.os.linux.networking)
  • Re: Nmon scheduling question
    ... command ran first then in the script is the ps and kill command so it ... Vince this is a great script. ... Cron Job with pid: 135238 Failed ...
    (AIX-L)