1 diff -U 3 anacron-2.3.oud/runjob.c anacron-2.3/runjob.c
2 --- anacron-2.3.oud/runjob.c 2000-06-21 01:12:18.000000000 +0200
3 +++ anacron-2.3/runjob.c 2004-07-09 19:05:22.314056376 +0200
13 + alias = getenv("MAILTO");
14 + if (alias == NULL || strlen(alias) == 0)
21 xputenv(const char *s)
24 run_job(const job_rec *jr)
25 /* This is called to start the job, after the fork */
28 /* setup stdout and stderr */
32 * options, which don't seem to be appropriate here.
33 * Hopefully, this will keep all the MTAs happy. */
34 execl(SENDMAIL, SENDMAIL, "-FAnacron", "-odi",
35 - username(), (char *)NULL);
36 + mailto(), (char *)NULL);
37 die_e("Can't exec " SENDMAIL);
44 + /* import environment for mailto() to work properly */
47 /* create temporary file for stdout and stderr of the job */
48 fd = jr->output_fd = temp_file();
49 /* write mail header */
51 xwrite(fd, username());
52 xwrite(fd, " (Anacron)\n");
54 - xwrite(fd, username());
55 + xwrite(fd, mailto());
57 xwrite(fd, "Subject: Anacron job '");
58 xwrite(fd, jr->ident);