Proram Delivery

Greetings,

I have been trying to get Program Delivery to work for a long time with both scripts and binary executables. I always have the same problem.

The documentation states that Messaging server first starts the program, then "feeds" the message to the program. I have not figured out how that message is "fed" to the program.

Can anyone help me out on this. Any example source code would be warmly welcomed.

[446 byte] By [706052] at [2007-11-25 8:33:33]
# 1
as with the standard sendmail pipe mecanism, the entire mail is passed to your program via STDIN, so one of the first thing you program has to do is begin to read it's stdin to get the mail. it is the raw mail (headers, one empty line, body)
709035 at 2007-7-1 15:05:35 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 2

Hi,

here's a few tips that might help

1st. have a mail group or account have the mailprogramdeliveryinfo attribute set to the name of your registered program. here i am using an example of smsprog

2nd. register the program

/opt/iplanet/ims6.2/sbin/imsimta program -a -m smsprog -p sms/smsfilter.sh

To check

# ./imsimta program -l

==================================================

Method_name: smsprog

Program_name: /opt/iplanet/ims6.2/data/site-programs/sms/smsfilter.sh

Execute Permission : Postmaster

==================================================

3rd. In your program you need an entry like this:

FNAME=/tmp/SMS.$$.tmp

cat - >$FNAME

The cat line takes the email as stdin an feeds it into the variable FNAME (it can be any variable name)

You now have the whole message in text form, headers included.

You can then pull it apart for delivery e.g.

####### TAKE HEADERS FROM FNAME2 AND PUT IN FNAME #######

N2=`grep -n "^$" $FNAME2 | head -1 | cut -d":" -f1`

HEADERS=`head -$N2 $FNAME2`

echo "$HEADERS\n" > $FNAME

cheers

zk_nrc at 2007-7-1 15:05:35 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 3
Forgot one thing. maildeliveryoption also needs to be set to program in the user account ldap record
zk_nrc at 2007-7-1 15:05:35 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 4
Sorry, I've gotta ask, "what are you trying to do with program delivery"? It's possible that there's an easier/better way to do what you need.
jay_plesset at 2007-7-1 15:05:35 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...