Hi everyone,
I wrote the follwoing script to allow users of mobile phones to invite their
friends to join my mailing list, by entering their friends email in the body
of the message (this saves them $$ as they are charged for each email sent).
It works, but I'm sure that using $sendmailOPT -t `cat $Body` is sloppy
and sends out invalid email. I think a perl script to clean up the text
first would help. Any help appreciated- Thanks.
David M.
:0
* !^From:(_dot_)*(_at_)mydomain(_dot_)com
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop:(_dot_)*(_at_)mydomain(_dot_)com
{
:0cb
Body=| sed -e '1,/^$/!b' -e '/^$/r'
From=`formail -X'From:'|formail -zrxto`
:0h
| (formail -k -X "From:" -X "Subject:" -X "To:" -X "Reply-To:" \
-I "From: $From" \
-I "Reply-To: me(_at_)mydomain(_dot_)com" \
-I "Subject: Invitation" \
-I "Precedence: junk" \
-A "X-Loop: me(_at_)mydomain(_dot_)com" ; \
cat $HOME/mail/invite.txt ) | $SENDMAIL $sendmailOPT -t `cat
$Body`
}
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com