Did I ever tell you about the time I accidentally sent myself 80,000 mail messages?
We run Compact on our mail servers every night to squeeze out all the white space and to help users stay under their quotas. We had set up a monitor to help us identify which databases had more than 10% white space, indicating that they probably had not compacted successfully. However, the monitor was not working very well and failed to notify us when our vice president's mailbox did not compact.
So after that incident, I wrote an agent to scan our server logs looking for mail files that did not compact successfully overnight. It was set to run "Manually from Actions Menu" and was working beautifully. Whenever I ran it, it sent me a nice little list of mail files that had over 10% white space. However, I did not want to have to run the agent myself. I wanted it to run as a scheduled agent and to automatically send me this e-mail at 6:00 a.m. every morning.
I very cleverly changed the agent to run "On Schedule Daily," set it to run at 6:00 a.m., then saved the agent. Fortunately, this was around 4:30 p.m., when most of my co-workers call it a day and go home, because the agent took it upon itself to run immediately. Meanwhile, I was happily adding the code needed to ensure that it would only send me ONE message. By the time I realized that I should have added this code BEFORE I saved the agent, my mailbox was being flooded; the agent ran once for each document in the server log, which was about 80,000 documents, and promptly sent me 80,000 identical e-mails.
Our primary mail server had no problem handling this load, but my mailbox was on a smaller server being used to test new software (most of my management also had their mailboxes on this server). The smaller server quickly ran out of memory and crashed. As soon as I got it running again, the primary mail server dumped another load of messages into the mail.box and crashed it again. And again. And again. It was 7:30 p.m. before I finally got the backlog of messages cleared up, got the server back up and running again, and all the routers restarted.
As the mail.box got flooded with messages and crashed the server, I would rename the mail.box and let the server create a new one the next time it came up, so by the time all this was done, I had several mail.boxes with various names. I had to open the renamed mail.boxes and filter out all the messages I had sent myself without deleting the "good" messages that were also there. As the final step in cleaning up my mess, I needed to get these "good" messages back into a working mail.box so they could continue on their way. I decided to copy them from the renamed mail.box and paste them into the working mail.box. Then they should route just fine, right?
Well, sort of...they routed to the intended recipient just fine, but they ALL showed up as being from ME, instead of being from whoever had actually sent the message. Needless to say, that was noticed and caused a few questions.
I suspect that this little escapade cost me quite a few "Attaboys" and will be remembered in my next performance evaluation, but since most of the impact was limited to MY MANAGEMENT, there was no public flogging for this one.
In case anybody is feeling lucky, here's what needs to be done to set up the agent to run on YOUR servers:
In the server log, create a view for the agent to use with the following alias: WHITE SPACE OVER 10.
You can name the view anything you want, but I suggest: (White Space Over 10) View Selection Formula.
Folder := @Left(Pathname ; "\\" ) ; SELECT (Form = "Activity" | Form = "Size") & @LowerCase(Folder) = "mail" &The view should have a single, sorted column with the following Column Formula:
@Round(DiskUsage * 100 / DiskSpace; 1) < 90
PerCentUsed := @Round(DiskUsage * 100 / DiskSpace; 1) ; MailboxSizeKB := @Round(DiskSpace / 1024); MailboxSize := @If(MailboxSizeKB < 1024 ; "<1" ; @LeftBack(@Text(MailboxSizeKB) ; 3) ) ; @Text(PerCentUsed) + " % " + @If(@Length(MailboxSize) = 3 ; MailboxSize ; " " + MailboxSize) + " MB " + @V2If(@IsAvailable(Title); Title; Pathname)
Create an agent scheduled to run daily at whatever time you want, preferably sometime after the Log task has finished. Suggested name for this agent: Send White Space E-Mail.
Paste in the following formula and replace the "NotesAdmin" in the last line with whoever you want to receive the e-mail(s). (Note that the very first line is the one that tells the agent to send you only ONE e-mail!).
SELECT Form = "Activity" & Pathname = "log.nsf" ; ListLookup := @DbColumn("":"NoCache" ; "":"" ; "WHITE SPACE OVER 10" ; 1) ; ColumnHeaders := " % DB Size Database Title" + @NewLine + "Used" +@NewLine + @NewLine ; MailboxList := @If(@IsError(ListLookup) ; "ERROR: " + @Text(ListLookup) ; ListLookup = "" ; "No Mailboxes With Excess White Space Found" ; @Implode(ListLookup ; @NewLine)) ; MailSubject := @If(ListLookup = "" ; "No Mailboxes With Excess White Space Found" ; "Mailboxes That Have Over 10% White Space") ; MailMessage := @If(ListLookup = "" ; "No mailboxes with over 10% white space were found." ; ColumnHeaders + MailboxList) ; @MailSend( "NotesAdmin" ; "" ; "" ; MailSubject ; MailMessage ; "" )
Do you have your own blooper? Send it in and claim your fame.
Every story in our bloopers series comes to us directly from a SearchDomino.com administrator, developer or consultant. For obvious reasons, some contributors choose to remain anonymous.
Read all SearchDomino.com's true bloopers.
View our Best Web Links on Domino/Notes administration.