View Full Version : DailyMail: a daily e-mailed status report from your TiVo
Pages :
[
1]
2
3
4
5
6
7
8
9
10
11
sanderton
10-28-2003, 06:04 PM
Note: the original version of DailyMail has now been superceded by tivo_onion's Jazz version, which can be found lower down the thread (here (http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1761496#post1761496) at the the time of writing.)
Ian was mentioning the other day about his daily routine for checking that his TiVo was all set up for the day's recordings. I know that I haven't the patience for that - heck, I know I haven't even got the patience to check via TiVoWeb on my coffee break. If such a system was to work for me, it would have to be more pro-active.
So I wrote this script.
It sends me an e-mail at work every day, telling me:
* If the TiVo has rebooted recently
* If the last daily call failed
* What unresolved conflicts are coming up
* What programmes are about to expire
* What the TiVo is planning to record that day
Here is an example (http://www.beaconhill.plus.com/TiVo/DailyMail.htm) of what it sends.
I wrote it for my own amusement, and I certainly don't want to get into a big round of bug fixing and beta testing, but I offer it here in case its of use to anyone else, or if someone wants to use it as the basis for something better.
Most of the code is adapted, filched and straight copied from various TiVoWeb modules - if I've omitted a credit in the code my apologies. I thank those authors for their great work.
To use it you'll need to edit the .tcl file - preferably on the TiVo using joe or vi, or on the PC if you have a Unix compatible text editor. If not you'll need to run it through DOS2UNIX or similar to get it back in Unix format. There are some variables at the top you'll need to set as a minimum:
- the e-mail address to send the mail to
- the IP address of your ISP's SMTP server (must be an IP as TiVo has no DNS lookup)
- your domain name
Some have also found it necessary to tweak the exact commands sent to the mail server - see the posts below for details if you are having problems; most have been incorporated into the code now. In particular, if your ISP mail server requires authentication see here (http://www.tivocommunity.com/tivo-vb/showthread.php?postid=1547527#post1547527)
The file dailymail.tcl will need to be made executable with
chmod 755 dailymail.tcl
You need to have TiVoWeb 1.9.4 installed - DailyMail is not compatible with the TiVoWebPlus hack, but there are workarounds, see below. And an always-on internet connection. This script will not work using the TiVo's modem - it must be able to connect to the net via your network
I have a cron job set up to run it every morning.
Feel free to take this code and run with it - just please post anything cool you add or fix!
bobnick
10-28-2003, 06:27 PM
Will dailymail automatically include the latest number of asylum seekers and the dangers of interest rates rising, or do I need to edit the tcl file?
Lysander
10-28-2003, 06:53 PM
Stuart,
Two things.
1. Haven't you got a job? (Tivo are you listening?)
or
2. Haven't you got a life?
Some amazing stuff kicking around in that head of yours....:D
James
tivo_boj
10-28-2003, 07:22 PM
Great, now to make me look thick (not hard generally)?
How do I find the IP address of my ISP's SMTP server (mail.btconnect.com)?
my domain - I take this as the @xxxx bit
as my emails address is xxxxxxxx@btconnect.com the domain is btconnect.com , True?
have not a clue how to set up a a "cron job" to run it every morning. How do I get it to send every morning?
thanks
m3geezer
10-28-2003, 07:26 PM
how do i find the ip address of the smtp server?
look in outlook or whatever your mail client is and see what your outgoing mailserver is called, then if you run win nt/2000/xp type on a command line 'nslookup <the server name here>'
not sure about tivo but in unix 'crontab -e' allows you to edit the crontab, you want to make a timed entry for a specific time each day, under day you enter '*' to mean everyday, i think i'm right in saying 0 is sunday, 1 is monday, upto saturday which is 6, if you only want it on specific days.
maybe someone can clarify this.
bobnick
10-28-2003, 07:31 PM
Script works just great - cheers!
(Eventually) tracked down Cron - http://www.tivocommunity.com/tivo-vb/showthread.php?s=&threadid=69877&highlight=cron
Looks v. complicated - I'll have to work out how to get it to run each morning tomorrow I think! Anyone got any tips?
BTconnect should have an IP of 193.113.154.2 - hit start, then run in windows, then type CMD and press enter. then just type ping mail.btconnect.com to find out the ip address. And yes, that's your domain - but I don't think it does anything other than form the 'From' address in the Tivo email.
randymc
10-28-2003, 07:39 PM
I get the following error:
object not found (errNmNameNotFound)
while executing
"mfs find $guideindexdir/ChannelTable"
("uplevel" body line 2)
invoked from within
"uplevel $body"
invoked from within
"transaction {uplevel $body}"
(procedure "RetryTransaction" line 5)
invoked from within
"RetryTransaction {
set channeltablefsid [lindex [mfs find $guideindexdir/ChannelTable] 0]
set channeltabledata [mfs get $channeltablefsid]..."
(procedure "init_channelindex" line 58)
invoked from within
"init_channelindex"
(file "/var/hack/tivoweb-tcl/modules/index.itcl" line 658)
invoked from within
"source /var/hack/tivoweb-tcl/modules/index.itcl"
(file "/var/hack/dailymail.tcl" line 445)
Any help?
Thanks,
rAndy
tivo_boj
10-28-2003, 07:40 PM
Thanks, think I have got it - except for the crone bit. Tool late to worry tonight ( just got back from a 9-8 penalty shoot out?).
If anyone out there is sleepless, maybe an idiots guide exacly what I need to run on the tivo for the "cron" stuff. Got tivoweb etc etc working , but only by following idiots guides
Automan
10-29-2003, 02:09 AM
Originally posted by tivo_boj
Great, now to make me look thick (not hard generally)?
How do I find the IP address of my ISP's SMTP server (mail.btconnect.com)?
my domain - I take this as the @xxxx bit
as my emails address is xxxxxxxx@btconnect.com the domain is btconnect.com , True?
Try ping mail.btconnect.com from the command prompt on your PC.
Some of the big email providers can have more than one mail server (to ease the load / increased reliability). Thus it's possible when you ping a mailserver by it's DNS name you make get a diferent IP number.
Automan.
sanderton
10-29-2003, 05:02 AM
Originally posted by randymc
I get the following error:
object not found (errNmNameNotFound)
while executing
"mfs find $guideindexdir/ChannelTable"
rAndy
Check the version3 variable at the start of the code, should be false if v2 or true if v3. No idea about v4. :)
sanderton
10-29-2003, 05:17 AM
cron's a bit complicated.
I did it like this (from memory so replace the xxx's with the real names!):
1) copy the xxx.tar.gz file to /var/hack
2) gzip -d xxx.tar.gz to get to the xxx.tar
3) cpio -idu -H tar < xxx.tar which will create a directory of xxx
4) cd xxx to that directory
5) Make everything there executable with chmod 755 *
6) There is a .sh script in the directory, run it with ./xxx.sh which will create a load of subdirectories of /var/hack
7) Copy the crontab file (the text file which sets what cron does) to /var/hack/etc with mv crontab /var/hack/etc/crontab
8) Copy the cron program itself to /var/hack/bin with mv cron /var/hack/bin/cron
9) If you've followed one of the usual hacking guides /var/hack/bin will be in your path so you can now run cron with cron &, if not use /var/hack/bin/cron &
10) Open the /var/etc/crontab file with joe or your preferred editor. The last line is an example cron job wich just modifies a file to see if its working. Delete that line, and to run dailymail.tcl every weekday at 8am add this one:
0 8 * * 1-5 /var/hack/dailymail.tcl &
11) So it survives reboots, add the line
/var/hack/bin/cron &
to rc.sysinit.author
racingclub
10-29-2003, 08:23 AM
snds a nice script - will try it later..................
Dapper Dan
10-29-2003, 01:46 PM
Blimey, that's good :)
Do you have trouble sleeping with all these thoughts that keep going through your head ?
bobnick
10-29-2003, 03:48 PM
Thanks for the cron help - i had to change a few bits to make it work with the cron link above, but it looks like it will work - we'll find out in the morning!
Dailymail caused my Tivo to reboot this afternoon when it was run through a bash prompt - no idea why, sorry!
tivo_boj
10-29-2003, 04:39 PM
Originally posted by sanderton
cron's a bit complicated.
I did it like this (from memory so replace the xxx's with the real names!):
1) copy the xxx.tar.gz file to /var/hack
2) gzip -d xxx.tar.gz to get to the xxx.tar
............. etc
being really thick now - what is programme xxx, anyone know the real name and where I ge it :confused:
horwitz
10-29-2003, 05:48 PM
Originally posted by tivo_boj
being really thick now - what is programme xxx, anyone know the real name and where I ge it :confused:
You'll find it in the lost post of the thread pointed to here:
Originally posted by bobnick
Script works just great - cheers!
(Eventually) tracked down Cron - http://www.tivocommunity.com/tivo-vb/showthread.php?s=&threadid=69877&highlight=cron
Looks v. complicated - I'll have to work out how to get it to run each morning tomorrow I think! Anyone got any tips?
BTconnect should have an IP of 193.113.154.2 - hit start, then run in windows, then type CMD and press enter. then just type ping mail.btconnect.com to find out the ip address. And yes, that's your domain - but I don't think it does anything other than form the 'From' address in the Tivo email.
Specifically, go here (ftp://ftp.alt.org/pub/tivo/dtype/) and get cron-3.0pl1_TiVo-2.tar.gz (that should tell you what "xxx" is, too).
bobnick
10-29-2003, 05:50 PM
Read further up the thread, and follow the readme files that come with it - you'll need to change the insructions in this thread slightly (as the files go in a different place)
horwitz
10-29-2003, 06:02 PM
set domain yourdomain.com ;# your domain
What do I do here? I'm sending the email to a hotmail.com address (and, as such, am using their mail server). I assume this has nothing to do with my Windows domain nor with my ISP.
p.s. This sounds great -- exactly what I do by hand and wish I had a quick tool for!
tivo_boj
10-29-2003, 06:15 PM
Thanks,
got it now, just configuring files to see if I can get the cron job working
sanderton
10-29-2003, 06:36 PM
Originally posted by horwitz
What do I do here? I'm sending the email to a hotmail.com address (and, as such, am using their mail server). I assume this has nothing to do with my Windows domain nor with my ISP.
You need to set this to be the internet domain that you are sending from and which appears in your outgoing e-mails, often something like accountname.isp.com.
The mailserver needs to be the IP addess of your ISP's outgoing SMTP server, not hotmail. Check your e-mail client's preferences to see what the name of it is, then (as suggested above) use ping to find out the IP address.
sanderton
10-29-2003, 06:38 PM
Originally posted by bobnick
Read further up the thread, and follow the readme files that come with it - you'll need to change the insructions in this thread slightly (as the files go in a different place)
My files are where I've said above - and that agrees with the locations in the readme??
bobnick
10-29-2003, 06:57 PM
The version of cron I linked to above seems to want things in different places:
The main crontab file should be placed at /var/hack/etc/crontab. Log files,pid file, spool, etc, will show up under /var/hack/cron/.
I presume there's a couple of versions of cron floating around. The changes don't seem to be major - just keep an eye on the files you download!
Or perhaps I've screwed everything up and I'm not going to get a mail in the morning ;)
sanderton
10-29-2003, 07:13 PM
Er, that's where I said to put them??
The main crontab file should be placed at /var/hack/etc/crontab.
7) Copy the crontab file (the text file which sets what cron does) to /var/hack/etc with mv crontab /var/hack/etc/crontab
cron itself can go anywhere you like.
horwitz
10-29-2003, 08:21 PM
error :(
couldn't open socket: network is unreachable
while executing
"socket $mailserver 25"
(procedure "sendmail" line 3)
invoked from within
"sendmail $mailserver $domain $recipient "Daily status e-mail" $message"
(file "./dailymail.tcl" line 512)
The only changes I made:
#set variables
set mailserver 198.144.192.41 ;# the IP address of your ISP's SMTP server
set domain rawbw.com ;# your domain
set recipient jahorwitz@hotmail.com ;# the email address to send to
set hoursahead 36 ;# number of hours ahead to look for enclosed info
set version3 true ;# change to true if you are on v3
set uktivo false ;# change to true if you are a colonial
I have a (US) series 1 v3.0 and 198.144.192.41 is smtp.rawbw.com (which succesfully responds to pings). Help, please ...
tivo_boj
10-30-2003, 03:04 AM
run the cron, got this this morning
cron (10/30-08:00:00-210) MAIL (mailed 85 bytes of output but got status 0x0001
)
*system* (10/30-08:08:00-201) RELOAD (/var/hack/etc/crontab)
in the cron log file
Any Clues
UPDATE
pinged my mailserver but timeout (ie did not recieve ping). Checked mail account is up OK. Is there some setting i need to do on my PC (Windows xp) to be able to ping?
sanderton
10-30-2003, 04:23 AM
Originally posted by horwitz
couldn't open socket: network is unreachable
That would be the clue! It seems that your network configuration does not allow the TiVo to open a connection to the SMTP server. You'd have to look at how your network is set up with firewalls etc.
sanderton
10-30-2003, 04:25 AM
Originally posted by tivo_boj
run the cron, got this this morning
cron (10/30-08:00:00-210) MAIL (mailed 85 bytes of output but got status 0x0001
)
*system* (10/30-08:08:00-201) RELOAD (/var/hack/etc/crontab)
in the cron log file
Any Clues
UPDATE
pinged my mailserver but timeout (ie did not recieve ping). Checked mail account is up OK. Is there some setting i need to do on my PC (Windows xp) to be able to ping?
Does the script work if you run it manually?
edit: I noticed this morning that the dailymail cron job failed on one of my TiVos, after I reconfigured it to get its listings via the phone instead of the network. Maybe TCL defaults to eth0; I'll have to get my manuals out!
bobnick
10-30-2003, 05:49 AM
Originally posted by sanderton
cron itself can go anywhere you like.
Oh, that's good to hear - sorry to have alarmed you!
The distro linked to in this thread is also a zip file that needs to be unzipped on a PC before it gets sent over to Tivo - no biggie, but I just wanted to warn the absoloute beginners not to get too confused!
Thanks again for a brilliant utility :up:
bobnick
10-30-2003, 06:25 AM
Hmm, having a few problems getting the script to run through cron.
Cron's log just says :
cron (10/30-11:00:00-258) CMD (/var/hack/dmn.tcl &^M)
with no error messages (I have a couple of versions of DM - this one is called dmn.tcl)
going to a bash promt and typing /var/hack/dmn.tcl & gives a response of [1] 264 and drops me back to the prompt. No mail was sent.
Tried again, without the ampersand, and got a long error message:
no such object: {CONFLICT err=errTmActiveLockConflict}
while executing
"dbobj $station fsid"
("foreach" body line 10)
invoked from within
"foreach channel $channels2 {
regexp {([0-9]*)/(.*)} $channel junk id subid
set channelobj [db $db openidconstruction $id $subi..."
("uplevel" body line 2)
invoked from within
"uplevel $body"
invoked from within
"transaction {uplevel $body}"
(procedure "RetryTransaction" line 5)
invoked from within
"RetryTransaction {
foreach channel $channels2 {
regexp {([0-9]*)/(.*)} $channel junk id subid
set channelobj [db $db ..."
(procedure "init_channelindex" line 37)
invoked from within
"init_channelindex"
(file "/var/hack/tivoweb-tcl/modules/index.itcl" line 658)
invoked from within
"source /var/hack/tivoweb-tcl/modules/index.itcl"
(file "/var/hack/dmn.tcl" line 444)
no such object: {CONFLICT err=errTmActiveLockConflict}
while executing
"dbobj $station fsid"
("uplevel" body line 12)
invoked from within
"uplevel $body"
invoked from within
"ForeachMfsFileTrans fsid name type $nowshowingdir "" 10 {
set rec [db $db openid $fsid]
set expdate [dbobj $rec get ExpirationDate]
set expsecs..."
(procedure "getnpexpire" line 7)
invoked from within
"getnpexpire $hoursahead"
(file "/var/hack/dmn.tcl" line 493)
Perhaps the first script was still running? There wasn't anything in PS when I checked.
I tried again, and got a few "retrying after errTmActiveLockConflict ..." messages, and then the mail was sent, along with a [1]+ Exit 1 on the screen.
I tried again with an ampersand, and the script worked fine, and got a [1] Done.
Tried it again, and just got [1] 272 on the screen. After a while, the mail was sent.
Is there any reason you can see as to why the first cron-called script didn't work? Everything else appears fairly normal. What does the ampersand do?
sanderton
10-30-2003, 07:00 AM
The ampersand backgrounds the script, which is why you don't get error messages when you try that.
The error is errTmActiveLockConflict, which just means that another process was accessing that part of the database at the time the script was running. Normally you'd code it to retry the access in a few moments in that instance, but that particular bit of the script calls a procedure from TiVoWeb, here for some reason the usual retry code doesn't seem to be working. In that instance the only think to do is to try again and hope the databse is clear at that point.
You could probably make it less likely to happen by changing the cron job time to an odd number of minutes as if you fire it off at 8.00 its quite likely that a recording is just starting up, whoich triggers loads of database accesses.
Oh, and the ^M in the cron message suggests that it's been edited on a PC and not DOS2UNIXEd - I think you can juts delete all the ^Ms at the end of each line in crontab.
bobnick
10-30-2003, 08:25 AM
Thanks. At 8, Tivo is in the middle of a recording. I'd like to set it up so it's a couple of minutes past the hour - but how? My current crontab is:
0 8 * * 1-5 /var/hack/dmh.tcl &
0 9 * * 1-5 /var/hack/dmn.tcl &
0 11 * * 6-7 /var/hack/dmn.tcl &
which I presume runs dmh at 8am each weekday, dmn at 9 each weekday and dmn on sat and sunday at 11am. Is this correct, and how do I offset the times by a few minutes?
Is the ^M a problem? I edited the file in notepad, and left the carriage returns well alone - it normally seems to work ok. Running the file through dos2unix doesn't seem to change the file, but I may well be wrong! Should I run crontab and the script files through it?
sanderton
10-30-2003, 08:28 AM
I'd just delete the ^Ms on the Tivo itself. I don't know it it will cause cron a problem or not - it might well.
I think to run it at 5 mins past the hour you change it to:
5 8 * * 1-5 /var/hack/dmh.tcl &
I'm not sure if Sunday is 7 or 0?
tivo_boj
10-30-2003, 09:49 AM
Originally posted by sanderton
Does the script work if you run it manually?
edit: I noticed this morning that the dailymail cron job failed on one of my TiVos, after I reconfigured it to get its listings via the phone instead of the network. Maybe TCL defaults to eth0; I'll have to get my manuals out!
run manually got this:-
bash-2.02# cd /var/hack/
bash-2.02# dailymail.tcl
couldn't open socket: network is unreachable
while executing
"socket $mailserver 25"
(procedure "sendmail" line 3)
invoked from within
"sendmail $mailserver $domain $recipient "Daily status e-mail" $message"
(file "/var/hack/dailymail.tcl" line 515)
bash-2.02#
sanderton
10-30-2003, 09:57 AM
I'm guessing now, but try editing
socket $mailserver 25
to
socket -myaddr xxx.xxx.xxx.xxx $mailserver 25
where xxx.xxx.xxx.xxx is your TiVo's IP address. You'll have to do this on-TiVo as editing on a PC will break the file unless you use a special text editor or run it through DOS2UNIX afterwards.
pahunt
10-30-2003, 10:14 AM
I haven't managed to find a telnet client yet that doesn't get confused when editing files in Joe so I use EditPad Lite (http://www.editpadlite.com/) to edit tcl files on my PC.
sanderton
10-30-2003, 10:19 AM
The other thing it might be tivo_boj, is do you have your TiVo configured with a gateway to the internet?
tivo_boj
10-30-2003, 10:59 AM
Originally posted by sanderton
I'm guessing now, but try editing
socket $mailserver 25
to
socket -myaddr xxx.xxx.xxx.xxx $mailserver 25
where xxx.xxx.xxx.xxx is your TiVo's IP address. You'll have to do this on-TiVo as editing on a PC will break the file unless you use a special text editor or run it through DOS2UNIX afterwards.
Tried, got this
bash-2.02# cd /var/hack/
bash-2.02# dailymail.tcl
couldn't open socket: network is unreachable
while executing
"socket -myaddr 192.168.55.2 $mailserver 25"
(procedure "sendmail" line 3)
invoked from within
"sendmail $mailserver $domain $recipient "Daily status e-mail" $message"
(file "/var/hack/dailymail.tcl" line 515)
bash-2.02#
tivo_boj
10-30-2003, 11:00 AM
Originally posted by sanderton
The other thing it might be tivo_boj, is do you have your TiVo configured with a gateway to the internet?
ehhh don't think so??:confused:
what do I need to do?
sanderton
10-30-2003, 11:13 AM
Aha!
I think you need to add this line to rc.net
route.tivo add default gw 192.168.0.1
where the IP address is the address of the gateway to the internet - presumably your PC in your case?
I think you can just key it in to see if it works.
Ricardo
10-30-2003, 12:10 PM
Originally posted by sanderton
Here is an example (http://www.beaconhill.plus.com/TiVo/DailyMail.htm) of what it sends.
COOL :up:
Anyone prepared to talk me through the set up over the phone at the weekend. My expense.
Send me PM
P.S.
As you can probably guess I didn't upgrade my Tivo myself!
tivo_boj
10-30-2003, 02:07 PM
Originally posted by sanderton
Aha!
I think you need to add this line to rc.net
route.tivo add default gw 192.168.0.1
where the IP address is the address of the gateway to the internet - presumably your PC in your case?
I think you can just key it in to see if it works.
Questions (again)
1. what directory is rc.net
2. can I add the line using Joe?
3. Gateway to the internet via ADSL is the PC, how do I find its address?
4.will this effect guide data via the telephone?
bit green I'm afraid
does any of these show the IP I need
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Paul>ipconfig
Windows IP Configuration
PPP adapter RAS Server (Dial In) Interface:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.xx.x
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . :
PPP adapter BTopenworld:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : xx.xxx.xxx.xxx
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 0.0.0.0
sanderton
10-30-2003, 02:27 PM
1) /etc/rc.d You'll need to do the remounting read/write stuff you will have done to edit rc.sysinit
2) yes
3) The 192.168.xx.x one looks right
4) I don't think so, but you'll find out!
tivo_boj
10-30-2003, 02:35 PM
NO rc.net file in that directory???:confused:
sanderton
10-30-2003, 02:42 PM
Does typing the "route.tivo add default gw xxx.xxx.xxx.xxx" line cure the problem?
tivo_boj
10-30-2003, 02:50 PM
No
added the line "route.tivo add default gw 192.168.55.1" to a new rc.net file in etc/rc.d plus edited
socket $mailserver 25
to
socket -myaddr 192.168.55.2 $mailserver 25
where 192.168.55.2 is my TiVo's IP address.
run dailymail and still get:
couldn't open socket: network is unreachable
while executing
"socket -myaddr 192.168.55.2 $mailserver 25"
(procedure "sendmail" line 3)
invoked from within
"sendmail $mailserver $domain $recipient "Daily status e-mail" $message"
(file "/var/hack/dailymail.tcl" line 515)
horwitz
10-30-2003, 02:57 PM
couldn't open socket: network is unreachable
while executing
"socket -myaddr 192.168.55.2 $mailserver 25"
(procedure "sendmail" line 3)
invoked from within
"sendmail $mailserver $domain $recipient "Daily status e-mail" $message"
(file "/var/hack/dailymail.tcl" line 515)
Welcome to my world. :rolleyes:
sanderton
10-30-2003, 03:10 PM
Looks like it doesn't work over a PPP over serial connection then, although just creating an rc.net file won't run that file automatically.
Sorry to sound like a stuck record but you still haven't said - did you try just issuing the route.tivo command mannually then running teh script?
I
horwitz
10-30-2003, 03:26 PM
Originally posted by sanderton
Looks like it doesn't work over a PPP over serial connection then, although just creating an rc.net file won't run that file automatically.
Sorry to sound like a stuck record but you still haven't said - did you try just issuing the route.tivo command mannually then running teh script?
I
It worked for me! Thanks for the great script (exactly what I want!) and the debugging help!
Now I wonder if this route thing is why my TiVo isn't making its daily calls over Ethernet ... :(
Tony Hoyle
10-30-2003, 04:54 PM
Sounds cool...
I'll probably rename mine to Independent or Observer, though... I'm not sure my stomach could handle something called DailyMail :)
tivo_boj
10-30-2003, 05:01 PM
Originally posted by sanderton
Sorry to sound like a stuck record but you still haven't said - did you try just issuing the route.tivo command mannually then running teh script?
I
tried but nothing but this?
bash-2.02# route.tivo add default gw 192.168.55.1
bash: route.tivo: command not found
Tony Hoyle
10-30-2003, 05:10 PM
I'm getting the tmActiveLockConflict error... it looks like it's trying to run something else, too (itself?) because I get another error:
tivo:/var/hack# ./DailyCrap.tcl
retrying after errTmActiveLockConflict ...
invalid command name "
I'll try after Tivo has stopped recording... I've set it to go off just after 4am - presumably this means if something is recording at this time I won't get an email :(
tivo_boj
10-30-2003, 05:12 PM
Think I will give up - nice idea but........
now I have cron setup any other good things I can run from this?
sanderton
10-30-2003, 06:02 PM
Ok, I guess when you set up the PPP over serial you didn't install all the networking widgets you need to tweak the configuration..
sanderton
10-30-2003, 06:05 PM
Originally posted by Tony Hoyle
I'm getting the tmActiveLockConflict error... it looks like it's trying to run something else, too (itself?) because I get another error:
tivo:/var/hack# ./DailyCrap.tcl
retrying after errTmActiveLockConflict ...
invalid command name "
I'll try after Tivo has stopped recording... I've set it to go off just after 4am - presumably this means if something is recording at this time I won't get an email :(
It's nothing to do with TiVo recording as such - the error is that another process was using the database. Unfortunately this happens in the TiVoWeb code the script calls, so there's nothing I can do about it short of cutting and pasting big chunks of TiVoWeb into the script and editing it.
It's possible to write a short bash script that will keep running the dailymail.tcl until it succeeds, but bash isn't really my thing.
TiVoMango
10-31-2003, 07:27 AM
Great stuff Stuart, well done.
My dumb question to you is:
Can it be made to send two or more emails to different addresses?
-me and the mrs. in my case.
I suppose I could create two dailymail.tcls, one with my addy and one with hers, rename one, then cron both at slightly different times, but that would seem to me to be quite wastefull of CPU cycles.
hmm...
Once again superb stuff, keep it up :D
sanderton
10-31-2003, 07:33 AM
The mail is sent by the very last line in the script:
sendmail $mailserver $domain $recipient "Daily status e-mail" $message
Which calls a procedure called sendmail with the parameters which include the e-mail address ($recipient).
If you just duplicate that line, and amend the recipient from $recipient to "yourmail2@you.com" then it won't have to query the database again and will send two copies.
TiVoMango
10-31-2003, 07:35 AM
Bravo kind sir.
-didn't know it would be that simple ;)
bobnick
10-31-2003, 08:29 AM
Originally posted by TiVoMango
Great stuff Stuart, well done.
My dumb question to you is:
Can it be made to send two or more emails to different addresses?
-me and the mrs. in my case.
I suppose I could create two dailymail.tcls, one with my addy and one with hers, rename one, then cron both at slightly different times, but that would seem to me to be quite wastefull of CPU cycles.
I tried to do that, but in the end just made up two different scripts!
Now I'm sorry to be a pain, but I'm still having trouble with Cron. I've edited the crontab file, and even now run it through Dos2Unix. I'm not getting any e-mails from the cron-run scripts. The log is as follows:
cron (10/31-09:29:00-382) CMD (/var/hack/dmn.tcl &)
cron (10/31-09:39:00-386) CMD (/var/hack/dmn.tcl &)
which to me looks like it's run OK both times (as requested). But no e-mail arrives! I telnetted into a bash prompt straight after they script had run, and literally just typed /var/hack/dmn.tcl & and it worked fine - the mail turned up a minute later.
I've tried to install elvis, but it needs a load of helper files and settings. Is joe easier to setup? I can't find it either, thanks to its title! Would it help to load and edit files on the tivo?
By the way, big thanks for the script - I had a wishlist for "Harry Hill" which was all set to tape Harry Hill's TV Burp on Thursday night - but sometime on Tuesday, there was a change in the guide data for some reason (thanks Tribune!) and it wasn't going to record. Only an email from this script made me notice that Qi was going to record, and caused me to investigate further. Cheers!
I have a bizarre problem. It sends the email OK, but the content doesn't show in Outlook or Outlook Express. The content is actually there when I view the raw message though. Anyone any ideas? I've tried sending it through two different mail servers which are using different SMTP software.
sanderton
10-31-2003, 09:31 AM
I knew this would happen; lots of networking and e-mail problems. :)
bobnick: The script sometimes fails because of a lock on the database caused by another process (damn TiVo messing around recording shows in stead of running hacks!). Unfortunately this happens in a block of TiVoWeb code, so there's nothing I can really do about it. In the Endpad thread, ccwf posted a little bash command which retries a command until it gets the "completed OK" return code. It should I think be possible to amend that so this if dailymail fails it simply tries again. However my Linux isn't up to that. ccwf, are you there? :)
boyz: I'm reading the mail just fine in Outlook. However in looking at the headers I see my POP mailserver is "fixing" the date format which it seems I'm sending wrong. Perhaps your mail server (at the recipients end) is not so generous? Have look at the header and see if there any error messages there.
Spot on, following is a sample of the errors in the header. Seems to have put an error in for each line of the message generated by the script:
X-Mail-Format-Warning: Bad RFC2822 header formatting in <html> <body>
X-Mail-Format-Warning: Bad RFC2822 header formatting in <h3>Welcome
X-Mail-Format-Warning: Bad RFC2822 header formatting in to
X-Mail-Format-Warning: Bad RFC2822 header formatting in the
X-Mail-Format-Warning: Bad RFC2822 header formatting in TiVo
X-Mail-Format-Warning: Bad RFC2822 header formatting in status
X-Mail-Format-Warning: Bad RFC2822 header formatting in e-mail
Sorted - using the ISP's SMTP server which doesn't appear to be so strict on RFCs.
sanderton
10-31-2003, 10:01 AM
Good, although none of those lines are a header, so I don't know what it was complaing about!
Dapper Dan
10-31-2003, 01:22 PM
Originally posted by bobnick
... I'm not getting any e-mails from the cron-run scripts. The log is as follows:
cron (10/31-09:29:00-382) CMD (/var/hack/dmn.tcl &)
cron (10/31-09:39:00-386) CMD (/var/hack/dmn.tcl &)
which to me looks like it's run OK both times (as requested). But no e-mail arrives!
Mine does that as well. Let us know if you fix it :up:
bobnick
10-31-2003, 03:55 PM
Originally posted by sanderton
The script sometimes fails because of a lock on the database caused by another process (damn TiVo messing around recording shows in stead of running hacks!). Unfortunately this happens in a block of TiVoWeb code, so there's nothing I can really do about it. In the Endpad thread, ccwf posted a little bash command which retries a command until it gets the "completed OK" return code. It should I think be possible to amend that so this if dailymail fails it simply tries again. However my Linux isn't up to that. ccwf, are you there? :)
Don't think this is the problem - Cron's called the script 6 times now with no success, and everytime I enter the command it works just fine.
Any idea why it doesn't do anything when its run through cron?
mag01
10-31-2003, 05:31 PM
Thanks for the great script (and for endpad !).
I am getting the following error :
bash-2.02# dailymail.tcl
Connected
Ehlo acknowledged
Connection rejected
bash-2.02#
My ISP is pipex.
Can anybody help with this one ?
regards,
Mark.
sanderton
10-31-2003, 05:43 PM
Originally posted by bobnick
Don't think this is the problem - Cron's called the script 6 times now with no success, and everytime I enter the command it works just fine.
Any idea why it doesn't do anything when its run through cron?
Working fine from cron for me.
If it works when you just run it then it's the cron end you shoulld look at. Check the crontab file - you had stay ^Ms in it at ome point, have they definitely done?
bobnick
10-31-2003, 05:46 PM
I was really careful with carriage returns, I did all my editing in Notepad - where it shows carriage returns as black squares. By editing around them, everything normally works.
The log file seems fine for Cron - I took out one of the carriage returns, and the ^Ms went away.
I'd like to edit on my Tivo, but it's a nightmare to install any editors. I've already run the file through dos2unix, but no mail is ever sent out. Strange.
sanderton
10-31-2003, 05:52 PM
Originally posted by mag01
Thanks for the great script (and for endpad !).
I am getting the following error :
bash-2.02# dailymail.tcl
Connected
Ehlo acknowledged
Connection rejected
bash-2.02#
My ISP is pipex.
Can anybody help with this one ?
regards,
Mark.
It's not getting a 250 (OK) response to "MAIL FROM: tivo@$domain" command.
Does Pipex limit you to fixed e-mail addresses? If so try editing the line:
puts $chan "MAIL FROM: tivo@$domain"
So it's using your real e-mail address.
The other possibility is that it's responding with more than one line of text to the HELO command.
To test what's happening, on your PC choose Start>Run and key
telnet xxx.xxx.xxx.xxx 25
where the xxxs are the IP address of your mailserver you've given dailymail.
Then type
HELO yourdomain
where yourdomain is what you'e told dailymail
That should return a single line ack starting with 250.
Then key:
MAIL FROM: tivo@$domain
where $domain is the domain as above
You should get a 250 OK ack back. If not the error message might be a clue. Try it with your real e-mail address to see if that works.
mag01
10-31-2003, 06:23 PM
You are definately on the right lines. I followed your commands from a dos prompt, and got the following results :
HELO dsl.pipex.com
250 shockwave.systems.pipex.net
MAIL FROM: tivo@dsl.pipex.com
501 Bad address syntax
Using my email address I get :
501 Syntax: MAIL FROM: <address>
Slightly different error, now I just need to work out what I need to put in the address field !
Thanks for your help,
Mark.
David Black
10-31-2003, 06:36 PM
Hi
Seems to be running ok here but i am not getting the email ??
bash-2.02# ./dailymail.tcl.bin
Connected
Ehlo acknowledged
From acknowledged
To acknowledged
Sending message
Message sent
Disconnected
bash-2.02#
i have modified the tcl file as follows:
#set variables
set mailserver 61.8.0.107 ;# the IP address of your ISP's SMTP server
set domain pacific.net.au ;# your domain
set recipient myemailadd@pacific.net.au
pinging 61.8.0.107 from my tivo works fine and i am getting other email ok??
Any ideas or any logs i can check for errors??
Cheers
David
mag01
10-31-2003, 06:39 PM
Yay, it works !
I had to remove the space between MAIL FROM: and the email address, and enclose the email address in < >'s.
I had to do the same on the recipient line.
Mail sent and received ok....
Once again, thanks for great script and your debugging expertise.
Mark.
sanderton
11-01-2003, 04:33 AM
Originally posted by David Black
Hi
Seems to be running ok here but i am not getting the email ??
bash-2.02# ./dailymail.tcl.bin
Connected
Ehlo acknowledged
From acknowledged
To acknowledged
Sending message
Message sent
Disconnected
bash-2.02#
It only shows those messages when it gets a 250 OK message back from the server after each stage of sending the e-mail correctly, unless your srrver responds with multiple lines to any of the commands, which might fox it into thinking it got a 250 OK when in gfact it didn't.
Try the telnet trick mentioned above and see if you can send a message to yourself that way. The command sequence is:
telnet mailserver 25
HELO pacific.net.au
MAIL FROM: youremail@address
RCPT TO: youremail@address
DATA
Subject: Test
Testing
.
QUIT
TiVoMango
11-01-2003, 04:36 AM
Originally posted by sanderton
I'm not sure if Sunday is 7 or 0?
Looks so far like '7' should be a Sunday.
vassilis
11-01-2003, 08:00 AM
If like me others had a problem with getting their email client recognising the date attached to the Tivo email (eudora couldn't :-) and the tivo emails where listed without a date), locate the following line:
puts $chan "Date: [clock format [clock seconds] -gmt true]"
and change it to:
puts $chan "Date: [clock format [clock seconds] -format {%a, %d %b %Y %H:%M:%S (%Z)} -gmt true]"
Obviously this is the correct format for a a UK date type in other words: Day, DoW Mon Year Time (GMT)
Vassilis
Dapper Dan
11-01-2003, 09:44 AM
DailyMail.tcl's not working when run by cron, but does work when typed at the console. The cron log suggests it has worked, but I get the following in the tvlog at the time it runs:
Oct 31 08:00:01 (none) tcl[235]: Tcl created pool of 1458176 bytes
Oct 31 08:00:02 (none) AttachSharedMemoryFile[235]: Can't open key file /var/tmp/pseudo for attach, errno 2
Oct 31 08:00:02 (none) EvtSwitcher[106]: Tmk client 11 (pid=235) has attached
Oct 31 08:00:02 (none) EvtSwitcher[106]: Invalid service attempted to attach?
Oct 31 08:00:02 (none) EvtSwitcher[106]: Client 11 (pid=235), thread 235 has activated MFS
Oct 31 08:00:02 (none) EvtSwitcher[106]: Client 11 (pid=235) says he has finished
Oct 31 08:00:02 (none) EvtSwitcher[106]: Client 11 (pid=235) being removed
When it works from the command prompt, I get :
Nov 1 14:45:41 (none) tcl[337]: Tcl created pool of 1458176 bytes
Nov 1 14:45:44 (none) EvtSwitcher[106]: Client 15 (pid=337), thread 337 has activated MFS
Nov 1 14:46:34 (none) EvtSwitcher[106]: Client 15 (pid=337) says he has finished
Nov 1 14:46:34 (none) EvtSwitcher[106]: Client 15 (pid=337) being removed
Any ideas ?
sanderton
11-01-2003, 01:42 PM
None, except to say it's a prob at the cron end. cron is working fine for me.
Try not backgrounding the script?
Tony Hoyle
11-01-2003, 02:27 PM
Originally posted by Dapper Dan
DailyMail.tcl's not working when run by cron, but does work when typed at the console. The cron log suggests it has worked, but I get the following in the tvlog at the time it runs:
Exactly the same here... cron is definately working as I have other scripts running from it - just this one doesn't work.
sanderton
11-01-2003, 03:07 PM
Those "errors" in the log are a red herring. Here's mine from yestertday:
Oct 31 08:00:01 (none) tcl[208]: Tcl created pool of 1458176 bytes
Oct 31 08:00:02 (none) EvtSwitcher[73]: Tmk client 14 (pid=208) has attached
Oct 31 08:00:03 (none) EvtSwitcher[73]: Invalid service attempted to attach?
Oct 31 08:00:03 (none) EvtSwitcher[73]: Client 14 (pid=208), thread 208 has activated MFS
Oct 31 08:00:41 (none) EvtSwitcher[73]: Client 14 (pid=208) says he has finished
Oct 31 08:00:41 (none) EvtSwitcher[73]: Client 14 (pid=208) being removed
I received the e-mail fine.
But note the timings. Mine took 40 seconds to run, which is about right.
Yours quit after 1 seconds, so clearly crashed.
Why? The database busy error seems the most likely culprit.
sanderton
11-01-2003, 04:08 PM
Originally posted by vassilis
If like me others had a problem with getting their email client recognising the date attached to the Tivo email (eudora couldn't :-) and the tivo emails where listed without a date), locate the following line:
puts $chan "Date: [clock format [clock seconds] -gmt true]"
and change it to:
puts $chan "Date: [clock format [clock seconds] -format {%a, %d %b %Y %H:%M:%S (%Z)} -gmt true]"
Obviously this is the correct format for a a UK date type in other words: Day, DoW Mon Year Time (GMT)
Vassilis
Thanks. I'll update the file.
TiVoMango
11-01-2003, 04:09 PM
I just used your script to send TiVo emails to my boss.
He has just bought a TiVo on Ebay. :D
[silly speak]
Integration is the key Stuart, and you seem to be finding the missing parts to make this whole TiVo thing do what it's supposed to.
So what is it that makes you think this way?
David Black
11-01-2003, 04:19 PM
Thanks Stuart - telneting in i get the email send and received ok..
Messages etc.. below. Any ideas?
Thanks for your help!
David
220 mongrel.pacific.net.au ESMTP Sendmail 8.12.3/8.12.3/Debian-6.6; Sun, 2 Nov 2003 08:14:07 +1100; (No UCE/UBE) logging access from: XXXXX.XXXX.homedsl.pacific.net.au(OK)-XXXXX.XXXX.homedsl.pacific.net.au [XXX.XXX.XXX.XX]
HELO pacific.net.au
250 mongrel.pacific.net.au Hello XXXXX.XXXX.homedsl.pacific.net.au [XXX.XXX.XXX.XX], pleased to meet you
MAIL FROM: myemail@pacific.net.au
250 2.1.0 memail@pacific.net.au... Sender ok
RCPT TO: myemail@pacific.net.au
250 2.1.5 myemail@pacific.net.au... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Subject: Test
TESTING 123
.
250 2.0.0 hA1LE7DJ031271 Message accepted for delivery
TiVoMango
11-01-2003, 04:22 PM
For those of you with TiVoWeb/dailymail/cron/ISP's probs. Maybe step back a bit. Think about what you have done, typed, thought, and you will have a high probability in finding the faults.
bobnick
11-01-2003, 04:50 PM
Originally posted by TiVoMango
For those of you with TiVoWeb/dailymail/cron/ISP's probs. Maybe step back a bit. Think about what you have done, typed, thought, and you will have a high probability in finding the faults.
Had a chinese takeaway tonight Mango? Learn anything else from your fortune cookies ;)
Cron works.
DailyMail works.
Cron calling Dailymail doesn't work. Aaah!
bobnick
11-01-2003, 04:58 PM
Sorry to follow up my own post, but I've had a working cron tab mailed to me by a very helpful forum member. Won't know if it works until tomorrow, but noticed it had something important that mine lacked:
# The following environment variables are needed for many tcl scripts to
# run. Thanks to AlphaWolf for troubleshooting this.
MFS_DEVICE=/dev/hda10
TIVO_ROOT=""
which went after the path bit, but before the actual commands. I was using the default crontab settings from the thread above, which didn't have it. Now I don't know if dailymail is one of the tclscripts that needs this exta bit, but if you're scratching your head this evening, you might want to check it out!
sanderton
11-01-2003, 05:20 PM
Seems Mr Mango was right. :)
In the thread that bobnick posted a link to, the working version of cron is in the LAST post, not the first one...
I have just posted a new version of dailymail.tcl with teh date fix in it, and I tweaked the way it calls the TiVoWeb code which seems to have made it less liable to cause errors.
I set it going with cron to run every minute and stopped it after 13 out of 13, so it seems OK!
(One cron tip, the crontab file seems to need a carriage return after the last line)
sanderton
11-01-2003, 05:28 PM
Originally posted by David Black
Thanks Stuart - telneting in i get the email send and received ok..
Messages etc.. below. Any ideas?
Thanks for your help!
David
220 mongrel.pacific.net.au ESMTP Sendmail 8.12.3/8.12.3/Debian-6.6; Sun, 2 Nov 2003 08:14:07 +1100; (No UCE/UBE) logging access from: XXXXX.XXXX.homedsl.pacific.net.au(OK)-XXXXX.XXXX.homedsl.pacific.net.au [XXX.XXX.XXX.XX]
HELO pacific.net.au
250 mongrel.pacific.net.au Hello XXXXX.XXXX.homedsl.pacific.net.au [XXX.XXX.XXX.XX], pleased to meet you
MAIL FROM: myemail@pacific.net.au
250 2.1.0 memail@pacific.net.au... Sender ok
RCPT TO: myemail@pacific.net.au
250 2.1.5 myemail@pacific.net.au... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
Subject: Test
TESTING 123
.
250 2.0.0 hA1LE7DJ031271 Message accepted for delivery
That's all exactly what I'd expect.
Have you tried editing dailymail.tcl so that it is sending those exact MAIL FROM and RCPT TO commands?
TiVoMango
11-01-2003, 05:41 PM
[sanderton]
So I wrote this script.
[bobnick]
Will dailymail automatically include the latest number of asylum seekers and the dangers of interest rates rising, or do I need to edit the tcl file?
[TiVoMango]
sorry I've just come (fastshow)
[sanderton]
I knew this would happen; lots of networking and e-mail problems.
[TiVoMango]
Maybe step back a bit
[bobnick]
fortune cookies
We all need to meet up for a beer sometime :D:D:D
TiVoMango
11-01-2003, 05:52 PM
Originally posted by sanderton
One cron tip, the crontab file seems to need a carriage return after the last line
That's interesting, as I always make sure I do a carriage return after the last line, using joe, is in every script I save. I have had less problems with all sorts of stuff doing it that way.
- haven't got he dickiest why though.
bobnick
11-01-2003, 06:30 PM
Hurrah! Cron now runs my scripts with no problems.
Thanks so much for helping me out with a proper crontab file :up: - think the problem may well be in the missing lines I've posted above.
Attached is a cronfile which should run every weekeday at 8.45 if you're having problems... Check that cron is running ok by verifying that the cron log file updates a minute after you upload the new crontab.
tivo_boj
11-02-2003, 11:59 AM
Alright I'm getting jealous .. I did say in a previous post that I would give up on Dailymail but I'm back again fo some advice.
my smtp mail server is mail.btconnect.com but can't ping it...see below
C:\Documents and Settings\Paul>ping mail.btconnect.com
Pinging mail.btconnect.com [193.113.154.2] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 193.113.154.2:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
so this is proably whay I am getting an unable to connect to server error from daily mail. Any suggestions why I am getting this as my mail does work OK. I am using XP.
iankb
11-02-2003, 12:42 PM
The ICMP protocol used by PING and TRACERT is not passed through by some of the BT routers, firewalls, or whatever. It is often stopped at the outside interface of large networks, and doesn't stop the mail protocols from working. I believe that it is also turned-off to stop some Denial-of-Service attacks.
Ian.
tivo_boj
11-02-2003, 01:57 PM
:down: So I take it that this is not causing the "unable to connect to server" error in dailymail:mad:
donmc
11-02-2003, 02:17 PM
Hope I'm not being too dumb but I get the following ouput.:
bash-2.02# ./dailymail.tcl
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: setpri: command not found
./dailymail.tcl: catch: command not found
./dailymail.tcl: proc: command not found
./dailymail.tcl: return: bad non-numeric arg `[string'
What am I doing wrong?
Edited on Tivo using Joe
Originally posted by tivo_boj
:down: So I take it that this is not causing the "unable to connect to server" error in dailymail:mad: No, it's not.
Have you solved your default route problem, yet? TiVo (like your other computers) needs to know what gateway it should talk to in order to have it relay your packets to the Internet.
sanderton
11-02-2003, 02:52 PM
Originally posted by donmc
Hope I'm not being too dumb but I get the following ouput.:
bash-2.02# ./dailymail.tcl
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: global: command not found
./dailymail.tcl: setpri: command not found
./dailymail.tcl: catch: command not found
./dailymail.tcl: proc: command not found
./dailymail.tcl: return: bad non-numeric arg `[string'
Edited on Tivo using Joe
Looks like it's lost the first line which tells bash that it's a tivosh script.
Should read
#!/tvbin/tivosh
sanderton
11-02-2003, 02:56 PM
Originally posted by tivo_boj
:down: So I take it that this is not causing the "unable to connect to server" error in dailymail:mad:
Nope. I can telnet in to that BT mailserver fine, and I'm not even a BT customer. :)
donmc
11-02-2003, 05:23 PM
Originally posted by sanderton
Looks like it's lost the first line which tells bash that it's a tivosh script.
Should read
#!/tvbin/tivosh
Spot on! Joe seems to insert a blank line at the top each time I open it. Deleted all until the #!/tvbin/tivosh was at the top and all is well.
Great script - just about to setup using cron now
Cheers
Don
donmc
11-03-2003, 07:38 AM
Cron installed OK but refused to generate the mail. Bobnicks crontab file seems to have done the trick. Thanks for an excellent script! I'd like to see Sky+ send an email to me every day!
Cheers
Don
thepatrician
11-03-2003, 04:37 PM
Tried running dailymail from the bash prompt and got the following error:
can't read "message": no such variable
while executing
"return $message"
(procedure "getnpexpire" line 52)
invoked from within
"getnpexpire $hoursahead"
(file "/var/hack/dailymail.tcl" line 503)
Any help would be appreciated!
PS. Thanks for dailymail and endpad (which I got working over the weekend - absolutely brilliant).
sanderton
11-03-2003, 05:30 PM
Is it possible that no programmes are due to expire?
sanderton
11-03-2003, 06:24 PM
The first post now has version 0.2.
This fixes the bug above with no expiries, plus it adds a new warning message if the daily call fails.
thepatrician
11-03-2003, 06:36 PM
Originally posted by sanderton
Is it possible that no programmes are due to expire?
Yep that's it. I undeleted a recording that would have expired within the next 36 hours and dailymail ran okay. Is this fixable?
My mail server also seems to be a bit finicky in requiring a null line before the puts $chan "<html> <body>"' line (ie. after the mail headers and before the mail body proper), once I'd added that it worked fine. Thanks again!
thepatrician
11-03-2003, 06:43 PM
Originally posted by sanderton
The first post now has version 0.2.
This fixes the bug above with no expiries, plus it adds a new warning message if the daily call fails.
Now that's what I call service - fixed 12 minutes before I asked if it was fixable!!! Cheers.
leejordan
11-03-2003, 08:55 PM
Hi Stuart,
The link in the first post still seems to point to version 0.1.
Lee.
sanderton
11-04-2003, 04:35 AM
Refresh your browser window.
jgrisham
11-04-2003, 08:48 PM
I had the same problem as David Black:
The script ran with no errors, and sending a manual email via telnet to my SMTP server worked just fine, but I got no email from the script.
Silly answer:
X-Sieve: CMU Sieve 2.2
Subject: {SPAM 07.9} Daily status e-mail
X-Spam-score: 7.9
X-Spam: spam
X-Spam-hits: BAYES_44, HTML_MESSAGE, INVALID_MSGID, MIME_HTML_NO_CHARSET,
MIME_HTML_ONLY, NO_DNS_FOR_FROM, NO_REAL_NAME, RCVD_IN_DYNABLOCK
Spam filter was catching the messages and filing them out of my inbox.
Thanks for the work on this and endpad, Sanderson!
jeremy Parsons
11-05-2003, 12:56 PM
Very cool addon , that and endpad are excellent pieces of work , my two production tivos are so modded
adrianm
11-06-2003, 05:18 PM
Now this is strange 0.1 was working fine. Wow new version download 0.2 and upload to Tivo, edit it and discover it is in dos format?? No problem convert to unix. Run it and I get:
": no such file or directory
What have I done wrong???
Adrian
sanderton
11-06-2003, 06:49 PM
Sounds like it's not in Unix format!
adrianm
11-07-2003, 04:27 AM
Sorry, my fault it runs ok now. Cron job is not working so I will look at that later today.
Adrian
Thanks for another useful hack :)
Can I put my picky mail admin hat on for a sec about the SMTP syntax... the to and from addresses should be enclosed in angle brackets (<>), with no space between the colon and the '<' and there should be at least one blank line between the final header and the start of the body. (See the SMTP RFC (http://www.faqs.org/rfcs/rfc821.html))
sanderton
11-08-2003, 08:30 PM
I took the empirical approach of fiddling until it worked. :)
I'll tidy it up in the next revision, which should add flagging up guide data errors to the e-mail.
dialanothernumb
11-10-2003, 10:14 AM
Stuart
Another simple and clever hack. Thanks! I have both tivos emailing me with what how they are and what they're doing. Do you have a hack that gets kids to do the same?
sanderton
11-10-2003, 10:23 AM
#!tivovobin/tivosh
foreach kid $family {
set television 1
while {$television} {
if {[clock seconds] < $bedtime} {
set channel "CBeebies"
} else {
set televison 0
puts $bed $kid
}
}
}
dialanothernumb
11-10-2003, 11:39 AM
Hmmm... chmoded it, executed and then I got a whine-ing noise... is my hdd on the way out or do I just need to reboot continually?
djrowley
11-10-2003, 12:09 PM
Originally posted by dialanothernumb
Hmmm... chmoded it, executed and then I got a whine-ing noise... is my hdd on the way out or do I just need to reboot continually?
You have to watch the MTBF for kid hardware - about 20 minutes, I think. And they need a thorough Disk Cleanup every night.
David
mark.stringer
11-10-2003, 01:37 PM
Stuart,
First of all thanks for another great utility.
Any possibility of adding the Space Used summary like TivoWeb does to the end of the email so I check on the amount of free space whilst seeing what is to be recorded all in the one email?
Thanks,
Mark.
pahunt
11-10-2003, 02:50 PM
OK I'm trying to get this to work over a serial connection and I'm having a few problems. I know Tivo_boj has tried and given up but I think I'm nearly there with a method that should work for anyone using serial so some help would be appreciated.
What I have done is install some proxy software on my PC which basically redirects anything coming in port 4425 to my ISP's mail server. I know this is working correctly because I can type the following command at a DOS prompt and get through to the mail server.
telnet 192.168.0.100 4425
I've replaced the only mention of port 25 I could find in dailymail.tcl with 4425 and set the smtp address parameter to my PC's IP address. However when I run dailymail.tcl I get a message saying "bad connection".
Anybody any ideas ?
SolidTechie
11-10-2003, 03:11 PM
Well, I may be a long way off the mark here, but...
Is your TiVo on the same subnet? ISTR that as the default TiVo is on a .1 subnet - with the ip address of 192.168.1.200 - Unless you've changed it, it's not going to work with your pc on the 192.168.0 subnet.
HTH...
pahunt
11-10-2003, 03:17 PM
Originally posted by iancdbutcher
Well, I may be a long way off the mark here, but...
Is your TiVo on the same subnet? ISTR that as the default TiVo is on a .1 subnet - with the ip address of 192.168.1.200 - Unless you've changed it, it's not going to work with your pc on the 192.168.0 subnet.
HTH...
No I don't think this is the problem. I can ping, FTP, telnet and I've tivoweb working so they definitely see each other.
tivo_boj
11-10-2003, 03:46 PM
Originally posted by pahunt
No I don't think this is the problem. I can ping, FTP, telnet and I've tivoweb working so they definitely see each other.
keep me informed if you get this to work,including what proxy your using etc. I might try again.
sanderton
11-10-2003, 04:18 PM
What software are you using to route the serial PPP through to the internet?
WinRoute Lite is well spoken of (http://www.kerio.com/wrl_download.html) but cost about £30.
pahunt
11-10-2003, 04:25 PM
I'm using Proxy+ (http://www.proxyplus.net/) but I'll download the Winroute trial and see if that helps
sneel
11-12-2003, 04:28 PM
I love dailymail, it makes my Tivo send me email. How cool is THAT! :D
Is there a way I can make it use CST (GMT-6) instead of GMT in the SEND date? Also, can I make it report the time in 12Hr format instead of 24Hr in the message?
So instead of seeing this:
Stargate SG-1 Wed 17:00 SCFI
2001 - In meeting a benign alien race, SG-1 comes into contact with a third race.
I see:
Stargate SG-1 Wed 5:00PM SCFI
2001 - In meeting a benign alien race, SG-1 comes into contact with a third race.
Thanks!
-Steve
DSR6000-DirectTivo
sanderton
11-12-2003, 05:50 PM
Those should be faily simple mods - look for the "clock format" commands in the final section; alter the formatting codes as you wish. The command syntax is here:
http://tmml.sourceforge.net/doc/tcl/clock.html
As for changing the send time, that's a little more complex; you need to change the line:
puts $chan "Date: [clock format [clock seconds] -format {%a, %d %b %Y %H:%M:%S (%Z)} -gmt true]"
to
puts $chan "Date: [clock format [expr [clock seconds] + $tzoffset] -format {%a, %d %b %Y %H:%M:%S (%Z)} ]"
and add the line
global tzoffset
after
proc sendmail {mailserver domain recipient subject message} {
Originally posted by sanderton
As for changing the send time Note: Some mail clients have an option to always display Date headers in local time. If you don't like seeing Date headers in non-local times, look to see if your mailer has this feature.
sneel
11-12-2003, 06:47 PM
Originally posted by sanderton
[B]Those should be faily simple mods - look for the "clock format" commands in the final section; alter the formatting codes as you wish.
Thanks, these mods worked just fine!
-Steve
DSR6000-DirectTivo
racingclub
11-14-2003, 07:13 AM
as an aside - Broadband isn't necessarily needed for this.
I've got 602 LanSuite running on my PC
http://www.software602.com/products/ls/
which can run as a SMTP server & can dialup the modem when mail is waiting to be delivered.
works fine for me..............
sanderton
11-14-2003, 07:17 AM
Looks like a possible solution for pahunt and tivo_boj.
racingclub
11-14-2003, 07:21 AM
forgot to mention its free for <=5 users :)
pahunt
11-14-2003, 07:23 AM
Originally posted by sanderton
Looks like a possible solution for pahunt and tivo_boj.
This does look hopeful. An SMTP relay is what I came to the conclusion was needed for dailymail to work over serial although all the ones I could find were either too complicated and expensive or I couldn't get them to work at all. I'll give it a go tonight and I might finally get somewhere :D
pahunt
11-14-2003, 03:00 PM
Thanks very much for the link racingclub, I've just recieved my first e-mail from dailymail :D :D :D
tivo_boj
11-14-2003, 03:22 PM
Downloading LS now - but might need help. Send PM to Pahunt.
edit
Yes , have not a clue how to set this up ....Help Pahunt
tivo_boj
11-16-2003, 02:53 PM
Still having problems.
Anyone else using BT Openworld mail server eg
mail.btconnect.com or
smtp.btconnect.com
if so is all working Ok?. Did you have to do anything special?
sanderton
11-16-2003, 02:59 PM
Can you telnet to that mailerver from your PC (see above somewhere)?
tivo_boj
11-16-2003, 03:39 PM
Is this the responce I should get?
220 dswu232 mailer 3.1 (Solaris) of 14:45:17 Aug 27 2003. Here Pleased to meet y
ou (IDENT) (ESMTP) (contact: postmaster@btconnect.com)
HELO btconnect.com
250 dswu232: Hello there, btconnect.com
MAIL FROM: tivo@$domain
250 <tivo@$domain> Sender OK
MAIL FROM: tivo@$btconnect.com
500 Unknown or unimplemented command
Also tried below as below
220 dswu194 mailer 3.1 (Solaris) of 14:45:17 Aug 27 2003. Here Pleased to meet y
ou (IDENT) (ESMTP) (contact: postmaster@btconnect.com)
HELO btconnect.com
250 dswu194: Hello there, btconnect.com
MAIL FROM: tivo@btconnect.com
550 Unknown local user 'tivo'
again - does this help tiedown what I need to do?
In the section that starts "#set variables" what does the line that starts "set domain" read? If you've got your own domain you should set it to that (e.g. the line in my file reads "set domain ljay.org.uk").
It looks like the btconnect server is looking up the address you give it and trying to verify it exists. You may need to edit the word "tivo" in the line in the "proc sendmail..." section that reads "puts $chan "MAIL FROM: tivo@$domain"" to be your own btconnect email username. (e.g. in my case it would be "lj@$domain". (While you're editing you can fix the SMTP syntax ;) - the new line for me would read:
puts $chan "MAIL FROM:<lj@$domain>"
sanderton
11-16-2003, 04:09 PM
The second one does.
Sounds like it will need to pretend to be you sending the e-mail, so replace tivo@$domain in the script with your actual e-mail address. Someone else further up the thread had the same thing. Depends on your ISP.
tivo_boj
11-16-2003, 05:12 PM
got dailymail to send to an SMTP server (Lan Suite Pro) using the PC Address 192.168.55.1, but cant get the server to send out the mail
get
22:07:31 SMTP: [2] Connecting to '193.113.154.2' (193.113.154.2:25) ...
22:07:31 SMTP: [2] Connection to '193.113.154.2' (193.113.154.2:25) established.
22:07:31 SMTP: [2] Waiting for identification...
22:07:31 SMTP: [2] Successfull SMTP autentization of user ukc801923140 at host 193.113.154.2
22:07:31 SMTP: [2] SMTP connection to '193.113.154.2' established.
22:07:31 SMTP: [2] 500 Unknown or unimplemented command
22:07:31 SMTP: [2] SMTP connection to '193.113.154.2' terminated.
Know nothing about SMTP, SMTP server etc so poking in the dark I,m afraid
tivo_boj
11-16-2003, 05:25 PM
found thisd on the net
do you think this could be the problem
"Due to changes being made on BT Openworld's network only customers using
one of our static IP products will be able to receive SMTP mail. This is to
reduce the threat of BT Openworld customer's computers being used to send
and relay spam e-mails by other parties. These measures are being taken in
order to protect customers and to reduce the amount of spam being sent via
BT Openworld's network.
The changes being made will not affect your ability to send and receive
email in the normal way using the appropriate BT Openworld mail server for
your product. However, if you are running your own SMTP server and are on a
dynamic IP product you will not be able to receive SMTP traffic via port 25.
You should therefore take appropriate measures to reconfigure your e-mail
service so that e-mails are received using the relevant BT Openworld mail
server for your product.
Outgoing SMTP traffic via port 25 from customers' SMTP servers will be
unaffected by these changes"
Originally posted by LJ
It looks like the btconnect server is looking up the address you give it and trying to verify it exists. You may need to edit the word "tivo" in the line in the "proc sendmail..." section that reads "puts $chan "MAIL FROM: tivo@$domain"" to be your own btconnect email username. (e.g. in my case it would be "lj@$domain". (While you're editing you can fix the SMTP syntax ;) - the new line for me would read:
puts $chan "MAIL FROM:<lj@$domain>" It's looking it up because it's a local address. If the FROM address were not local (e.g., "tivo.dailymail@example.org"), then no verification should occur.
bobnick
11-16-2003, 07:29 PM
Originally posted by tivo_boj
found thisd on the net
do you think this could be the problem
No. Sorry.
tivo_boj
11-17-2003, 02:52 AM
About to give up (again) unless someone can come up with some inspiration.
pahunt
11-17-2003, 03:39 AM
Have you done a search on replace on "tivo@" as I think it occurs in more than one place in the script?
sanderton
11-17-2003, 04:51 AM
tivo_boj, do you want to e-mail me your script as it stands at the moment; I'll see if I can spot anything.
stuart@beaconhill.me.uk
davistw
11-21-2003, 08:57 AM
This looks like a great script but I could not get it to run on my US-HDVR2..
I don't recall the exact error message but it was complaining about the base64dec in the below line...
set summertime [dbobj $setup get DaylightSavingsPolicy]
} ;[base64dec]
sanderton
11-21-2003, 09:10 AM
That's a line from the amin TiVoWeb code which DailyMail calls. To be honest, I don't have the least idea what it does.
davistw
11-21-2003, 09:23 AM
Originally posted by sanderton
That's a line from the amin TiVoWeb code which DailyMail calls. To be honest, I don't have the least idea what it does.
Ah... Rings a bell now....
I had to edit that out to get tivoweb to run. I will do the same on this and let you know.
PS: Thanks....
davistw
11-21-2003, 08:50 PM
Working now..
Removed the
;[base64dec]
It executes just fine now...
I have one issue though:
The date sent on the email messages I send are off by 7 hours.. Ie it is now 7:46 pm on Friday... When I execute the code the mails says it is sent out at 1:46 am on Saturday.
Additionally the email message says "Welcome to the TiVo status e-mail for Saturday"....
The Program schedules are right though...
Originally posted by davistw
The date sent on the email messages I send are off by 7 hours.. Ie it is now 7:46 pm on Friday... When I execute the code the mails says it is sent out at 1:46 am on Saturday. As mentioned above, most popular mail readers automatically adjust the times in Date headers to local time or have an option to do so or some kind of add-on to do it. See if your mail reader had such an option or add-on.
sanderton
11-21-2003, 09:28 PM
Originally posted by davistw
Working now..
Removed the
;[base64dec]
It executes just fine now...
I have one issue though:
The date sent on the email messages I send are off by 7 hours.. Ie it is now 7:46 pm on Friday... When I execute the code the mails says it is sent out at 1:46 am on Saturday.
Additionally the email message says "Welcome to the TiVo status e-mail for Saturday"....
The Program schedules are right though...
Look, if if you're not going to live in a sensible time zone then you have to face the consequencs. :)
I guess if you won't move I could have a look at the code.
Looking at the code, one tiny nitpick is that the HELO log message misleadingly uses “ehlo”, which might lead someone to think an EHLO was sent. (EHLO is extended HELO.)
davistw
11-21-2003, 10:03 PM
Originally posted by sanderton
Look, if if you're not going to live in a sensible time zone then you have to face the consequencs. :)
I guess if you won't move I could have a look at the code.
Well... Since I am stuck here the least I could do then is go down to the pub and lift a few ;-)
Thanks..
sanderton
11-22-2003, 07:16 AM
Originally posted by ccwf
Looking at the code, one tiny nitpick is that the HELO log message misleadingly uses “ehlo”, which might lead someone to think an EHLO was sent. (EHLO is extended HELO.)
Yeah, that's because I started off trying to be too clever and send a MIME encoded message with EHLO, but I didn't change the output stiring when I reverted to ordinary text.
davistw
11-22-2003, 08:27 AM
I made a couple of changes other than removing the base64dec to get it to run...
I added
puts $chan "To: $recipient"
flush $chan
to the data section right below the
puts $chan "From: tivo@$domain"
flush $chan
I added a \n to the create some whitespace between the start of the html and the end of the mime defination...
puts $chan "\n<html> <body>"
My microsoft outlook express client did not like it without the whitespace.
tivo_boj
11-22-2003, 08:54 AM
Could you let me have a copy of you ammended file, as I have not got this to work yet and you version might be worth a go
davistw
11-22-2003, 09:13 AM
Originally posted by tivo_boj
Could you let me have a copy of you ammended file, as I have not got this to work yet and you version might be worth a go
Sure thing...
You will have to change it to fit your email addy etc....
tivo_boj
11-22-2003, 10:11 AM
Originally posted by davistw
Sure thing...
You will have to change it to fit your email addy etc....
Thanks,
will give it a go later
Prof. Yaffle
11-22-2003, 11:39 AM
Thanks Stuart another great hack. Also thanks to Mark (mag01). I'm with Pipex as well and would have never figured the <> bit out.
leemcg
11-23-2003, 10:49 AM
Apologies Sanderton for another network query, but I'm hoping I've done enough to narrow it down to a lack of tcl understanding.
My smtp server seems to return three lines after a HELO request. I think sendmail then gets confused as to which lines are confirming which requests (all three lines start "250-").
My first guess at how to fix this was to just do an extra 2 "gets $chan reply" in the HELO checking bit, but to no avail. Guess I need some combination of flush gets etc. but I really don't know any tcl.
BTW: It fails on the DATA line - my guess so I'm guessing it still getting a 220 line from before, but works when I do it from the command line.
As an aside, it seems to me that dailymail is the ideal place to get information about upcoming new shows - would it be possible to combine these hacks?
Regards
Lee
sanderton
11-23-2003, 10:56 AM
I couldn't figure this one out either when I tied using EHLO istead of HELO, which gives a multiline return, I suspect you need to use "read" rather then "gets". The Q&D alternative is to just hope it worked and comment out the error handling bits!
leemcg
11-23-2003, 11:00 AM
That's what I just did!
It sends an email, but there is no body. Even when I look at the raw email (I don't use Outlook, so it's not the error reported above).
Is message a file, or a just a string? Would something like puts $message enable me to see it?
Going to try it anyway. Thanks for quick reply.
Lee
leemcg
11-23-2003, 11:04 AM
Seems $message is full of stuff. So there's nothing wrong with that bit, just the sending.
Going to try my ISP's sendmail, if I can find the details.
thepatrician
11-23-2003, 03:35 PM
Originally posted by leemcg
That's what I just did!
It sends an email, but there is no body. Even when I look at the raw email (I don't use Outlook, so it's not the error reported above).
I had this problem with my mailserver. I got it working by adding a blank line between the last mail header and the first mail body line.
ie. after: puts $chan "Content-type: text/html"
add the following lines:
flush $chan
puts $chan ""
HTH
Yes, a blank line is required to separate the mail headers from the body. The current version of DailyMail lacks the blank line.
Lee, if you don't mind divulging the IP address of your mail server, we could try connecting to it with telnet to see how it's behaving.
Stuart, it might be good to have a debug option which logs the communications back and forth between DailyMail and the mail server.
sanderton
11-23-2003, 04:47 PM
This was going to be the hack thet I didn't try to support as I knew there would be lots of networking probs!
When I get a minute I will try to roll all of the tweaks above into the master version.
leemcg
11-23-2003, 05:40 PM
I've got no particular problem with that. I don't imagine not giving out my SMTP server is part of any T&C, and it is easy to find if you know my email provider. Kinda surprised though that there is no authentication.
The server I use is 209.231.69.19. This is a paid for server, although I really only care about the pop3 one.
Things work just fine when I comment out the exit 0 commands in the sendmail function (apart from the lack of a body). When I use my ISP (NTL) it is fine, guess that server is a little more forgiving...
Regards
Lee
Lee, that mail server is sending back a multi-line reply to a HELO. This is highly unusual but not illegal. Currently, DailyMail does not expect and does not handle multi-line replies.
To fix it, DailyMail needs to replace the simple gets commands with loops that keep doing gets until a line consisting of three digits followed by a space is received.
So, replace each gets $chan reply with something like (untested) while { [gets $chan reply] >= 0 } {
if {[regexp {^[0-9][0-9][0-9] } $reply]} break
}
leemcg
11-24-2003, 01:49 AM
Thanks ccwf,
I had worked out the bit about the three lines but didn't know what to do about it. I'll test this tonight in case it's useful for anyone else.
I don't know any tcl, but this code snippet looks like repeat until a line doesn't start with three numbers.
Also I tried just putting three gets $chan reply lines in and that didn't work.
As I say I'll try it tonight in any case.
Lee
Originally posted by leemcg
Also I tried just putting three gets $chan reply lines in and that didn't work. If you mean three total, that's probably because the multi-line reply from your server consists of four lines. :)
leemcg
11-24-2003, 02:03 AM
Ah. And Oops. I kinda ignored the first one, thought it was part of the previous...
Must go to work...
Thanks,
Lee
Crispin
11-25-2003, 05:45 AM
This is great script Stuart, I changed it slightly to show which programs were suggestions, here are the changes, which may or may not be useful to people, and the version 3 code is completly untested (it was taken from tivoweb, so should work).
This bit goes just after the "set series ...." line in the "gettodo" function (well, in practise it can probably go anywhere in that function :) )
if {$::version3} {
set recbeh [dbobj $rec get RecordingBehavior]
set seltype [dbobj $recbeh get PresentationBehavior]
} else {
set seltype [dbobj $rec get SelectionType]
}
And then I changed the html outputting (in the same function) to be:
lappend text "<i>[clock format [expr $starttime + $tzoffset] -format {%a %H:%M}] $callsign</i>"
if {$seltype == 6} {
lappend text {- <i>[SUGGESTION]</i>}
}
lappend text "<br>$eptitle - $descr <p>"
Stuart, thanks for the script, its great, exactly what I was looking for, though it took a while to get it to send to a the BTOpenworld SMTP server.
I worked through this entire thread and many of the suggestions, I was deeply empathising with tivo_boj as he asked all the questions I needed solving. In the end, two things came to light:
1) For the BTO domains (btclick.com and btconnect.com) the MAIL FROM address needs to be valid, so the tivo@$domain had to be changed to a valid address on the left side of the @)
However if I used one of my domains (which needs to be registered with BTO because of the relay filtering) I could use any address in that domain.
2) Kudos to LJ for highlighting the need for RFC821 compliance in the script. I was telneting to the BTO SMTP server and was manually walking through the script and I could not get the message to go. Until I found this gem. Adding a blank line after the final message header did the trick: Adding a puts $chan "" at around line 208 fixed it. Fantastic. One working script.
-Nic
mrtickle
11-26-2003, 06:33 PM
This is superb!
tombo28
11-27-2003, 08:56 PM
When I run dailymail, I get the following:
bash-2.02# /var/hack/dailymail.tcl
Connected
Ehlo acknowledged
Connection rejected
So I tried telnetting my smtp server and got the following:
220 smtp802.mail.ukl.yahoo.com ESMTP
HELO yahoo.com
250 smtp802.mail.ukl.yahoo.com
MAIL FROM: tivo@yahoo.com
530 authentication required - for help go to http://help.yahoo.com/help/us/mail/
pop/pop-11.html
I also tried this using my real email address and got the same response.
I checked the web site and, sure enough, my smtp server requires authentication to send mail. Does anyone know the smtp command to send my password?
Alternatively, is there any reason I have to use my ISP's smtp server? I'm also not wild about the idea of sending my email password in plain text. If most smtp servers don't require authentication, can anyone supply the IP address of one that I can use to send this mail?
Thanks.
P.S. Thanks Stuart for so many great hacks, I think I'm using almost all of them!
edited for clarity
tombo28
11-28-2003, 02:29 AM
Never mind, I figured it out for myself. I sent an email from my PC email client while running a packet sniffer and copied the necessary commands into the .tcl file. In case anyone else is interested, this bit of code seemed to work:
puts $chan "AUTH PLAIN notmyactualpassword="
flush $chan
gets $chan reply
#<server>235 ok
if {[string range $reply 0 2] != "235"} {
puts "AUTH rejected"
exit 0
} else {
puts "AUTH acknowledged"
}
where notmyactualpassword was replaced with the 64bit string I copied out of the sniffer.
Thanks again Stuart!
I'm not wild about your sending your password unencrypted either, but it looks like your mail client has been doing it all along (and further more, that mail server reports that it only accepts unencrypted passwords for authentication). :(
Surely it would be better instead to do “MAIL FROM: tivo@[your.public.IP.address]”? That should get around the need for authentication.
djrowley
11-28-2003, 06:08 AM
All, it's worth considering changing the from address on the Daily Mail. Mine was set to tivo@ntlworld.com as my mail server is at ntlworld.com. Aha, I thought, I'll register this as one of my addresses in case of delivery failures.
But somebody already has it. So if the mail doesn't get delivered for some reason, whoever has registered tivo@yourdomain.com will get the non-delivery message.
I've updated the script to add in another variable for the from address.
BTW, I've reordered the report to show unresolved clashes first - this is the most important bit for me.
David
Crispin
11-28-2003, 06:48 AM
Originally posted by djrowley
BTW, I've reordered the report to show unresolved clashes first - this is the most important bit for me.
That was the first thing I did as well, oh and I got rid of the showing recordings that are about to expire, because I just get too many of them, and with 240Gb, things are never deleted anyway :)
TivoBJ
11-28-2003, 08:19 PM
Originally posted by tombo28
[B In case anyone else is interested, this bit of code seemed to work:
puts $chan "AUTH PLAIN notmyactualpassword="
where notmyactualpassword was replaced with the 64bit string I copied out of the sniffer. [/B]
Thanks for the suggestion. I also needed to use my sniffer to get the auth password. What a pain, but I've got multiple Tivos and this is a great way to keep tabs on them. I just amended the mail header and subject lines to Tivo1, Tivo2, etc.
Great hack!
sanderton
11-29-2003, 07:35 AM
I've incorporated most of the above suggestions in version 0.3 in the first post.
I haven't added the authentication or multi-line HELO bits.
davistw
11-29-2003, 08:38 AM
sanderton..
I tried the new version (0.3) on my US (or the colonies as you put it) HDVR2 and other than having to remove the ;[base64dec] command it worked like a champ...
Thanks....
TM
sanderton
11-29-2003, 08:45 AM
Does anyone know what base64dec actually does?
mark.stringer
11-29-2003, 08:56 AM
This is a great script Stuart, thanks! I have tweaked mine to show suggestions in the todo list in plain text and scheduled recordings in bold so I can easily distinguish between them. The code changes, deduced from TivoWeb are:
In the gettodo proc add a line to the variable initialization list at the start (the comment and seltype line are new):
set showingfsid [dbobj $rec gettarget Showing]
set station [dbobj $showing get Station]
set stationfsid [dbobj $station fsid]
set callsign [dbobj $station get CallSign]
set program [dbobj $showing get Program]
set title [strim [dbobj $program get Title]]
set descr [strim [dbobj $program get Description]]
# Get selection type
set seltype [dbobj $rec get SelectionType]
then a little further down just after set text {} change the line to:
# Note the second condition of this else statement is the original line
if { $seltype == 6 } {
lappend text "$title"
} else {
lappend text "<b>$title</b>"
}
This gives you plain text suggestion programme titles and bold text scheduled programme titles.
Stuart, I have also enabled your tracking feature in the latest Endpad, thanks. So in 26 days or so I will be ready for the next stage.
Mark.
iankb
11-29-2003, 09:09 AM
Originally posted by sanderton
Does anyone know what base64dec actually does? base64dec decodes a base64-encoded string. Base64 is a MIME type that is used to convert a non-printable binary message into printable characters for transmission within the body of emails, etc. Usually used to transmit binary files, or strongly-encrypted emails which become binary (i.e. unprintable) after encryption. Base64 is an encoding method rather than an encryption method, since it just uses simple character subsitution.
iankb
11-29-2003, 09:14 AM
One of those little personalisations that I make to DailyMail is to replace the <h3></h3> tags by <h2></h2>, and the <b></b> tags around the three sub-headings by <h2></h2>. It makes it easier to separate out the three sections.
davistw
11-29-2003, 09:25 AM
Originally posted by iankb
base64dec decodes a base64-encoded string. Base64 is a MIME type that is used to convert a non-printable binary message into printable characters for transmission within the body of emails, etc. Usually used to transmit binary files, or strongly-encrypted emails which become binary (i.e. unprintable) after encryption. Base64 is an encoding method rather than an encryption method, since it just uses simple character subsitution.
Ok so why then would it be required in this app? I think it was a holdover from tivoweb where he got the sub that he is using. Could it be a remnant from the original (non-deloused) tivoweb where the authour put in the anti-hacking stuff in encoded form?
iankb
11-29-2003, 09:49 AM
Base64 is often used for simple obfuscation within visible (e.g. interpreted) source code, so that the real purpose or content is not too obvious. I believe that GarySargent published some Java a while ago that hides your email links on web pages from spammers' web robots by using Base64 to obfuscate it within the web source.
I seem to remember that TivoWeb includes an 'Easter-Egg' style sheet by using Base64 coding.
mrtickle
11-29-2003, 11:29 AM
Yep, the Hallowe'en style sheet which only appears on Oct 31st. Originally hard-coded out for UK tivos, but lightn put it back in :)
Nihilator
12-03-2003, 01:04 AM
Awesome, sanderton. I just got dailymail set up on my "development" TiVo, downstairs in the office. If the cron works well, I'll stick it on all of my units.
I love hacks where the motivation is little more than "yeah, I bet that could be done!"
--Chris
alextegg
12-16-2003, 03:40 AM
Edited to say - DOH! This was a reply post to the dailymail thread, don't know how it got here!!!
Mods - feel free to append it to dailymail thread for me ?? MOD EDIT: Done!
------------------------------------
Stuart,
Great scripts! Now have endpad and dailymail running :D
One question about conflicts. I had my third dailymail this morning, and it is reporting a conflict for today (Tuesday 16th) where the West Wing on E4 will not record at 9pm on E4.
The mail doesn't say why, as you know, but I know that's because I've put an explicit record on True Lies - let's just say I like Jamie Lee Curtis from certain angles ;)
So, the TiVo is going to record West Wing on Wednesday morning at 02:35 on E4 instead.
Surely this isn't a conflict? Or is it still one in TiVo terms, and that's what you are reporting? :eek:
Alex
sanderton
12-16-2003, 05:39 AM
No, this isn't a conflict and should not have been reported - if the WW episode really is going to be recorded?
alextegg
12-16-2003, 05:43 AM
Yup, it's in my ToDo List??
alextegg
12-16-2003, 05:52 AM
Here's the TODO
alextegg
12-16-2003, 05:55 AM
And the dailymail
sanderton
12-16-2003, 08:49 AM
What does TiVoWeb say in Recoding History for that episode?
In essence, DailyMail runs the same code as that module does; does it say say "Conflct" or "Conflict - Alternate scheduled"?
Did DailyMail run quite soon after you scheduled True Lies?
alextegg
12-16-2003, 09:05 AM
It says Conflict, not Conflict Alternate Scheduled ?
Can't see where I tell exactly when I set True Lies to record, or when dailymail ran?
sanderton
12-16-2003, 09:17 AM
It seems TiVo doesn't recognise that the episode which got cancelled is the same one that it's picked up in the small hours.
Chances are both would have recorded.
alextegg
12-22-2003, 04:53 AM
Ta.
Another question. When you receive an email that lists a conflict, it doesn't say what with. How hard is it to get this information?
I would find it handy to know what the clash is from the mail without going to TiVoWeb so you know whether you want to do anything about it.
Alex
sanderton
12-22-2003, 05:37 AM
That could be done I guess.
slimey
12-26-2003, 06:40 AM
Okay, being one of those boring people who only do text emails,
I've modified dailymail.tcl to have a flag near the top which
allows it to send either HTML or text emails.
This is my first attempt at tcl (although I'm a confident programmer
in other languages (perl, etc)), so I apologise for my code style ;)
Let me know what you think...
Simon
sanderton
12-26-2003, 06:48 AM
No attachment?
Could you post this in the main DailyMail thread, I'd like to keep all the versions together. Thanks.
slimey
12-26-2003, 06:51 AM
And with attachment...
ozsat
12-26-2003, 06:56 AM
THREAD MERGED - please keep s