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

XMGAPI3.m

Go to the documentation of this file.
  1. XMGAPI3 ;WASH ISC/REW/LH-Deliver Broadcast Msg & Mark for Vaporization ;04/17/2002 08:59
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ; Entry points used by MailMan options (not covered by DBIA):
  1. ; ENT XMR-BROADCAST-VA-WIDE
  1. ; ENT XMYB-BROADCAST-VA-WIDE
  1. ENT(XMTO) ; Meant to be invoked by a server. Delivers a message
  1. ; either to all users or to a specific user.
  1. ; The message must have been sent by the POSTMASTER@DOMAIN.EXT.
  1. ; The AUTOMATIC DELETE DATE for this message is set for each user
  1. ; to be in 7 days; 30 days if sent to a specific user.
  1. ; The message is made 'information only' and 'closed'.
  1. ; XMTO *=to all users
  1. ; DUZ=to only one person -- typically .6 to route to SHARED,MAIL
  1. ; Variables set in the server invoker:
  1. ; XQSOP Server basket name
  1. ; XQMSG Message number
  1. ; XMFROM Who sent the message
  1. N XMDUZ,XMKN
  1. S (XMDUZ,DUZ)=.5
  1. S XMKN="S."_XQSOP
  1. I $P(XMFROM,"@")'["POSTMASTER"!($P(XMFROM,"@",2)'["FORUM.") D
  1. . D ERR1(XMDUZ,XMKN,XMFROM)
  1. E D
  1. . D SEND(XMDUZ,XMKN,XQMSG,XMTO,XMFROM)
  1. D CLEANUP(XMKN,XQMSG)
  1. Q
  1. SEND(XMDUZ,XMKN,XMZ,XMTO,XMFROM) ;
  1. K XMERR,^TMP("XMERR",$J)
  1. D INIT^XMXADDR
  1. D CHKADDR^XMXADDR(XMDUZ,XMTO)
  1. I $D(XMERR) D Q
  1. . D ERR2(XMDUZ,XMKN,XMTO,XMFROM)
  1. . K XMERR,^TMP("XMERR",$J)
  1. D FORCE(XMZ,$S(XMTO="*":7,1:30))
  1. D SEND^XMKP(XMDUZ,XMZ)
  1. Q
  1. FORCE(DA,XMDAYS) ; Set Info Only, Closed statuses, and Purge date
  1. N DIE,DR
  1. S DIE=3.9,DR="1.95///y;1.97///y;1.6///"_$$FMADD^XLFDT(DT,XMDAYS)
  1. D ^DIE
  1. Q
  1. CLEANUP(XMKN,XMZ) ; Successfully delivered message, so remove from Postmaster Server Basket
  1. D CLEANUP^XMXADDR
  1. D ZAPSERV^XMXMSGS1(XMKN,XMZ)
  1. Q
  1. ERR1(XMDUZ,XMKN,XMFROM) ; Send message back to sender if not POSTMASTER@FORUM
  1. N A
  1. S A(1)="You may not send a message to the "_XMKN_" server."
  1. S A(2)="Only the Postmaster at DOMAIN.EXT has this permission."
  1. D SENDMSG^XMXSEND(XMDUZ,"Sender of Message to Server Unacceptable","A",XMFROM)
  1. K XMERR,^TMP("XMERR",$J)
  1. Q
  1. ERR2(XMDUZ,XMKN,XMTO,XMFROM) ; Send a message back to sender if single recipient is invalid
  1. N A,I,J
  1. S A(1)="Your message to the "_XMKN_" server was not accepted"
  1. S A(2)="because the lookup for the recipient specified ("_XMTO_")"
  1. S A(3)="failed, with the following message:"
  1. S J=3,I=0
  1. F S I=$O(^TMP("XMERR",$J,XMERR,"TEXT",I)) Q:'I S J=J+1,A(J)=^(I)
  1. D SENDMSG^XMXSEND(XMDUZ,"Server Recipient Unknown","A",XMFROM)
  1. K XMERR,^TMP("XMERR",$J)
  1. Q