XMAI2 ;ISC-SF/GMB -Send a message if too many messages ;04/19/2002 12:41
;;8.0;MailMan;;Jun 28, 2002
; Was (WASH ISC)/CAP/L.RHODE
; Entry points used by MailMan options (not covered by DBIA):
; ENTER XMMGR-DISK-MANY-MESSAGE-MAINT
ENTER ;
N XMMAX,XMSAVE,XMABORT,I
S XMABORT=0
D INIT(.XMMAX,.XMABORT) Q:XMABORT
I $D(ZTQUEUED) D PROCESS Q
F I="XMMAX" S XMSAVE(I)="" ;MailMan: Many Msg Maint Request
D EN^XUTMDEVQ("PROCESS^XMAI2",$$EZBLD^DIALOG(36600),.XMSAVE)
Q
INIT(XMMAX,XMABORT) ;
S XMMAX=500 ; Threshold number of messages a user can own
Q:$D(ZTQUEUED)
N DIR,Y,DIRUT,XMTEXT
W !
;This option sends a message to every user who has more than a
;certain number of messages in his or her mailbox, asking the user
;to terminate unnecessary messages.
D BLD^DIALOG(36601,"","","XMTEXT","F")
D MSG^DIALOG("WM","","","","XMTEXT")
W !
S DIR(0)="N^10::"
S DIR("A")=$$EZBLD^DIALOG(36602) ;Enter the 'many message' threshold
S DIR("B")=XMMAX
D BLD^DIALOG(36603,"","","DIR(""?"")") ;How many messages may a user have before MailMan sends a nastygram?
D ^DIR I $D(DIRUT) S XMABORT=1 Q
S XMMAX=Y
W !
;Messages will be sent to owners of more than |1| messages.
;This option may take awhile - you may wish to queue it.
D BLD^DIALOG(36604,XMMAX,"","XMTEXT","F")
D MSG^DIALOG("WM","","","","XMTEXT")
Q
PROCESS ; (Requires XMMAX)
N XMUSER,XMCNT
S XMUSER=.9999
F S XMUSER=$O(^XMB(3.7,XMUSER)) Q:XMUSER'>0 D
. S XMCNT=$$TMSGCT^XMXUTIL(XMUSER)
. D:XMCNT>XMMAX MESSAGE(XMUSER,XMCNT)
S:$D(ZTQUEUED) ZTREQ="@"
Q
MESSAGE(XMTO,XMCNT) ; Send message
N XMPARM,XMINSTR
S XMINSTR("FROM")=.5,XMINSTR("FLAGS")="I"
S XMPARM(1)=XMCNT,XMPARM(2)=$$BMSGCT^XMXUTIL(XMTO,1)
D TASKBULL^XMXBULL(.5,"XM TOO MANY MESSAGES",.XMPARM,"",XMTO,.XMINSTR)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMAI2 1805 printed Oct 16, 2024@18:11:46 Page 2
XMAI2 ;ISC-SF/GMB -Send a message if too many messages ;04/19/2002 12:41
+1 ;;8.0;MailMan;;Jun 28, 2002
+2 ; Was (WASH ISC)/CAP/L.RHODE
+3 ; Entry points used by MailMan options (not covered by DBIA):
+4 ; ENTER XMMGR-DISK-MANY-MESSAGE-MAINT
ENTER ;
+1 NEW XMMAX,XMSAVE,XMABORT,I
+2 SET XMABORT=0
+3 DO INIT(.XMMAX,.XMABORT)
if XMABORT
QUIT
+4 IF $DATA(ZTQUEUED)
DO PROCESS
QUIT
+5 ;MailMan: Many Msg Maint Request
FOR I="XMMAX"
SET XMSAVE(I)=""
+6 DO EN^XUTMDEVQ("PROCESS^XMAI2",$$EZBLD^DIALOG(36600),.XMSAVE)
+7 QUIT
INIT(XMMAX,XMABORT) ;
+1 ; Threshold number of messages a user can own
SET XMMAX=500
+2 if $DATA(ZTQUEUED)
QUIT
+3 NEW DIR,Y,DIRUT,XMTEXT
+4 WRITE !
+5 ;This option sends a message to every user who has more than a
+6 ;certain number of messages in his or her mailbox, asking the user
+7 ;to terminate unnecessary messages.
+8 DO BLD^DIALOG(36601,"","","XMTEXT","F")
+9 DO MSG^DIALOG("WM","","","","XMTEXT")
+10 WRITE !
+11 SET DIR(0)="N^10::"
+12 ;Enter the 'many message' threshold
SET DIR("A")=$$EZBLD^DIALOG(36602)
+13 SET DIR("B")=XMMAX
+14 ;How many messages may a user have before MailMan sends a nastygram?
DO BLD^DIALOG(36603,"","","DIR(""?"")")
+15 DO ^DIR
IF $DATA(DIRUT)
SET XMABORT=1
QUIT
+16 SET XMMAX=Y
+17 WRITE !
+18 ;Messages will be sent to owners of more than |1| messages.
+19 ;This option may take awhile - you may wish to queue it.
+20 DO BLD^DIALOG(36604,XMMAX,"","XMTEXT","F")
+21 DO MSG^DIALOG("WM","","","","XMTEXT")
+22 QUIT
PROCESS ; (Requires XMMAX)
+1 NEW XMUSER,XMCNT
+2 SET XMUSER=.9999
+3 FOR
SET XMUSER=$ORDER(^XMB(3.7,XMUSER))
if XMUSER'>0
QUIT
Begin DoDot:1
+4 SET XMCNT=$$TMSGCT^XMXUTIL(XMUSER)
+5 if XMCNT>XMMAX
DO MESSAGE(XMUSER,XMCNT)
End DoDot:1
+6 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+7 QUIT
MESSAGE(XMTO,XMCNT) ; Send message
+1 NEW XMPARM,XMINSTR
+2 SET XMINSTR("FROM")=.5
SET XMINSTR("FLAGS")="I"
+3 SET XMPARM(1)=XMCNT
SET XMPARM(2)=$$BMSGCT^XMXUTIL(XMTO,1)
+4 DO TASKBULL^XMXBULL(.5,"XM TOO MANY MESSAGES",.XMPARM,"",XMTO,.XMINSTR)
+5 QUIT