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

XMR3A.m

Go to the documentation of this file.
  1. XMR3A ;ISC-SF/GMB-XMR3 (cont.) ;04/17/2002 11:16
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. CHEKDUP ;
  1. N XMZCHK,XMTO
  1. ;REJECT ON PURGED MESSAGE PROTECT FOC-AUSTIN
  1. ;DO NOT CHANGE WITHOUT COORDINATING
  1. S XMZCHK=$$LOCALXMZ(XMREMID)
  1. ;Set up "AI" cross reference -- since XMBX is replicated at FOC-Austin
  1. ;set pseudo node first so that if DDP is down, failure will occur before
  1. ;message is considered received.
  1. ;
  1. ;Accept as new message if NOT HERE
  1. Q:'XMZCHK
  1. ; We already have the message
  1. I $P(XMZCHK,U,3)'="E"!(XMZ=+XMZCHK) D Q
  1. . S XMSG="554 Duplicate (purged). Msg rejected." X XMSEN
  1. . D KILLIT
  1. . S XMREJECT=1
  1. S XMTO=""
  1. F S XMTO=$O(^TMP("XMY",$J,XMTO)) Q:XMTO="" I $D(^XMB(3.7,"M",+XMZCHK,XMTO)) K ^TMP("XMY",$J,XMTO)
  1. I $O(^TMP("XMY",$J,""))="" D Q
  1. . S XMSG="254 Duplicate (no add'l recipients). Msg rejected." X XMSEN
  1. . D KILLIT
  1. . S XMREJECT=1
  1. ; We are forwarding a msg which already exists on our system
  1. ; to recipients who don't currently have it in their mailbox.
  1. K XMZFDA ; When we implement true 'forwarded by', we'll have to retain that.
  1. D KILLIT
  1. S XMZ=+XMZCHK
  1. Q
  1. KILLIT ;
  1. K XMREMID
  1. D ZAPIT^XMXMSGS2(.5,.95,XMZ)
  1. D KILLMSG^XMXUTIL(XMZ)
  1. Q
  1. LOCALXMZ(XMREMID) ; Given a remote id, function returns XMZ if the message
  1. ; can be or was ever found locally.
  1. ; If no record of it, returns null.
  1. ; Otherwise, returns:
  1. ; Piece 1: local XMZ
  1. ; Piece 2: originated here? (0=no; 1=yes)
  1. ; Piece 3: still exists? (P=no, purged;
  1. ; R=no, purged, & replaced with something else;
  1. ; E=yes, it still exists here)
  1. N XMZCHK,XMP1,XMP2
  1. S XMP1=$P(XMREMID,"@",1),XMP2=$P(XMREMID,"@",2)
  1. I XMP1=""!(XMP2="") Q ""
  1. S XMZCHK=$$FINDXMZ(XMP1,XMP2)
  1. I XMZCHK Q XMZCHK
  1. S XMZCHK=$$FINDXMZ(XMP2,XMP1)
  1. I XMZCHK Q XMZCHK
  1. Q ""
  1. FINDXMZ(XMP1,XMP2) ;
  1. I XMP1?.N!(XMP1?.N1"."7N) Q:XMP2=^XMB("NETNAME") $$LOCXMZ(XMP1) Q:$$FIND1^DIC(4.2,"","QX",XMP2,"B^C")=^XMB("NUM") $$LOCXMZ(XMP1)
  1. N XMZ
  1. TRY S XMZ=$O(^XMBX(3.9,"AI",$E(XMP2,1,64),$E(XMP1,1,64),0))
  1. I XMZ Q $$REMXMZ(XMZ,XMP2,XMP1)
  1. I XMP1?.N1"."7N S XMP1=$P(XMP1,".") G TRY
  1. Q ""
  1. LOCXMZ(XMZ) ; Message originated here.
  1. I XMZ'["." Q XMZ_"^1^"_$S($D(^XMB(3.9,XMZ,0)):"E",1:"P")
  1. ; The following code won't activate until MailMan message IDs contain
  1. ; dates. Message IDs are created in $$NETID^XMS3.
  1. N XMCRE8
  1. S XMCRE8=$P(XMZ,".",2),XMZ=$P(XMZ,".",1)
  1. Q XMZ_"^1^"_$S('$D(^XMB(3.9,XMZ,0)):"P",$P($G(^XMB(3.9,XMZ,.6)),U,1)=XMCRE8:"E",1:"R")
  1. REMXMZ(XMZ,XMP2,XMP1) ; Message originated somewhere else.
  1. I '$D(^XMB(3.9,XMZ,0)) Q XMZ_"^0^P"
  1. N XMREMID
  1. S XMREMID=$G(^XMB(3.9,XMZ,5))
  1. I XMREMID="" Q XMZ_"^0^R"
  1. I XMP1_"@"_XMP2=XMREMID Q XMZ_"^0^E"
  1. I XMP2_"@"_XMP1=XMREMID Q XMZ_"^0^E"
  1. Q XMZ_"^0^R"