procmail
[Top] [All Lists]

Re: Bouncing email shows contents of .forward

1997-08-01 06:03:00
era eriksson writes:

On Mon, 26 May 1997 15:12:06 -0700,
Bill Moseley <moseley(_at_)netcom(_dot_)com> wrote:
 > If I bounce email from Procmail using EXITCODE = 67 the sender receives the
 > bounced message back, but the message also contains the contents of my
 > .forward file.  For example, they will see:

This comes up from time to time. I think the consensus was to simply
generate your own bounce message. 

 (Or use procmail as MDA in sendmail.cf).
 
 Does this translate to: if you want to bounce a message without exposing
 .forward, you have to do it yourself with formail?

 Well then, I have created a recipe which emulates EXITCODE=77, and it
 works fine, except for two details.

 Bounced messages on our system are MIME-encoded and have the following header:

Content-Type: multipart/mixed; boundary="SAA09016.870370791/host"

 I seem unable to put in the "'s. formail called with

-A"Content-Type: multipart/mixed; boundary=\"SAA09016.870370791/host\""

 doesn't work, ie. the \" in the argument to -A. The logs tell me

Unmatched ".

What can I do? It works without the \"'s, but then I get only

Content-Type: multipart/mixed; boundary=SAA09016.870370791/host


 Here is the full recipe, with a description of the second problem
 embedded. This is all with procmail 3.11pre7 on SunOS 4.1.3 and
 Solaris 2.5.1.

:0c
# still testing ...
* ^Subject.*bounce test
* ^From.*me
* !^X-Loop: me(_at_)address
{
# First: save the full message
 :0c:
# TEMPORARY=/tmp/pmail.$$
 ${TEMPORARY}

 :0a
 | (formail -rb -I"In-Reply-To:" -I"References:" \
     -I"Subject: Returned mail: Insufficient permission: Error 0" \
     -A"MIME-Version: 1.0" \
     -A"Content-Type: multipart/mixed; boundary=\"SAA09016.870370791/host\"" \
     -A"X-Loop: me(_at_)address" ; \
    echo "This is a MIME-encapsulated message" ; echo "" ; \
    echo "--SAA09016.870370791/host" ; echo "" ; \
# BOUNCEDATE=`${GnuDate} '+%a, %d %b %Y %T +0100'`
    echo "The original message was received at ${BOUNCEDATE}" ; \
    echo "from {USER(_at_)HOST [IP]}" ; echo "" ; \

# The second problem: how do I get USER(_at_)HOST [IP]?
# I tried FROM=`formail -rt -xTo:` from procmailex(5) for the USER
# part, but it doesn't seem to work. Ideas? And, I don't like the
# idea of doing a DNS lookup in .procmailrc ...

    cat ${PMDIR}/bounce.msg ${TEMPORARY} ${PMDIR}/bounce.tail ; \
   ) | $SENDMAIL -t
}


 Thanks for any insights.