Re: Qmail qfilter problem

nitin bhadauria <[email protected]> Sat, 25 Sep 2010 09:57:13 +0530
Newsgroups gmane.comp.sysutils.bgware
Message-ID <[email protected]>
Hi Bruce,

Here is a mail header ..

From: dailyreport <[email protected]>
To: "XYZ" <[email protected]>
Subject: Re: EXAMPLE
Date: Fri, 17 Sep 2010 19:00:47 +0530

But the mail get delivery to [email protected]

No it isn't a secret here is the file ..

cat /var/qmail2/bin/qmail-read

#!/bin/bash
ORGUID=`/usr/bin/uuidgen`
INSPECT_DIR=/var/tmp/qmail-qfilter
cd $INSPECT_DIR || { echo Error: $INSPECT_DIR does not exist; exit
$EX_TEMPFAIL; }
cat > $INSPECT_DIR/in.$ORGUID || { echo Error: Cannot write to disk; exit
$EX_TEMPFAIL; }
TEST=$(grep "From: dailyreport" $INSPECT_DIR/in.$ORGUID)
if [ $? -eq 0 ]
then
ORGSUB=`cat /var/tmp/qmail-qfilter/in.$ORGUID |grep "Subject: " |sed
's/Subject: //'g`
ORGTO=`cat /var/tmp/qmail-qfilter/in.$ORGUID |grep "To: " |sed 's/To: //'g`
echo "INSERT INTO readtracking values ('"$ORGUID"', '"$ORGTO"', '"$ORGSUB"',
NOW(), '', '', '', '');"| mysql -u readtrack -preadtrack readtrack
sed -i '/rt.php?uuid/ c\<img
src="http://mail.example.com/rt.php?uuid='"$ORGUID"'"
width="168" height="54" border="0">' /var/tmp/qmail-qfilter/example.html
cat $INSPECT_DIR/in.$ORGUID |sed '/^Content-Type: text/ c\Content-Type:
text\/html;' | /usr/bin/perl -pe 's/Dear Valued Customer,/`cat
example.html`/e' > /tmp/temp123 ; mv -f /tmp/temp123 $INSPECT_DIR/in.$ORGUID
cat $INSPECT_DIR/in.$ORGUID
echo $QMAILRCPTS > /tmp/tests
rm in.$ORGUID
exit $?
else cat $INSPECT_DIR/in.$ORGUID
rm in.$ORGUID
exit $?
fi

Regards,
NItin B.

On Sat, Sep 25, 2010 at 12:39 AM, Bruce Guenter <[email protected]>wrote:

> On Fri, Sep 24, 2010 at 01:04:38PM +0530, nitin bhadauria wrote:
> > Now my problem is that some of mails getting delivered to wrong mail-id.
> >
> > #!/bin/sh
> > exec /usr/local/bin/qmail-qfilter env -u QMAILNAME -u QMAILRCPTS -u
> > QMAILUSER -u QMAILHOST /var/qmail2/bin/qmail-read
>
> Also, unless it is supposed to be a secret, posting the actual
> qmail-read source would be helpful.
>
> --
> Bruce Guenter <[email protected]>                http://untroubled.org/
>