[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

3498.0. "Convert outbound msgs totally to ASCII?" by GANTRY::HULL (Digital Consulting [Delivery]/Motown) Fri Nov 05 1993 16:44

We are trying to change an external mail interface as described below and I
need some pointers on where to "hook in" to the code.

Details:  Our site uses a long-standing corporate mail interface for
external (to A1) mail destinations, like US Mail Zipgrams, Telexs, FAXes,
and PROFS.  Before you say it, we do not have and cannot use MR/P, so drop
that thought right away.  The old interface is 2 ALL-IN-1 SDF's linkedinto
the image.

This site is getting heavily into using a SMTP mail gateway. The customer
wrote an MRIF application that is a mailbox called EMS_MBX.  It allows any
user to send outbound mail (one-way only, no replies allowed) via SMTP.

We have found that in switching from the old EMS system to the SMTP gateway
(which is a pure Message Router connection), that WPS-PLUS documents sent
from the WP menu cause the EMS_MBX code to blow up.  The mailbox can only
handle ASCII format.  EM msgs with EM Attachments get converted to ASCII ok
(apparently) since we have OA$MTI_TRNS set to '1', but in the manual it
says that WP "Documents" sent using the WP Send option (as attachments)
still don't get translated.

My SPECIAL.CMU routine is intercepting and prompting correctly for the EMS
PROFS addressees, etc, but how do I intercept, scan for an EMS PROFS
addressee, and convert the outbound mail *and attachments* going to this
SMTP gateway into ASCII before it gets to the MR mailbox?  Is there any way
to convert the existing mail message and all its attachments to ASCII
"in-place"?  I know how to do

	copy  "@oa$curdoc"  #new_mailfile  "ASCII"

-this is a different issue, I think, moreone of WHEN the conversion takes
place, not HOW.

	Al
T.RTitleUserPersonal
Name
DateLines
3498.1Recursive mail?GANTRY::HULLDigital Consulting [Delivery]/MotownFri Nov 05 1993 20:59119
Tried some experiments on this with mixed results.

First, I address a msg to _/PROFS and I get prompted for the Profs user id.
 I enter ADHULL1.  SPECIAL.CMU calls SPECIAL_MAIL.SCP and it produces

TO:  PROFS addressee		( [email protected] @SMTP )


where I purposely leave the leading underscore to force SPECIAL.COM
processing on the Send so I can intercept the msg.

SPECIAL.COM calls  SPECIAL_SEND.SCP where I do the following:

.label start
! see if its a SMTP PROFS Address - if so use new code

.if #mailaddr <=> "@engrg1.pms.ford.com" or #mailaddr <=> "@EMS_MBX" -
        then .goto SMTP_style

  ...[other code]

.label SMTP_style
! create an ASCII output filename
        get #new_mailfile = "oauser:smtp_mail_out.txt"
! copy contents of original WPS-PLUS msg & att's to ASCII file
        copy  "@oa$curdoc"  #new_mailfile  "ASCII"

! build the header
        get #subject = #mailsubj
! strip off the leading underscore on the "real" address
        get #to = #mailaddr::1

! force the filename to be a .TXT file for ASCII format
        get #fname = 'smtp' oa$date_nbs '.txt'
        get oa$function = 'mail create/open/nosend/fname=' #fname
        mail to #to
        mail subject #subject
        mail text "Message sent via SMTP Mail Gateway"
        mail close_message
! does this dump need to be here??
        dump_cache
! add content of original msg, etc to the newly-created ASCII msg
        append/file #new_mailfile oa$curdoc_filename
        mail send
! delete this message
        cab delete_document
! clean up the ASCII outfile
	delete_file oauser:smtp_mail_out.txt
        .exit
----------------

This seems like it out to work pretty straightforward.  But it tries to
send my message to BOTH the correct address (without the underscore) and to
the addr WITH the underscore (not wanted).

This gets difficult to track what's happening because I'm actually Sending
1 message (the original) and creating and sending ANOTHER ASCII version of
it at the same time.  I thought if SPECIAL handling got triggered for any
addressee line, then all processing had to be handled in the SPECIAL_*
scripts/command files, and in the case of multiple valid addresses, as the
Mail Send code looped though the cab$attributes:TO etc it would then move
on to the next name as soon as the special code was finished.

I'm also getting an error at the end of this script:

"Already in command file - Press EXIT to return to that command"

What command file?  SPECIAL.COM?  Why would it think something is still
"in" the comfile?

Here's the output this code creates, and it also gives me back a POSTMASTER
delivery failure. on the underscore address string.

------------------------------------- TOP ------------------------------------

 E   L   D   -   P   E   O    M E M O R A N D U M


                                        Date:     05-Nov-1993 02:36pm EST
                                        From:
                                                  HULL@A1
                                        Dept:
                                        Tel No:

TO:  [email protected]@SMTP@EEDVAX


Subject: test #7

Message sent via SMTP Mail Gateway

 E   L   D   -   P   E   O    M E M O R A N D U M


                                        Date:     05-Nov-1993 02:35pm EST
                                        From:     Al Hull
                                                  HULL
                                        Dept:     K8190
                                        Tel No:   313-845-4509

TO: *Al Hull                              ( HULL )
TO:  PROFS address                        ( [email protected] @SMTP )


Subject: test #7

BOLD letters underlined text
----------------------------------- NEW PAGE ---------------------------------

[This is just a junk attachment]

         $ RUN SYS$SYSTEM:DMU
         DMU> SHOW PROTECTION CDD$TOP

         The resulting privileges list should include the following:

         CONTROL          GLOBAL_DELETE