// ForwardScan - Scans your e-mail conferences and forwards e-mail if // needed. // // By: Pete Nelson (pete@terminal-one.com) // v1.00 (01/04/96) type forward_rec name as string*30 address as string*70 fwd_on as string*1 delete_msg as string*1 end type dim forward as forward_rec, msg as messageheader, urec as userrecord dim choice as string dim local_yn as string, inet_yn as string dim local_conf as integer, inet_conf as integer dim msg_local as long, msg_inet as long dim did_pass_one as string, lines_checked as integer dim tempmsgnumber as long, old_to as string, temptext as string dim original_conf as long const fwdver = "v1.01" const fwddate = "(03/07/96)" cls print print "@0F@"; print "Forward " fwdver " " fwddate " - by Pete Nelson" print "Terminal One BBS (510) 689-9528" print "Author: pete@terminal-one.com" print delay 1 if not exists("3rdparty\forward\fwd.cfg") then print print "@0C@FWD.CFG not found!" print waitenter end end if open "3rdparty\forward\fwd.cfg" for input as #1 input #1, local_yn input #1, local_conf input #1, inet_yn input #1, inet_conf close local_yn = trim(ucase(local_yn)) inet_yn = trim(ucase(inet_yn)) if not exists("3rdparty\forward\fwd.ptr") then open "3rdparty\forward\fwd.ptr" for output as #1 print #1, "0" print #1, "0" close end if open "3rdparty\forward\fwd.ptr" for input as #1 input #1, msg_local input #1, msg_inet close moreprompt off if local_yn = "N" and inet_yn = "N" then end original_conf = conference.number if local_yn= "N" then msg.number = msg_inet join inet_conf goto check_inet end if if local_yn = "Y" then join local_conf msg.number = msg_local end if check_local: if not getnextmessage(msg) then if inet_yn = "Y" then join inet_conf msg_local = msg.number msg.number = msg_inet goto check_inet end if if inet_yn = "N" then goto done end if gosub check_msg goto check_local check_inet: if not getnextmessage(msg) then msg_inet = msg.number goto done end if gosub check_msg goto check_inet done: close open "3rdparty\forward\fwd.ptr" for output as #1 print #1, msg_local print #1, msg_inet close #1 kill "fwdmsg.tmp" join original_conf print print "@1F@ Done Forwarding Messages @07@" print delay 1 end check_msg: if (msg.flags and 0x0200) <> 0 then return if getuser(urec,msg.to) then open "3rdparty\forward\fwd.dat" for random as #1 len = len(forward_rec) get #1, urec.userid, forward close if forward.name <> msg.to then close return end if if forward.name = msg.to and forward.fwd_on = "Y" then getmessagetext(msg.number, "fwdmsg.tm2") open "fwdmsg.tm2" for input as #5 open "fwdmsg.tmp" for output as #6 lines_checked = 0 do input #5, temptext if ucase(mid(temptext,1,3)) <> "TO:" then print #6, temptext inc lines_checked loop until eof(5) or lines_checked >= 6 if not eof(5) then do input #5, temptext print #6, temptext loop until eof(5) end if close #5 close #6 old_to = msg.to msg.to = forward.address if not getuser(urec, msg.to) then msg.toid = 0 else msg.toid = urec.userid end if msg.from = msg.from msg.network = "" if instr(msg.to, "@") and inet_yn = "Y" then print "@0B@Forwarding @07@#@0F@" msg.number" @0B@to @0F@" msg.to updatescreen tempmsgnumber = msg.number addmessage(msg,"fwdmsg.tmp","",inet_conf) msg.number = tempmsgnumber if forward.delete_msg = "Y" then msg.to = old_to flagset(msg.flags, 0x0200) updatemessage(msg,"") end if return end if if local_yn = "Y" then print "@0B@Forwarding @07@#@0F@" msg.number" @0B@to @0F@" msg.to updatescreen tempmsgnumber = msg.number addmessage(msg,"fwdmsg.tmp","",local_conf) msg.number = tempmsgnumber if forward.delete_msg = "Y" then msg.to = old_to flagset(msg.flags, 0x0200) updatemessage(msg,"") end if end if end if end if return