@verb #2323:"mailReport" this none this rxd #7214 @program #2323:"mailReport" this none this "void $ddd:mailReport()" "Mails the daily reports. Called by the $clock every few minutes." caller_perms():controls(this) || raise(E_PERM, "Don't touch me there!") mailFailed = 0 "Forward the activity logs." activityLog = this.activityLog this.activityLog = {} suspend(0) retvalActivity = `$network:sendmail(this.addressForActivity, "Activity Logs for " + $time_utils:ddmmyy(time()), @activityLog) ! ANY => 1' if (retvalActivity) ticks_left() < 2000 || seconds_left() < 2 ? suspend(0) | 0 this.activityLog = {@activityLog, @this.activityLog} mailFailed = 1 endif "Forward the connection logs." connectionLog = this.connectionLog this.connectionLog = {} suspend(0) retvalConnection = `$network:sendmail(this.addressForConnections, "Connection Logs for " + $time_utils:ddmmyy(time()), @connectionLog) ! ANY => 1' if (retvalConnection) ticks_left() < 2000 || seconds_left() < 2 ? suspend(0) | 0 this.connectionLog = {@connectionLog, @this.connectionLog} mailFailed = 1 endif "Error reporting." if (mailFailed) $mail_agent:send_message(this, {this.owner}, {"Statistics Mail Failure"}, {tostr("Mail forwarding failed at " + ctime()) + ".", tostr("Activity: " + retvalActivity)}) else this.lastMailSuccess = time() endif "Last modified by JS (#7214) on Sun May 8 19:45:00 2005 MDT." .