source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMTDL1.m@ 1270

Last change on this file since 1270 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1XMTDL1 ;ISC-SF/GMB-Deliver local mail to mailbox (cont.) ;04/15/2003 12:53
2 ;;8.0;MailMan;**18**;Jun 28, 2002
3BRODCAST(XMZ,XMZSUBJ,XMZFROM,XMFROM,XMK,XMDEL,XMZPDATE,XMZBSKT,XMACNT) ;
4 N XMTO,XMREC,XMIA,XMNOFWD
5 ; Don't forward message if this is FORUM and it was sent to G.EVERYBODY.
6 S XMNOFWD=$S('$$FORUM^XMXADDRD:0,'$D(^XMB(3.9,XMZ,6,"B","G.EVERYBODY")):0,1:1)
7 D INIT^XMXADDR
8 S (XMTO,XMIA)=0
9 F S XMTO=$O(^XMB(3.7,XMTO)) Q:'XMTO D
10 . Q:$P($G(^VA(200,XMTO,0)),U,3)=""!($P($G(^(.1)),U,2)="")!($P($G(^(201)),U)="") ; Quit if no access code, or verify code, or primary menu
11 . Q:$D(^XUSEC("XM NO BROADCASTS",XMTO)) ; Quit if user doesn't want broadcast messages
12 . S XMACNT=XMACNT+1
13 . S XMREC=$G(^XMB(3.7,XMTO,0)) Q:XMREC=""
14 . I $P(XMREC,U,2)=""!XMNOFWD D DELIVER^XMTDL2(XMTO,XMZ,XMZSUBJ,XMZFROM,XMFROM,0,$G(XMK(XMTO)),$G(XMDEL(XMTO),XMZPDATE),XMZBSKT) Q
15 . N XMERROR,XMFULL,XMFWDADD
16 . S XMFWDADD=XMTO
17 . D REMOTE^XMXADDR3(.5,$P(XMREC,U,2),0,"","",.XMFULL)
18 . I $D(XMERROR) D DELFWD^XMVVITA(XMTO,$P(XMREC,U,2),XMERROR)
19 . I '$D(XMERROR),$D(^TMP("XMY",$J,XMFULL)) S ^TMP("XMY",$J,XMFULL,"F")=XMTO
20 . I $P(XMREC,U,8)!$D(XMERROR)!'$D(^TMP("XMY",$J,$G(XMFULL,"?"))) D DELIVER^XMTDL2(XMTO,XMZ,XMZSUBJ,XMZFROM,XMFROM,0,$G(XMK(XMTO)),$G(XMDEL(XMTO),XMZPDATE),XMZBSKT)
21 S XMTO=0
22 F S XMTO=$O(^TMP("XMY",$J,XMTO)) Q:+XMTO'=XMTO K ^(XMTO) ; Don't forward to locals
23 I $$GOTADDR^XMXADDR D
24 . N XMINSTR
25 . S XMINSTR("FWD BY")=""
26 . D FWD^XMKP(.5,XMZ,.XMINSTR)
27 D CLEANUP^XMXADDR
28 Q
29STATS(XMGROUP,XMQUEUE,XMMCNT,XMRCNT,XMACNT) ;
30 ; The following global is incremented in STATS^XMKPLQ
31 ; # messages in queue^# recipients anticipated
32 N XMSTATS
33 L +^XMBPOST("QSTATS",XMGROUP,XMQUEUE)
34 S XMSTATS=^XMBPOST(XMGROUP,XMQUEUE),^(XMQUEUE)=($P(XMSTATS,U)-XMMCNT)_U_($P(XMSTATS,U,2)-XMRCNT)
35 L -^XMBPOST("QSTATS",XMGROUP,XMQUEUE)
36 ; The following global is incremented here only.
37 ; # recipients delivered
38 L +^XMBPOST("GSTATS",XMGROUP)
39 S ^(XMGROUP)=$G(^XMBPOST("STATS",XMGROUP))+$G(XMACNT)
40 L -^XMBPOST("GSTATS",XMGROUP)
41 Q
Note: See TracBrowser for help on using the repository browser.