# This script simply checks for and grabs the address of any nickname and # mails them a file using Mail. It is configurable for other mailers. # Jake [WinterHawk] Khuon, 25 Nov 93 # Special thanks to CyberMage for netcheck, restore, and the basis for # mailfile # (tm) Jake [WinterHawk] Khuon # Usage: /MAILFILE [-u] []/ [] # Defines the $nick and $userhost from USERHOST output on ^302 "*" { if (idctr == 0) { if ([$3@$4] != [@]) { echo [USERHOST] $0 is $3@$4. }{ echo [USERHOST] >>> <$0> IS NOT CURRENTLY ON THE NET <<< } }{ if ([$3@$4] != [@]) { @ nick = [$0] @ user = [$3] @ host = [$4] @ userhost = [$3@$4] } } } # Restores some ASSIGNs alias restore { @ idctr = 0 if (nick) { ^assign -nick } if (user) { ^assign -user } if (host) { ^assign -host } if (userhost) { ^assign -userhost } } # This checks for and gets the LUSER's address alias netcheck { userhost $0 wait if (userhost) { @ function_return = 1 }{ whowas $0 wait if (userhost) { @ function_return = 1 }{ @ function_return = 0 } } } # This mails it alias mailfile { if ([$0]!=[-u]) { @ idctr = 1 if (netcheck($0)) { if (rmatch($userhost ~%@%)) { echo [MAIL] >>> MAILING $1 TO <$nick!$strip(~ $userhost)> WITH Subject: $2- <<< exec Mail -s "$2-" $strip(~ $userhost) < $1 restore }{ echo [MAIL] >>> MAILING $1 TO <$nick!$userhost> WITH Subject: $2- <<< exec Mail -s "$2-" $userhost < $1 restore } }{ echo [NETCHECK] >>> <$0> IS NOT CURRENTLY ON THE NET <<< restore } }{ @ idctr = 1 if (netcheck($1)) { if (rmatch($userhost ~%@%)) { echo [UUENCODE] >>> INVOKING uuencode ON $2 <<< exec -name uuencode uuencode $2 $2 > $2.uu ^on ^exec_exit "%uuencode % 0 " exec -name Mail Mail -s "$3-" $strip(~ $userhost) < $2.uu echo [MAIL] >>> MAILING $2.uu TO <$nick!$strip(~ $userhost)> WITH Subject: $3- <<< ^on ^exec_exit "%Mail % 0" exec rm $2.uu restore }{ echo [UUENCODE] >>> INVOKING uuencode ON $2 <<< exec -name uuencode uuencode $2 $2 > $2.uu ^on ^exec_exit "%uuencode % 0" exec -name Mail Mail -s "$3-" $userhost < $2.uu echo [MAIL] >>> MAILING $2.uu TO <$nick!$userhost> WITH Subject: $3- <<< ^on ^exec_exit "%Mail % 0" exec rm $2.uu restore } }{ echo ***[NETCHECK] >>> <$0> IS NOT CURRENTLY ON THE NET <<< restore } } } echo *** Loading Mail Module ***