home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
shuff110.zip
/
BOUNCE.CMD
next >
Wrap
OS/2 REXX Batch file
|
1993-11-02
|
2KB
|
45 lines
/* Bounce.Cmd -- A REXX Script to bounce errant email */
/* in conjunction with IBM SENDMAIL */
'@ECHO OFF'
parse arg all_args
if ((word(all_args,1)='/H') | (word(all_args,1)='/h')) then do 1
say 'Bounce.Cmd - "bounces" email back to sender.'
say ''
say ' BOUNCE messagefile host-address return-to-address [ChildID#]'
say ''
return
end /* Do */
MailerName = 'Mailer-Daemon'
MessageFile = word(all_args,1)
HostAddr = word(all_args,2)
ReturnToAddr = word(all_args,3)
ChildID = word(all_args, 4)
if ChildID='' then ChildID='Bounce'
ToBeMailed = ChildID'.Tmp'
if MessageFile = '' then return
if HostAddr = '' then return
if ReturnToAddr = '' then return
CALL RxFuncAdd 'SysFileSearch', 'RexxUtil', 'SysFileSearch'
CALL SysFileSearch MailerName, MessageFile, HIts
if Hits.0>0 then return
'IF EXIST 'ToBeMailed' DEL 'ToBeMailed
CALL LINEOUT ToBeMailed, , 1
CALL LINEOUT ToBeMailed,'To: 'ReturnToAddr
CALL LINEOUT ToBeMailed, ''
CALL LINEOUT ToBeMailed, 'Ye Olde Mailer-Daemon@'HostAddr' hath determined that '
CALL LINEOUT ToBeMailed, ' your message hath been incorrectly addressed to a userid'
CALL LINEOUT ToBeMailed, ' that doth not exist.'
CALL LINEOUT ToBeMailed, ''
CALL LINEOUT ToBeMailed, 'Said undeliverable message is hereby returned unto your attention.'
CALL LINEOUT ToBeMailed, '----------------------------------------------------------------------'
CALL LINEOUT ToBeMailed
'TYPE 'MessageFile' >>'ToBeMailed
'DEL 'MessageFile
'SENDMAIL -af 'ToBeMailed' -f 'MailerName' 'ReturnToAddr
'DEL 'ToBeMailed