Results 1 to 4 of 4

Thread: MTA for TiVo

  1. #1
    Join Date
    Dec 2004
    Posts
    831

    MTA for TiVo

    Has anyone ever compiled a Mail Transfer Agent such as Exim4 or SSMTP for the TiVo? I would like to have my TiVos send out messages when certain events occur, such as a pending upgrade.
    Having trouble with TyTool? Try TyTool Documentation
    Need to hack an S3 / THD? Try S3 Hacking Script

  2. #2
    Join Date
    Jan 2011
    Posts
    9
    An MTA is surely overkill here, you just need an SMTP client so it can talk to your mailbox server--unless you mean you actually want your TiVo to be a mail host. Something like the TCL smtp package ought to work well with a TCL script. I just checked and it doesn't appear to be included with the TiVo TCL installation, but you should be able to pull it out from an official TCL distribution.

    A quick check of a unix software packages site found nearly a dozen SMTP clients, many compatible with sendmail command line syntax, some intended to be brain-dead simple to use.

  3. #3
    Join Date
    Dec 2004
    Posts
    831
    Thanks. I think I will look into it. In the mean time, I was thinking this over, and I came up with a different solution. Instead of mailing from the TiVos, I created an Expect script to run on one of my servers. First, I created this simple script to put on the TiVos:

    Code:
    swversion:
    
    #! /bin/bash
    echo mls /SwSystem | tivosh
    Then I created a simple Expect script on the server to run the software on the TiVos:

    Code:
    tivotest.exp:
    
    #! /usr/bin/expect --
    log_file session.txt
    spawn telnet $argv
    expect #
    send swversion\n
    expect #
    sleep 2
    log_file
    send exit
    In order to run the Expect script on all three TiVos I create a shell script:
    Code:
    tivoscan:
    
    #! /bin/bash
    
    dir=/usr/share/tivoscan
    cd $dir
    tivo=$dir/tivos.list
    file=$dir/session.txt
    log=/var/log/tivoscan.log
    expfile=$dir/tivotest.exp
    
    echo $(date +%Y-%m-%d_%H:%M:%S) Starting tivoscan session. >> $log
    while read line
    do
            [ -f $file ] && rm $file
            $expfile $line
            active=$(grep ACTIVE $file |  awk '{print $3;}')
            swlines=$(grep tyDb $file | grep -v $active | wc -l)
            if [ $swlines -gt 0 ];
            then
                    echo "TiVo $line is ppending a software installation." | mail -a From:mdadm_monitor -s "RAID-Server TiVo Upgrade Notice" <email addresses>
                    echo $(date +%Y-%m-%d_%H:%M:%S) Emailing notification of pending software for $line. >> $log
            fi
    done < $tivo
    [ -f $file ] && rm $file
    echo $(date +%Y-%m-%d_%H:%M:%S) Tivoscan session complete. >> $log
    I create a file to contain the hostnames of the TiVos:

    Code:
    tivos.list:
    
    hd_livingroom
    hd_theater
    tivo_hd
    And finally, I create a cron job to run the script every six hours:

    Code:
    0 */6 * * *     root    /usr/bin/tivoscan > /dev/null
    Having trouble with TyTool? Try TyTool Documentation
    Need to hack an S3 / THD? Try S3 Hacking Script

  4. #4
    Join Date
    Apr 2005
    Location
    Providence, RI
    Posts
    472
    This sounded like a great idea, so I tried it out. To my astonishment, pretty much everything worked right off the bat. You can grab the script here if you have any use for it.

    Quote Originally Posted by Kayle View Post
    Something like the TCL smtp package ought to work well with a TCL script.
    More software at http://davidlauria.com/software.
    The lost alt-rock masterpiece from the '90s, Range of Motion's "Soft Buzz of Silence", is now available on iTunes!

Posting Permissions

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