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

XMXREPLY.m

Go to the documentation of this file.
  1. XMXREPLY ;ISC-SF/GMB-Reply to a msg ;04/24/2002 10:29
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. REPLYMSG(XMDUZ,XMK,XMKZ,XMBODY,XMINSTR,XMZR) ;
  1. ; XMDUZ DUZ of who the msg is from
  1. ; XMBODY Body of the msg
  1. ; Must be closed root, passed by value. See WP_ROOT
  1. ; definition for WP^DIE(), FM word processing filer.
  1. ; XMINSTR("FROM") String saying from whom (default is XMDUZ)
  1. ; XMINSTR("STRIP") String containing chars to strip from msg text
  1. ; XMINSTR("SCR HINT") Hint to guess the scramble key
  1. ; (must be the hint from original message)
  1. ; XMINSTR("SCR KEY") Scramble key, if original message was scrambled.
  1. ; (must be the key from original message, as
  1. ; entered by the user: unscrambled!)
  1. ; *NOTE: SCR hint and key needed only for remote replies. Even then,
  1. ; they are ignored. That info is gotten from the original msg.
  1. ; XMINSTR("NET REPLY") Should reply go over the network? 1=yes; 0=no
  1. ; XMINSTR("NET SUBJ") Subject for network reply msg, else default to
  1. ; "Re: original msg subject"
  1. ; XMZSENDR XMDUZ of the person who created and sent the msg
  1. ; If you are not a recipient or the sender, you may not reply.
  1. ; If msg is in SHARED,MAIL and your DUZ is .6, ERROR! G H^XUS ***
  1. ; If msg is info only AND you are not the sender, you may not reply.
  1. ; If msg is info only and broadcast to all local users, may not reply
  1. ; If you are info only, you may not reply.
  1. ; If msg is from a remote POSTMASTER, may not reply.
  1. ; If msg is in waste basket or no basket, move it to a basket.
  1. ;
  1. ; Output:
  1. ; XMZR msg # holding the reply to XMZ
  1. N XMZ,XMZREC,XMZSENDR,XMNETMSG
  1. K XMERR,^TMP("XMERR",$J)
  1. D CHKMSG^XMXSEC1(XMDUZ,.XMK,.XMKZ,.XMZ,.XMZREC) Q:$D(XMERR)
  1. Q:'$$REPLY^XMXSEC(XMDUZ,XMZ,XMZREC)
  1. D:XMK<1 FLTR^XMXMSGS2(XMDUZ,XMK,$S(XMK=.5:$$EZBLD^DIALOG(37004),1:""),XMZ) ; Move msg from WASTE basket
  1. D CRE8XMZ^XMXSEND("R"_XMZ,.XMZR) Q:$D(XMERR) ; Create a place for the response in the msg file
  1. D MOVEBODY^XMXSEND(XMZR,XMBODY) ; Put the msg body in place
  1. D CHEKBODY^XMXSEND(XMZR,$G(XMINSTR("STRIP")))
  1. D DOREPLY(XMDUZ,XMZ,XMZR,.XMINSTR)
  1. S XMZSENDR=$P(XMZREC,U,2)
  1. S XMNETMSG=$S(XMZSENDR["@":1,1:0)
  1. I 'XMNETMSG!'$G(XMINSTR("NET REPLY")) Q
  1. N XMFROM,XMREPLTO
  1. D REPLYTO(XMZ,.XMFROM,.XMREPLTO)
  1. D INIT^XMXADDR
  1. S XMINSTR("EXACT")=1 ; Match on exact domain name
  1. D CHKADDR^XMXADDR(XMDUZ,$$REMADDR^XMXADDR3($G(XMREPLTO,XMFROM)),.XMINSTR)
  1. K XMINSTR("EXACT")
  1. D:'$D(XMERR) NETREPLY(XMDUZ,XMZ,XMZR,$S($G(XMINSTR("NET SUBJ"))'="":XMINSTR("NET SUBJ"),$E($P(XMZREC,U,1),1,4)=$$EZBLD^DIALOG(37006):$E($P(XMZREC,U,1),1,65),1:$E($$EZBLD^DIALOG(37006)_$P(XMZREC,U,1),1,65)),.XMINSTR) ;Re:
  1. D CLEANUP^XMXADDR
  1. Q
  1. DOREPLY(XMDUZ,XMZ,XMZR,XMINSTR) ;
  1. D:$D(XMSECURE) ENCMSG^XMJMCODE(XMZR) ; Scramble the msg, if needed
  1. D MOVER(XMDUZ,XMZ,XMZR,.XMINSTR) ; Point from response back to original msg
  1. D RPOST^XMKP(XMDUZ,XMZ,XMZR) ; Point from original msg to response and send the msg
  1. D CHECK^XMKPL
  1. Q
  1. NETREPLY(XMDUZ,XMZ,XMZR,XMZRSUBJ,XMINSTR) ;
  1. N XMFDA,XMIENS
  1. S XMIENS=XMZR_","
  1. S XMFDA(3.9,XMIENS,.01)=XMZRSUBJ
  1. I $D(XMSECURE) D ; Scramble hint / Scramble key
  1. . S XMFDA(3.9,XMIENS,1.8)=$P(^XMB(3.9,XMZ,0),U,10) ;XMINSTR("SCR HINT")
  1. . S XMFDA(3.9,XMIENS,1.85)=^XMB(3.9,XMZ,"K") ;XMINSTR("SCR KEY")
  1. I $G(^XMB(3.9,XMZ,5))'="" D ; In response to remote msg id
  1. . S XMFDA(3.9,XMIENS,9.5)=$E(^XMB(3.9,XMZ,5),1,110)
  1. D FILE^DIE("","XMFDA")
  1. D SEND^XMKP(XMDUZ,XMZR)
  1. Q
  1. MOVER(XMDUZ,XMZ,XMZR,XMINSTR) ;
  1. N XMFDA,XMIENS
  1. S XMIENS=XMZR_","
  1. I $D(XMINSTR("FROM")) D
  1. . S XMFDA(3.9,XMIENS,1)=XMINSTR("FROM")
  1. . ;S XMFDA(3.9,XMIENS,1.1)=DUZ
  1. E D
  1. . S XMFDA(3.9,XMIENS,1)=XMDUZ
  1. . S:XMDUZ'=DUZ XMFDA(3.9,XMIENS,1.1)=DUZ
  1. S XMFDA(3.9,XMIENS,1.4)=$$NOW^XLFDT()
  1. S XMFDA(3.9,XMIENS,1.35)=XMZ
  1. D FILE^DIE("","XMFDA")
  1. Q
  1. REPLYTO(XMZ,XMFROM,XMREPLTO) ; Get from and reply-to address, if any
  1. N XMHDR,XMFIND
  1. S XMFIND="^FROM^REPLY-TO^"
  1. D HDRFIND^XMR3(XMZ,XMFIND,.XMHDR)
  1. I $D(XMHDR("FROM")) S XMFROM=XMHDR("FROM")
  1. E S XMFROM=$P($G(^XMB(3.9,XMZ,0)),U,2) ; not really remote msg?
  1. I $D(XMHDR("REPL")) S XMREPLTO=XMHDR("REPL")
  1. Q
  1. REPLYTO1(XMZ) ;
  1. N XMFROM,XMREPLTO
  1. D REPLYTO(XMZ,.XMFROM,.XMREPLTO)
  1. Q $$REMADDR^XMXADDR3($G(XMREPLTO,XMFROM))