Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XMAI2

XMAI2.m

Go to the documentation of this file.
  1. XMAI2 ;ISC-SF/GMB -Send a message if too many messages ;04/19/2002 12:41
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ; Was (WASH ISC)/CAP/L.RHODE
  1. ; Entry points used by MailMan options (not covered by DBIA):
  1. ; ENTER XMMGR-DISK-MANY-MESSAGE-MAINT
  1. ENTER ;
  1. N XMMAX,XMSAVE,XMABORT,I
  1. S XMABORT=0
  1. D INIT(.XMMAX,.XMABORT) Q:XMABORT
  1. I $D(ZTQUEUED) D PROCESS Q
  1. F I="XMMAX" S XMSAVE(I)="" ;MailMan: Many Msg Maint Request
  1. D EN^XUTMDEVQ("PROCESS^XMAI2",$$EZBLD^DIALOG(36600),.XMSAVE)
  1. Q
  1. INIT(XMMAX,XMABORT) ;
  1. S XMMAX=500 ; Threshold number of messages a user can own
  1. Q:$D(ZTQUEUED)
  1. N DIR,Y,DIRUT,XMTEXT
  1. W !
  1. ;This option sends a message to every user who has more than a
  1. ;certain number of messages in his or her mailbox, asking the user
  1. ;to terminate unnecessary messages.
  1. D BLD^DIALOG(36601,"","","XMTEXT","F")
  1. D MSG^DIALOG("WM","","","","XMTEXT")
  1. W !
  1. S DIR(0)="N^10::"
  1. S DIR("A")=$$EZBLD^DIALOG(36602) ;Enter the 'many message' threshold
  1. S DIR("B")=XMMAX
  1. D BLD^DIALOG(36603,"","","DIR(""?"")") ;How many messages may a user have before MailMan sends a nastygram?
  1. D ^DIR I $D(DIRUT) S XMABORT=1 Q
  1. S XMMAX=Y
  1. W !
  1. ;Messages will be sent to owners of more than |1| messages.
  1. ;This option may take awhile - you may wish to queue it.
  1. D BLD^DIALOG(36604,XMMAX,"","XMTEXT","F")
  1. D MSG^DIALOG("WM","","","","XMTEXT")
  1. Q
  1. PROCESS ; (Requires XMMAX)
  1. N XMUSER,XMCNT
  1. S XMUSER=.9999
  1. F S XMUSER=$O(^XMB(3.7,XMUSER)) Q:XMUSER'>0 D
  1. . S XMCNT=$$TMSGCT^XMXUTIL(XMUSER)
  1. . D:XMCNT>XMMAX MESSAGE(XMUSER,XMCNT)
  1. S:$D(ZTQUEUED) ZTREQ="@"
  1. Q
  1. MESSAGE(XMTO,XMCNT) ; Send message
  1. N XMPARM,XMINSTR
  1. S XMINSTR("FROM")=.5,XMINSTR("FLAGS")="I"
  1. S XMPARM(1)=XMCNT,XMPARM(2)=$$BMSGCT^XMXUTIL(XMTO,1)
  1. D TASKBULL^XMXBULL(.5,"XM TOO MANY MESSAGES",.XMPARM,"",XMTO,.XMINSTR)
  1. Q