This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

wingate2.tcl - email

Old posts that have not been replied to for several years.
Locked
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

wingate2.tcl - email

Post by EEggy »

hi,
these codes are from wingate2.tcl by bass, which emails the loged host to the specify email address, but somehow these are not working, i'll appreciate for your help.

set wingate(mail-log) wingates.log
set wingate(mail-to) "" ;# add your email addy here

bind time - "03 22 * * *" wingate_mail
proc wingate_mail {a b c d e} {
global wingate
if {![file exists $wingate(mail-log)]} {return 0}
if {[expr $c/7] != [expr $c/7.]} {return 0}
if {$wingate(mail-to) != ""} {
foreach i [split $wingate(mail-to) ,] {
catch {exec cat $wingate(mail-log) | sendmail $i}
}
catch {exec rm -f $wingate(mail-log).old}
catch {exec cp $wingate(mail-log) $wingate(mail-log).old}
catch {exec rm -f $wingate(mail-log)}
}
}

thanks
regards
EEggy
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

On first inspection.

Make sure you add a e-mail address to the config variable.

Next, make sure the script is logging to the file in the wingate(mail-log) setting.

You should then note, that this script will only send out this file, at 22:03 (10.03pm), every 1/7th of a month (ie, 7th, 14th, 21st, 28th).
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

Thanks, ppslim
yeap, email address is there, and its logging to the file in the wingate(mail-log) as well, how do i fix this, so it can send a file 3:00am daily?? plz
should i remove this line
if {[expr $c/7] != [expr $c/7.]} {return 0}
and bind time - "03 22 * * *" wingate_mail to
bind time - "* 03 * * *" wingate_mail



thanks
merry xmass
EEggy
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

esentuialy, yes.
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

Thanks, ppslim

i am still not getting an email, email address is there, its logging to the file...ok
also i have done few tests n i can see in a bot dir, its swaping files fine, but not sending an email....

Thanks
EEggy
E
EEggy
Op
Posts: 122
Joined: Thu Sep 26, 2002 11:46 pm

Post by EEggy »

ok it worked when i chnage "sendmail" to "mail"..cos sendmail is not install on my shell..
but it not sending file as an attachement, just simple email, how do i send a file as an attachement?

thanks again
EEggy
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Sending as a attachment is a whole new ballgame.

You will have to encode the text being sent, to a type that is used to send attachments, then you will need to format the e-mail body, to accept sending an attachment.

This is all boyond my abilities.
Locked