Kevin Miller gave me the missing piece. A long time ago I came to the
conclusion that the file had to be encoded. I didn't realize the POSIX
side had a uuencode program, this made it easy to solve the problem.
So for those that are intrested in the command file I've tacked it onto
the end. It assumes that the file being sent is a flat MPE file. Also
thanks to Mark Bixby for writing the original MAILSPF that I used as a
basis.
-Lane
--------------------------
parm recipients=!HPUSER.!HPACCOUNT,&
subject='HP3000 file',&
fname,&
dest_fname="!fname"
comment This is a stripped down version of Mark Bixby's MAILSPF. MAILFILE
comment will send a specified file as an uuencoded attachment
comment Syntax:
comment
comment mailfile recipients="[log in to unmask], [log in to unmask], ...",
comment subject="subject header of e-mail message",
comment file="name of the file to send",
comment mailf_fname="name of the destination file"
comment
comment MAILFILE and
comment MAILSPF was developed under MPE/iX 5.5 PowerPatch4 and uses
Sendmail/iX
comment (http://www.cccd.edu/~markb/sendmailix.html) as a mail transport.
Note
comment that other mail transports may be used as long as the transport
will
comment accept a fully formatted message that includes headers.
comment
comment Where to obtain the oringal MAILSPF CI command file:
comment
comment http://www.cccd.edu/ftp/pub/mpe/mailspf
comment or
comment ftp://ftp.cccd.edu/pub/mpe/mailspf
comment
comment How to contact the MAILSPF author:
comment
comment Mark Bixby
comment Coast Community College District
comment District Information Services
comment 1370 Adams Ave
comment Costa Mesa, CA 92626-5429
comment voice: +1 714 438-4647
comment email: [log in to unmask]
comment web: http://www.cccd.edu/~markb
comment
comment Change History
comment
comment 1.0 April 8, 1998
comment
comment Initial public release.
comment
comment Check to see if the file to send exists
comment
if FINFO( "!fname","exists") = FALSE then
echo File does not exist
return
endif
comment
comment Purge the mail message temp file if it exists.
comment
file mailfm,oldtemp
if FINFO('*mailfm','exists') then
purge mailfm,temp
endif
comment
comment Start creating the message as a temp file.
comment
build mailfm;temp;rec=,,b;disc=2147483647
comment Generate a MIME boundary string.
setvar mailf_sep RHT(RPT('-',36)+"!HPSUSAN!HPPIN!HPCPUMSECS",36)
comment Generate a temorary file name
setvar mailf_fname "/tmp/mf!HPSUSAN!HPPIN!HPCPUMSECS"
comment
comment Generate all of the message headers.
comment
echo To: !recipients>*mailfm
if HPJOBNAME = '' then
setvar mailf_from &
'"#!HPJOBTYPE!HPJOBNUM !HPUSER.!HPACCOUNT" !<!HPUSER.!HPACCOUNT!>'
else
setvar mailf_from &
'"#!HPJOBTYPE!HPJOBNUM !HPJOBNAME,!HPUSER.!HPACCOUNT"
!<!HPUSER.!HPACCOUNT!>'
endif
echo From: !mailf_from >>*mailfm
echo Subject: !subject>>*mailfm
echo MIME-Version: 1.0>>*mailfm
echo Content-Type: multipart/mixed; boundary="!mailf_sep">>*mailfm
echo >>*mailfm
comment
comment Generate the preamble (not normally displayed by MIME mail
clients).
comment
echo This is a multi-part message in MIME format.>>*mailfm
comment
comment Generate the first body header
comment
echo --!mailf_sep>>*mailfm
echo Content-Type: text/plain; charset=us-ascii; name="!dest_fname"&
>>*mailfm
echo Content-Transfer-Encoding: x-uuencode>>*mailfm
echo Content-Disposition: Attachment; filename="!dest_fname" >>*mailfm
echo >>*mailfm
comment
comment uuencode the file and appened it
comment
xeq tobyte.hpbin.sys "-at !fname !mailf_fname"
xeq uuencode.hpbin.sys "!mailf_fname !dest_fname" >>*mailfm
purge !mailf_fname
comment
comment That's all, folks.
comment
echo --!mailf_sep-->>*mailfm
comment
comment Mail the message.
comment
xeq SENDMAIL.PUB.SENDMAIL "-t" <*mailfm
comment
comment Clean up.
comment
purge mailfm,temp
reset mailfm
deletevar mailf_@
|