home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / shutils / internet / irc / script / hawkee25.exe / SYSTEM / EMAIL.MRC < prev    next >
Encoding:
Text File  |  1997-07-17  |  22.4 KB  |  618 lines

  1.  EmailáUtility
  2. #EmailáUtility on
  3. #EmailáUtility end
  4. on 1:load:email.init
  5. ############################ Do Not edit anything above this line ############################
  6. on 1:connect: {
  7.   .disable #getmail
  8.   .disable #mail
  9. }
  10. alias email.init {
  11.   if $exists($mircdirdata) == $false run command.com /c md $mircdirdata
  12.   if %color1 == $null || %color2 == $null || %color3 == $null || %color4 == $null {
  13.     set %color1 12 | set %color2 2 | set %color3 10 | set %color4 14
  14.   }
  15.   .events on
  16.   set %newaddress Add Address
  17.   echo %color2 -s Successfully loaded  $+ %color3 E-Mail script
  18.   echo %color2 -s You may now press $+ %color1 F5 $+ %color2 to set up the script. 
  19. }
  20. alias email {
  21.   set %window @E-MailáSetup
  22.   if $window(%window).state == $null window %window 160 90 300 126 %window Arial bold 12
  23.   else window %window $window(%window).x $window(%window).y 300 126 %window Arial bold 12
  24.   if $line(%window,0) == 0  for 1 6 aline -c0 %window -
  25.   rline %window 1  $+ %color3 ============== $+ %color4 E-MailSetup $+ %color3 ==============
  26.   if %emailaddress [ $+ [ %currentaddress ] ] != $null  rline %window 2  $+ %color2 E-Mail address: $+ %color1 %emailaddress [ $+ [ %currentaddress ] ]
  27.   else rline %window 2  $+ %color2 E-Mail address:4 None Set
  28.   if %pop [ $+ [ %currentaddress ] ] != $null rline %window 3  $+ %color2 Pop server address: $+ %color1 %pop [ $+ [ %currentaddress ] ]
  29.   else rline %window 3  $+ %color2 Pop server address:4 None Set
  30.   if %smtp == $null rline %window 4  $+ %color2 Mail Transfer address:4 None Set
  31.   else rline %window 4  $+ %color2 Mail Transfer address: $+ %color1 %smtp
  32.   if %password [ $+ [ %currentaddress ] ] != $null rline %window 5  $+ %color2 E-Mail password for Pop access: $+ %color1 $pass(%password [ $+ [ %currentaddress ] ] )
  33.   else rline %window 5  $+ %color2 E-Mail password for Pop access:4 None Set
  34.   rline %window 6  $+ %color3 ======= $+ %color4 $+ Right click to change settings $+ %color3 $+ =======
  35. }
  36. menu channel {
  37.   E-Mail Server
  38.   .Change Setup:F5
  39.   .-
  40.   .Check E-mail:F1
  41.   .Send E-mail:F2
  42. }
  43. menu status {
  44.   E-Mail Server
  45.   .Change Setup:F5
  46.   .-
  47.   .Check E-mail:F1
  48.   .Send E-mail:F2
  49. }
  50. menu menubar {
  51.   E-Mail Server
  52.   .Change Setup:F5
  53.   .-
  54.   .Check E-mail:F1
  55.   .Send E-mail:F2
  56. }
  57. alias F1 {
  58.   if $chat($me).status == $null {
  59.     if %pop.ip [ $+ [ %currentaddress ] ] == $null || %emailaddress [ $+ [ %currentaddress ] ] == $null || %password [ $+ [ %currentaddress ] ] == $null {
  60.       echo 4 -a Error in setup
  61.     echo %color2 -a Please press $+ %color1 F5 $+ %color2 to correct this error }
  62.     else {
  63.       .msg $me DCC CHAT CHAT %pop.ip [ $+ [ %currentaddress ] ] 110
  64.       .enable #check 
  65.       .timer300 60 60 invalid
  66.       unset %lines
  67.       unset %attach
  68.       unset %reply.button
  69.       if $group(#mail).status == on echo -a  $+ %color2 Checking Mail, please wait.
  70.       window -c @E-MailáChecker
  71.       window @E-MailáChecker 50 60 530 255 @E-MailáChecker Arial bold 12
  72.       for 1 14 aline @E-MailáChecker 0-
  73.       rline @E-MailáChecker 1  $+ %color2 Connecting to mail server: $+ %color1 %pop
  74.       rline @E-MailáChecker 2  $+ %color2 Please stand by until connection has been established.
  75.       rline @E-MailáChecker 3  $+ %color4 ========================================================================
  76.     }
  77.   }
  78.   else {
  79.     if %number > %messages {
  80.       rline @E-MailáChecker $line(@E-MailáChecker,0) 4 Error: $+ %color2 No more messages on server.
  81.       halt
  82.     }
  83.     set %topline $line(@E-MailáChecker,0)
  84.     dec %topline 3
  85.     .enable #getmail
  86.     unset %subject
  87.     unset %rcpt
  88.     set %rotation startnew
  89.     if $chat($me).status == active msg = $+ $me retr %number
  90.   }
  91. }
  92. alias F2 {
  93.   if $chat($me).status == $null {
  94.     if %smtp == $null || %emailaddress [ $+ [ %currentaddress ] ] == $null {
  95.       echo 4 -a Error in setup
  96.       echo %color2 -a Please press $+ %color1 F5 $+ %color2 to correct this error 
  97.     }
  98.     else {
  99.       .remove $mircdirdata\email.txt
  100.       set %rcpt $$?="Who would you like to email?"
  101.       set %subject $?="Please enter E-Mail Subject"
  102.       send.email
  103.       unset %replying
  104.     }
  105.   }
  106.   else {
  107.     set %delete [ [ %number ] - 1 ]
  108.     msg = $+ $me dele %delete
  109.     set %lines $line(@E-MailáChecker,0)
  110.     dec %lines
  111.     rline @E-MailáChecker %lines  $+ %color2 $+ Message $+ %color1 %delete  $+ %color2 $+ has been deleted
  112.     unset %delete
  113.   }
  114. }
  115. alias send.email {
  116.   set %window @MailáEntryáWindow
  117.   window -e %window 50 60 530 255 %window Arial Bold 12
  118.   for 1 12 aline %window 0-
  119.   set %lines $line(%window,0)
  120.   rline %window %lines  $+ %color2 $+ Type message in the box below.  Enter $+ %color1 <done> $+ %color2 on a single line to end message.
  121.   dec %lines
  122.   rline %window %lines  $+ %color2 $+ Message to: $+ %color1 %rcpt  $+ %color2 Subject: $+ %color1 %subject
  123.   dec  %lines 
  124.   rline %window %lines  $+ %color4 $+ ------------------------------------------------------------------------------------------------------------------------------
  125. }
  126. menu @MailáEntryáWindow {
  127.   dclick cancel.send
  128.   Cancel:cancel.send
  129. }
  130. alias cancel.send {
  131.   window -c @MailáEntryáWindow
  132.   if %replying {
  133.     .enable #check
  134.     .msg $me DCC CHAT CHAT %pop.ip [ $+ [ %currentaddress ] ] 110
  135.     set %attach $true
  136.   }
  137. }
  138. alias F3 closeemail
  139. alias closeemail {
  140.   if $chat($me).status == $null {
  141.     if $window(@E-MailáChecker).state == normal { 
  142.       window -c @E-MailáChecker
  143.       .disable #getmail
  144.       halt 
  145.     }
  146.     setup 
  147.   }
  148.   else {
  149.     window -c @E-MailáChecker
  150.     .disable #getmail
  151.     .timer300 off
  152.     close -c $me
  153.   }
  154. }
  155. alias F4 reply.email
  156. alias reply.email {
  157.   if $chat($me).status == $null general
  158.   else {
  159.     close -c $me
  160.     set %replying $true
  161.     send.email
  162.     set %total $lines($mircdirdata\email.txt)
  163.     for 1 %total display.reply
  164.   }
  165. }
  166. alias display.reply {
  167.   set %temp %loop - 1
  168.   set %line %total - %temp
  169.   iline %window %lines  $+ %color2 $+ $read -l $+ %line $mircdirdata\email.txt 
  170. }
  171. alias F5 {
  172.   if %color1 == $null || %color2 == $null || %color3 == $null || %color4 == $null {
  173.     set %color1 12 | set %color2 2 | set %color3 10 | set %color4 14
  174.   }
  175.   if $window(@E-MailáSetup).state == normal window -c @E-MailáSetup
  176.   else email
  177. }
  178. alias SF2 {  echo %color2 -a Retrying transfer to [ $+ %color1 $+ %rcpt $+  $+ %color2 $+ ] | send.message }
  179. on 1:input: {
  180.   if $left($1,1) != / && $active == @MailáEntryáWindow {
  181.     set %lines $line(@MailáEntryáWindow,0)
  182.     dec %lines 2
  183.     if $1- == <done> {
  184.       set %sending.mail 0
  185.       .msg $me DCC CHAT CHAT %smtp.ip 25 $+ 
  186.       rline @MailáEntryáWindow %lines  $+ %color4 $+ ------------------------------------------- $+ %color1 $+ Now Sending Message $+ %color4 $+ ---------------------------------------------------------------
  187.       .timer 1 3 window -c @MailáEntryáWindow
  188.       .timer300 60 60 invalid
  189.       .enable #mail
  190.       halt
  191.     } 
  192.     if $len($1-) > 80 chops write.mail 80 $1-
  193.     else {
  194.       iline @MailáEntryáWindow %lines  $+ %color2 $1-
  195.       write $mircdirdata\email.txt $1-
  196.     }
  197.     halt
  198.   }
  199. }
  200. alias forward {
  201.   close -c $me
  202.   set %rcpt $$?="Forward message to whom?"
  203.   :back
  204.   set %comments $$?="Add any comments to forward (y/n)"
  205.   if %comments !isin yn goto back
  206.   .remove $mircdirdata\email.txt
  207.   set %lines $line(@E-MailáChecker,0)
  208.   dec %lines 4
  209.   set %replying $true
  210.   savebuf %topline $+ - $+ %lines @E-MailáChecker $mircdirdata\email.txt
  211.   set %subject Fwd: From %emailaddress [ $+ [ %currentaddress ] ]
  212.   if %comments == y {
  213.     write $mircdirdata\email.txt ==========================================================
  214.     write $mircdirdata\email.txt Message forwarded from: %emailaddress [ $+ [ %currentaddress ] ]
  215.     write $mircdirdata\email.txt ==========================================================
  216.     send.email
  217.     set %total $lines($mircdirdata\email.txt)
  218.     for 1 %total display.reply
  219.     for 1 2  iline %window %lines 0-
  220.   }
  221.   else send.message
  222. }
  223. alias send.message {
  224.   set %sending.mail 0
  225.   .msg $me DCC CHAT CHAT %smtp.ip 25 $+ 
  226.   .timer 1 3 window -c @MailáEntryáWindow
  227.   .timer300 60 60 invalid
  228.   .enable #mail
  229. }
  230. alias sendmail {
  231.   set %message $read -l $+ %loop $mircdirdata\email.txt
  232.   msg = $+ $me $strip(%message)
  233.   unset %message
  234. }
  235. #mail off
  236. on 1:chatopen:if $nick == $me { msg = $+ $me helo $ip }
  237. on 1:chat:*: {
  238.   inc %sending.mail
  239.   if $nick == $me && %sending.mail == 1 {
  240.     .timer300 off
  241.     msg = $+ $me mail from: %email
  242.     msg = $+ $me rcpt to: %rcpt
  243.     msg = $+ $me data
  244.     msg = $+ $me To: %rcpt
  245.     msg = $+ $me From: " $+ $me $+ " < $+ %emailaddress [ $+ [ %currentaddress ] ] $+ >
  246.     msg = $+ $me Subject: %subject
  247.     msg = $+ $me X-Mailer: Hawkee Pro v2.5 Mailer
  248.     for 1 $lines($mircdirdata\email.txt) sendmail
  249.     msg = $+ $me .  
  250.   }
  251.   elseif %sending.mail > 5 && $nick == $me {
  252.     msg = $+ $me quit
  253.     close -c $me
  254.     if %replying {
  255.       if $window(@E-MailáChecker).state == normal rline @E-MailáChecker $line(@E-MailáChecker,0)  $+ %color2 $+ $str(33,$chr(160)) ( $+ %color1 $+ E-mail message has been successfully transferred $+ %color2 $+ )
  256.       .enable #check
  257.       .msg $me DCC CHAT CHAT %pop.ip [ $+ [ %currentaddress ] ] 110
  258.       set %attach $true
  259.     }
  260.     echo %color2 -s E-mail message successfully sent to [ $+ %color1 $+ %rcpt $+  $+ %color2 $+ ]
  261.     unset %rcpt
  262.     unset %subject
  263.     unset %message
  264.     .disable #mail
  265.   }
  266. }
  267. #mail end
  268. #check off
  269. on 1:chat:*: {
  270.   if $nick == $me {
  271.     .timer300 off
  272.     set %email %emailaddress [ $+ [ %currentaddress ] ]
  273.     set %password %password [ $+ [ %currentaddress ] ]
  274.     if %password == $null set %password wrongpass
  275.     set %pos $pos(%email,@)
  276.     set %pos [ %pos - 1 ]
  277.     rline @E-MailáChecker 1  $+ %color2 Connection established with mail server: $+ %color1 %pop
  278.     rline @E-MailáChecker 2  $+ %color2 Now sending login info for: $+ %color1 %email
  279.     msg = $+ $me user $left(%pos,%email)
  280.     msg = $+ $me pass %password
  281.     msg = $+ $me stat
  282.     msg = $+ $me last
  283.     .disable #check
  284.     .enable #getmail
  285.     set %rotation 1
  286.   }
  287. }
  288. #check end
  289. #getmail off
  290. on 1:chat:*: {
  291.   if $nick == $me {
  292.     if -ERR isin $parms {
  293.       set %lines $line(@E-MailáChecker,0)
  294.       rline @E-MailáChecker 12  $+ %color4 ========================================================================
  295.       rline @E-MailáChecker %lines  $+ %color2 $+ Please press $+ %color1 F5 $+ %color2 to re-enter login information    
  296.       dec %lines
  297.       rline @E-MailáChecker %lines 4Error: $+ %color2 $2-
  298.       close -c $me
  299.       .disable #getmail
  300.       .disable #check
  301.     }
  302.     if %rotation == 1 || %rotation == 2 { inc %rotation | halt }
  303.     elseif %rotation == 3 {
  304.       set %messages $2
  305.       if %attach != $true {
  306.         rline @E-MailáChecker 2  $+ %color2 User logged in: $+ %color1 %email
  307.         rline @E-MailáChecker 13  $+ %color4 ========================================================================
  308.       }
  309.       inc %rotation 
  310.     }
  311.     elseif %rotation == 4 {
  312.       if $2 < %messages { 
  313.         set %number $2
  314.         inc %number
  315.         set %newmessages %messages - $2
  316.         if %attach != $true rline @E-MailáChecker 14  $+ %color2 New messages detected: $+ %color1 %newmessages  $+ %color2 $+ Press $+ %color1 F1 $+ %color2 to read message $+ %color1 %number  $+ %color2 $+ of $+ %color1 %messages
  317.       }
  318.       elseif %messages > 0 {
  319.         if %attach != $true {
  320.           set %number 1
  321.           rline @E-MailáChecker 14  $+ %color1 0 $+ %color2 unread messages detected. $+ %color1 %messages  $+ %color2 $+ detected on server.  Press $+ %color1 F1 $+ %color2 to read message $+ %color1 1
  322.         }
  323.       }
  324.       else {
  325.         close -c $me
  326.         if %attach != $true rline @E-MailáChecker 14  $+ %color2 No messages on server $+ %color1 Closing connection
  327.       }
  328.       .disable #login
  329.       if (%attach) { unset %attach }
  330.       set %rotation startnew
  331.     }
  332.     elseif %rotation == startnew {
  333.       set %go 0 
  334.       set %ready 0 
  335.       set %lines $line(@E-MailáChecker,0)
  336.       if %number > %messages set %remaining $+ %color1 <None> $+ %color2 You may close the connection by pressing $+ %color1 F3
  337.       else set %remaining %number  $+ %color2 $+ of $+ %color1 %messages  $+ %color2 $+ Press $+ %color1 F1 $+ %color2 or double click on this window to read next message.
  338.       rline @E-MailáChecker %lines  $+ %color2 $+ Current message: $+ %color1 %remaining 
  339.       dec %lines
  340.       rline @E-MailáChecker %lines  $+ %color1 F2: $+ %color2 Delete message.  $+ %color1 F3: $+ %color2 Close connection.
  341.       dec %lines
  342.       rline @E-MailáChecker %lines  $+ %color4 ========================================================================
  343.       unset %rotation
  344.     }  
  345.     else { 
  346.       if ( Content-Disposition: isin $1- && filename isin $1- ) || ( Content-Type: isin $1- && application/octet-stream isin $1- )  {
  347.         close -c $me
  348.         set %lines $line(@E-MailáChecker,0)
  349.         dec %lines 2
  350.         iline @E-MailáChecker %lines $chr(160)
  351.         iline @E-MailáChecker %lines  $+ %color2 $+ $str(20,$chr(160)) Reconnecting to mail server in order to skip Attachment, please wait
  352.         iline @E-MailáChecker %lines  $+ %color3 $+ $str(35,$chr(160)) **********************************************************
  353.         iline @E-MailáChecker %lines  $+ %color2 $+ $str(53,$chr(160)) File name: $+ %color1 $2- 
  354.         iline @E-MailáChecker %lines  $+ %color2 $+ $str(38,$chr(160)) Attachment Detected, cannot retrieve with mIRC 
  355.         iline @E-MailáChecker %lines  $+ %color3 $+ $str(35,$chr(160)) **********************************************************  
  356.         iline @E-MailáChecker %lines $chr(160)  
  357.         set %attach $true
  358.         inc %number
  359.         .msg $me DCC CHAT CHAT %pop.ip [ $+ [ %currentaddress ] ] 110
  360.         .enable #check
  361.         halt
  362.       }
  363.       if $parms == $null inc %ready 
  364.       set %lines $line(@E-MailáChecker,0)
  365.       dec %lines 2
  366.       if From isin $1 && %ready == 0 {
  367.         inc %go
  368.         set %checkfrom 1
  369.         :loop
  370.         if $ [ $+ [ %checkfrom ] ] == $null goto end
  371.         if @ isin $ [ $+ [ %checkfrom ] ] {
  372.           set %address $ [ $+ [ %checkfrom ] ]
  373.           set %rcpt $remove(%address,")
  374.           set %rcpt $remove(%rcpt,<)
  375.           set %rcpt $remove(%rcpt,>)
  376.           goto end
  377.         }
  378.         inc %checkfrom
  379.         goto loop
  380.         :end
  381.         unset %checkfrom
  382.         unset %address
  383.         set %reply.button Reply to Current
  384.         iline @E-MailáChecker %lines  $+ %color2 $1 $+  $+ %color1 $2-
  385.         set %lines $line(@E-MailáChecker,0)
  386.         dec %lines
  387.         if %rcpt == $null   rline @E-MailáChecker %lines $line(@E-MailáChecker,%lines)  $+ %color2 No reply address found
  388.         else rline @E-MailáChecker %lines $line(@E-MailáChecker,%lines)  $+ %color1 F4: $+ %color2 Reply to: $+ %color1 %rcpt     
  389.       }
  390.       elseif  Subject isin $1 && %ready == 0 {  iline @E-MailáChecker %lines  $+ %color2 $1 $+  $+ %color1 $2- | inc %go | set %subject $2- }
  391.       elseif  Reply-To: isin $1 && %ready == 0 halt
  392.       elseif  Status: isin $1- && RO isin $parms && %ready == 0 iline @E-MailáChecker %lines  $+ %color2 ( $+ %color3 $+ Message has been viewed already $+ %color2 $+ )
  393.       elseif  To isin $1 && %ready == 0 {  iline @E-MailáChecker %lines  $+ %color2 $1 $+  $+ %color1 $2- | inc %go }
  394.       elseif  Date isin $1 && %ready == 0 {
  395.         iline @E-MailáChecker %lines  $+ %color2 $1 $+  $+ %color1 $2- 
  396.         inc %go
  397.         write -c $mircdirdata\email.txt On $2- $+ , you wrote:
  398.       }
  399.       elseif $1 == $null {
  400.         iline @E-MailáChecker %lines $chr(160)
  401.         write $mircdirdata\email.txt >
  402.       }
  403.       elseif $1- == . { inc %number | .disable #getmail }
  404.       elseif %go >= 3 && %ready >= 1 { 
  405.         if $len($1-) > 80 chops check.mail 80 $1-
  406.         else {
  407.           iline @E-MailáChecker %lines  $+ %color2 $1-
  408.           write $mircdirdata\email.txt > $1-
  409.         }
  410.       }
  411.     }
  412.   }
  413. }
  414. #getmail end
  415. alias chops {
  416.   set %count $len($3-) / $2
  417.   inc %count
  418.   unset %piece
  419.   set %phrase $3-
  420.   donefor 1 $1 $2
  421. }
  422. alias write.mail {
  423.   set %message $chop(%loop,$1,%phrase)
  424.   iline @MailáEntryáWindow %lines  $+ %color2 %message
  425.   write $mircdirdata\email.txt %message
  426.   inc %lines
  427. }
  428. alias check.mail {
  429.   set %message $chop(%loop,$1,%phrase)
  430.   iline @E-MailáChecker %lines  $+ %color2 %message
  431.   write $mircdirdata\email.txt > %message
  432.   inc %lines
  433. }
  434. alias chop {
  435.   if $1 != 1 inc %spot $2
  436.   else { set %spot 1 | unset %piece }
  437.   set %check [ [ %spot ] + [ $2 ] ] 
  438.   if %check <= $len($3-) {
  439.     set %chunk $mid($3-,%spot,$2) 
  440.     if %piece != $null {  
  441.       set %chunk [ [ %piece ] $+ [ %chunk ] ]
  442.       dec %spot $len(%piece)
  443.       set %chunk $mid(%chunk,1,$2)
  444.       unset %piece
  445.     }
  446.   }
  447.   else {
  448.     if %piece != $null set %chunk [ [ %piece ] $+ [ $mid($3-,%spot,$2) ] ]
  449.     else set %chunk $mid($3-,%spot,$2)
  450.     unset %done
  451.     return %chunk
  452.   }  
  453.   set %position [ [ %spot ] + [ $len(%chunk) ] ]
  454.   set %next [ [ %position ] - 1 ]
  455.   if $asc($mid($3-,%next,1)) == 32 || $asc($mid($3-,%position,1)) == 32  return %chunk 
  456.   set %spaces $count(%chunk,$chr(32))
  457.   if %spaces == 0 return %chunk 
  458.   set %range 1 $+ - $+ %spaces
  459.   set %newchunk $gettok(%chunk,%range,32)
  460.   inc %spaces
  461.   set %piece $gettok(%chunk,%spaces,32)
  462.   return %newchunk
  463.   :end
  464. }
  465. menu @E-MailáSetup {
  466.   dclick window -c @E-MailáSetup | F1
  467.   Your Address
  468.   .%emailaddress1:activateaddress 1
  469.   .%emailaddress2:activateaddress 2
  470.   .%emailaddress3:activateaddress 3
  471.   .%emailaddress4:activateaddress 4
  472.   .%emailaddress5:activateaddress 5
  473.   .-
  474.   .%newaddress:newemail
  475.   .%removeaddress:delemail
  476.   Servers
  477.   .Post Office Server (POP):set %pop $+ %currentaddress $$?="Please enter your mail server's POP domain" | set %pop %pop [ $+ [ %currentaddress ] ] | checkserver pop
  478.   .Send Mail Server (SMTP):set %smtp $$?="Please enter your servers SMTP address" | checkserver smtp 
  479.   Password
  480.   .Set:set %password $+ %currentaddress $$?="Please enter your E-Mail password" | set %password %password [ $+ [ %currentaddress ] ] | email
  481.   .-
  482.   .Hide:set %hide true | email 
  483.   .Display:set %hide false | email
  484.   -
  485.   Close:window -c @E-MailáSetup  
  486. }
  487. alias checkserver {
  488.   .enable #checkdomain
  489.   if $1 == pop {
  490.     if $window(@E-MailáSetup).state == normal rline @E-MailáSetup 3  $+ %color2 Pop server address: $+ %color1 Checking
  491.     set %checking.server pop
  492.     dns %pop
  493.   }
  494.   else {
  495.     if $window(@E-MailáSetup).state == normal rline @E-MailáSetup 4  $+ %color2 Mail Transfer address: $+ %color1 Checking
  496.     set %checking.server smtp  
  497.     dns %smtp
  498.   }
  499.   .timer300 1 60 invalid
  500. }
  501. #checkdomain off
  502. alias currentaddress return %currentaddress
  503. on 1:dns: {
  504.   .timer300 off
  505.   if %checking.server == pop {
  506.     if $raddress == $null { if $window(@E-MailáSetup).state == normal rline @E-MailáSetup 3  $+ %color2 Pop server address:4 Bad Address | unset %pop.ip $+ $currentaddress | goto done }
  507.     if $window(@E-MailáSetup).state == normal rline @E-MailáSetup 3  $+ %color2 Pop server address: $+ %color1 %pop  $+ %color2 $+ ok
  508.     set %pop.ip $+ %currentaddress $longip($raddress)
  509.   }
  510.   else {
  511.     if $raddress == $null { if $window(@E-MailáSetup).state == normal rline @E-MailáSetup 4  $+ %color2 Mail Transfer address:4 Bad Address | unset %smtp.ip | unset %smtp | goto done }
  512.     if $window(@E-MailáSetup).state == normal rline @E-MailáSetup 4  $+ %color2 Mail Transfer address: $+ %color1 %smtp  $+ %color2 $+ ok
  513.     set %smtp.ip $longip($raddress)
  514.   }
  515.   :done
  516.   .disable #checkdomain
  517.   halt
  518. }
  519. #checkdomain end
  520. alias pass {
  521.   set %pass ""
  522.   if %hide == true set %pass $left($len(%password),*****************)
  523.   else set %pass %password
  524.   return %pass
  525.   unset %pass
  526. }
  527. alias delemail {
  528.   set %request $$?="Enter Address You wish to Remove"
  529.   set %okadd 0
  530.   unset %deleted
  531.   for 1 5 deleteemail  
  532. }
  533. alias loop return %loop
  534. alias deleteemail {
  535.   if %emailaddress [ $+ [ %loop ] ] != $null inc %okadd 
  536.   if %emailaddress [ $+ [ %loop ] ] == %request {
  537.     unset %emailaddress $+ $loop
  538.     unset %password $+ $loop
  539.     unset %pop.ip $+ $loop
  540.     unset %pop $+ $loop
  541.     set %deleted $true
  542.     if %currentaddress == %loop email
  543.   }
  544.   if %loop == 5 && %okadd <= 5 { set %newaddress Add Address }
  545.   if %loop == 5 && %okadd == 1 && %deleted { unset %removeaddress }
  546. }
  547. alias activateaddress {
  548.   set %email %emailaddress [ $+ [ $1 ] ] 
  549.   if %password [ $+ [ $1 ] ] == $null set %password None Set 
  550.   else set %password %password [ $+ [ $1 ] ]
  551.   if %pop [ $+ [ $1 ] ] == $null set %pop None Set 
  552.   else set %pop %pop [ $+ [ $1 ] ]
  553.   set %currentaddress $1
  554.   email
  555. }
  556. alias newemail {
  557.   set %okadd 0
  558.   set %doneone $false
  559.   for 1 5 checkaddresses
  560. }
  561. alias checkaddresses {
  562.   if %emailaddress [ $+ [ %loop ] ] != $null inc %okadd
  563.   if %emailaddress [ $+ [ %loop ] ] == $null && %doneone == $false {
  564.     set %emailaddress [ $+ [ %loop ] ] $$?="Enter New E-Mail Address"
  565.     if %removeaddress == $null set %removeaddress Remove Address
  566.     activateaddress %loop
  567.     set %doneone $true
  568.   }
  569.   if %okadd == 4 && %loop == 5 unset %newaddress
  570. }
  571. menu @E-MailáChecker {
  572.   dclick F1
  573.   Next message:F1
  574.   -
  575.   Delete Message:F2
  576.   %reply.button:F4
  577.   Forward Message:forward
  578.   Skip to Message:set %number $$?="Skip to what message?" | F1
  579.   -
  580.   Close:window -c @E-MailáChecker | close -c $me
  581. }
  582. alias donefor {
  583.   set %loop $1
  584.   set %done no
  585.   :loop
  586.   if %done == $null goto end
  587.   *2
  588.   inc %loop
  589.   goto loop
  590.   :end
  591. }
  592. alias for {
  593.   set %loop $1
  594.   :loop
  595.   if %loop > $2 goto end
  596.   *3
  597.   inc %loop
  598.   goto loop
  599.   :end
  600. }
  601. alias invalid {
  602.   close -c $me
  603.   .timer300 off
  604.   echo 2 -
  605.   echo 4 -s Connection to mail server timed out
  606.   echo %color2 -s Please try one of the following to obtain a connection:
  607.   echo %color1 -s 1: $+ %color2 Try entering the Mail prefix ex:  $+ %color3 $+ mail $+ %color2 $+ .geocities.com 
  608.   echo %color1 -s 2: $+ %color2 Make sure you have entered only the domain
  609.   echo %color1 -s 3: $+ %color2 Be sure you are attempting to connect to a POP3 or SMTP account
  610.   echo %color1 -s 4: $+ %color2 Attempt connection later
  611.   echo %color1 -s 5: $+ %color2 Outgoing email, press $+ %color4 Shift+F2 $+ %color2 to retry same message
  612.   echo %color3 -s You may press $+ %color2 F5 $+ %color3 to re-enter your server addresses
  613.   echo 2 -
  614.   .disable #checkdomain
  615.   .disable #check
  616.   .disable #mail
  617. }
  618.