Results 1 to 7 of 7

Thread: Sendmail doesn't work either standalone or through fcron

Threaded View

  1. #1
    Join Date
    Aug 2007
    Beans
    528
    Distro
    Xubuntu 14.04 Trusty Tahr

    Sendmail doesn't work either standalone or through fcron

    I am using fcron on my personal computer running Ubuntu Lucid Lynx to schedule and execute my backups. Fcron initiates the backup fine. However, I would also like it to send me an email with the status of the job, when it completes--whether it ran ok or not. I am unable to make this feature of fcron work. I am trying to send email on job completion to my normal email account--i.e. the same email account that friends use to send me email. fcron uses sendmail to send its email. I also attemped to use sendmail directly, but that didn't work either. Note: Because I didn't want to broadcast my email address, I replaced my name in the email with "myemail" in the commands and logs below.

    My fcrontab listing (obtain with "fcrontab -l" is:
    !mail(true)
    !bootrun(true)
    !mailto(myemail@mchsi.com),forcemail,mail
    & 53 21 * * * export DISPLAY=:0.0&&/home/ralph/lbtest

    The log file (syslog) listing from fcron executing using the above setup is
    listed below. Also, I included a log file from executing under Terminal "sendmail myemail@mchsi.com". sendmail did not work that way either. Obviously I don't know how to set up sendmail. Any help would be appreciated.

    Ralph

    NOTE: For anybody reading this to find out how to get fcron to work, please note the command line "export DISPLAY=:0.0" above. For a long time I could not get my fcron script to show up on the console. Adding the "export" command fixed that.

    NOTE 2: In order to get sendmail to work without getting a message about my computer name (ralph-laptop) being "not fully qualified" I edited the second line of /etc/hosts to be "127.0.1.1 ralph-laptop ralph-laptop.local" (no quotes). This added the alias "ralph-laptop.local. I guess this "qualified" the name ralph-laptop. Anyway I no longer get the error message and sendmail sends the message immediately rather than waiting a minute and doing a retry. Hope this information is useful to somebody.

    LOG MESSAGES FROM RUNNING fcron. NOTE THAT sendmail MESSAGES START ABOUT 2/3 THE WAY DOWN.

    Mar 20 21:52:33 ralph-laptop fcrontab[9022]: fcronconf=/usr/local/etc/fcron.conf
    Mar 20 21:52:33 ralph-laptop fcrontab[9022]: Copied stdin to /tmp/fcr-5V22zU, about to parse file /tmp/fcr-5V22zU...
    Mar 20 21:52:33 ralph-laptop fcrontab[9022]: installing file /tmp/fcr-5V22zU for user ralph
    Mar 20 21:52:33 ralph-laptop fcrontab[9022]: write_buf_to_disk() : written 299/299, 1 (re)try(ies)
    Mar 20 21:52:33 ralph-laptop fcronsighup[9024]: fcronconf=/usr/local/etc/fcron.conf
    Mar 20 21:52:33 ralph-laptop fcronsighup[9025]: uid: 1000, euid: 200, gid: 1000, egid: 200
    Mar 20 21:52:50 ralph-laptop fcron[1372]: updating configuration from /usr/local/var/spool/fcron
    Mar 20 21:52:50 ralph-laptop fcron[1372]: adding new file ralph
    Mar 20 21:52:50 ralph-laptop fcron[1372]: User new.ralph Entry
    Mar 20 21:52:50 ralph-laptop fcron[1372]: dow of 3-20-2011 : 0
    Mar 20 21:52:50 ralph-laptop fcron[1372]: after mktime() : 23:53 isdst:1 ti:1300690380
    Mar 20 21:52:50 ralph-laptop fcron[1372]: cmd export DISPLAY=:0.0 && /home/ralph/lbtest next exec 3/20/2011 wday:0 23:53:00 (system time)
    Mar 20 21:52:50 ralph-laptop fcron[1372]: dow of 3-20-2011 : 0
    Mar 20 21:52:50 ralph-laptop fcron[1372]: after mktime() : 21:53 isdst:1 ti:1300683180
    Mar 20 21:52:50 ralph-laptop fcron[1372]: cmd export DISPLAY=:0.0&&/home/ralph/lbtest next exec 3/20/2011 wday:0 21:53:00 (system time)
    Mar 20 21:52:50 ralph-laptop fcron[1372]: from last conf: export DISPLAY=:0.0 && /home/ralph/lbtest next exec 3/20/2011 wday:0 23:53:00 (system time)
    Mar 20 21:52:50 ralph-laptop fcron[1372]: Saving ralph...
    Mar 20 21:52:50 ralph-laptop fcron[1372]: write_buf_to_disk() : written 299/299, 1 (re)try(ies)
    Mar 20 21:52:50 ralph-laptop fcron[1372]:
    Mar 20 21:52:50 ralph-laptop fcron[1372]: Looking for jobs to execute ...
    Mar 20 21:52:50 ralph-laptop fcron[1372]: next sleep time : 10
    Mar 20 21:53:00 ralph-laptop fcron[1372]:
    Mar 20 21:53:00 ralph-laptop fcron[1372]: Looking for jobs to execute ...
    Mar 20 21:53:00 ralph-laptop fcron[9035]: run_job(): child: mail, output to file, running in background, normal
    Mar 20 21:53:00 ralph-laptop fcron[1372]: dow of 3-20-2011 : 0
    Mar 20 21:53:00 ralph-laptop fcron[1372]: dow of 3-21-2011 : 1
    Mar 20 21:53:00 ralph-laptop fcron[1372]: after mktime() : 21:53 isdst:1 ti:1300769580
    Mar 20 21:53:00 ralph-laptop fcron[1372]: cmd: export DISPLAY=:0.0&&/home/ralph/lbtest next exec 3/21/2011 wday:1 21:53:00 (tzdiff=0, timezone=system's)
    Mar 20 21:53:00 ralph-laptop fcron[1372]: next sleep time : 5
    Mar 20 21:53:00 ralph-laptop fcron[9035]: Job export DISPLAY=:0.0&&/home/ralph/lbtest started for user ralph (pid 9036)
    Mar 20 21:53:05 ralph-laptop fcron[1372]:
    Mar 20 21:53:05 ralph-laptop fcron[1372]: Looking for jobs to execute ...
    Mar 20 21:53:05 ralph-laptop fcron[1372]: Saving ralph...
    Mar 20 21:53:05 ralph-laptop fcron[1372]: write_buf_to_disk() : written 304/304, 1 (re)try(ies)
    Mar 20 21:53:05 ralph-laptop fcron[1372]: next sleep time : 1800

    SENDMAIL MESSAGES FROM fcron ATTEMPTING TO SEND EMAIL START HERE

    Mar 20 21:53:14 ralph-laptop fcron[9035]: Job export DISPLAY=:0.0&&/home/ralph/lbtest completed (mailing output)
    Mar 20 21:53:14 ralph-laptop sendmail[9035]: My unqualified host name (ralph-laptop) unknown; sleeping for retry
    Mar 20 21:54:15 ralph-laptop sendmail[9035]: unable to qualify my own domain name (ralph-laptop) -- using short name
    Mar 20 21:54:15 ralph-laptop sendmail[9035]: p2L4sF9v009035: from=ralph, size=123, class=0, nrcpts=1, msgid=<201103210454.p2L4sF9v009035@ralph-laptop>, relay=ralph@localhost
    Mar 20 21:54:17 ralph-laptop sm-mta[9060]: p2L4sGBs009060: from=<ralph@ralph-laptop>, size=400, class=0, nrcpts=1, msgid=<201103210454.p2L4sF9v009035@ralph-laptop>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
    Mar 20 21:54:17 ralph-laptop sendmail[9035]: p2L4sF9v009035: to=myemail@mchsi.com, ctladdr=ralph (1000/1000), delay=00:00:02, xdelay=00:00:01, mailer=relay, pri=30123, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p2L4sGBs009060 Message accepted for delivery)
    Mar 20 21:54:17 ralph-laptop fcron[1372]:
    Mar 20 21:54:17 ralph-laptop fcron[1372]: Looking for jobs to execute ...
    Mar 20 21:54:17 ralph-laptop fcron[1372]: next sleep time : 1728
    Mar 20 21:54:26 ralph-laptop sm-mta[9062]: p2L4sGBs009060: to=<myemail@mchsi.com>, ctladdr=<ralph@ralph-laptop> (1000/1000), delay=00:00:09, xdelay=00:00:09, mailer=relay, pri=120400, relay=mail.mchsi.com. [97.64.187.44], dsn=5.0.0, stat=Service unavailable
    Mar 20 21:54:26 ralph-laptop sm-mta[9062]: p2L4sGBs009060: p2L4sQBs009062: DSN: Service unavailable
    Mar 20 21:54:26 ralph-laptop sm-mta[9062]: p2L4sQBs009062: to=<ralph@ralph-laptop>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent


    LOG MESSAGES FROM EXECUTING "sendmail myemail@mchsi.com"

    Mar 20 21:30:56 ralph-laptop sendmail[8617]: My unqualified host name (ralph-laptop) unknown; sleeping for retry
    Mar 20 21:31:57 ralph-laptop sendmail[8617]: unable to qualify my own domain name (ralph-laptop) -- using short name
    Mar 20 21:31:58 ralph-laptop sendmail[8617]: p2L4VvVU008617: from=ralph, size=13, class=0, nrcpts=1, msgid=<201103210431.p2L4VvVU008617@ralph-laptop>, relay=ralph@localhost
    Mar 20 21:31:59 ralph-laptop sm-mta[8635]: p2L4VwRO008635: from=<ralph@ralph-laptop>, size=291, class=0, nrcpts=1, msgid=<201103210431.p2L4VvVU008617@ralph-laptop>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
    Mar 20 21:31:59 ralph-laptop sendmail[8617]: p2L4VvVU008617: to=myemail@mchsi.com, ctladdr=ralph (1000/1000), delay=00:00:02, xdelay=00:00:01, mailer=relay, pri=30013, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p2L4VwRO008635 Message accepted for delivery)
    Mar 20 21:32:08 ralph-laptop sm-mta[8637]: p2L4VwRO008635: to=<myemail@mchsi.com>, ctladdr=<ralph@ralph-laptop> (1000/1000), delay=00:00:09, xdelay=00:00:09, mailer=relay, pri=120291, relay=mail.mchsi.com. [97.64.187.44], dsn=5.0.0, stat=Service unavailable
    Mar 20 21:32:08 ralph-laptop sm-mta[8637]: p2L4VwRO008635: p2L4W8RO008637: DSN: Service unavailable
    Mar 20 21:32:08 ralph-laptop sm-mta[8637]: p2L4W8RO008637: to=<ralph@ralph-laptop>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
    Last edited by Ralph L; April 9th, 2011 at 02:27 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •