procmail
[Top] [All Lists]

Re: newbie need help.. attachment is causing problem

2002-11-16 12:40:10
On 15 Nov, David Wu wrote:
| Hi guys, really need help on this,
| I wrote a recipe for notifying myself that i have a new mail in my work
| mail box. I dont want to forward the work mail to my home mail box just so
| I can keep things simple.The recipe works fine, but if someone write me a
| email with attachmentthen the notification email delivery to my home mail
| box will not show the body which is just one line of text, " There is a
| new mail in my work mail box".  How can I fix this??Thank you very much
| guys.
| 
| 
| PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin
| #LOGFILE=$HOME/procmail.log
| #VERBOSE=on
| 
| 
| ########################################
| #  Auto-Notify users of new webmail    #
| ########################################
| 
| :0 h c
| * !^FROM_DAEMON
| * !^X-Loop: workmail(_at_)work
| * ^TO(workmail(_at_)work)
|| ( formail  -I"From: Admin User <admin(_at_)work>"\
|       -A"X-Loop: workmail(_at_)work" ;\
|       echo "There is a new mail in my work mail box" ) \
|| $SENDMAIL homemail(_at_)home
| 

Most likely, if you look at the raw message, the line "There is a new
mail in my work mail box" is appended at the end of the original message
which is otherwise intact. If the message is in MIME format, it will not
be visible.  Or maybe it'll render the entire message unreadable by the
MUA. I don't know which. At any rate, I gather from your statement
that you don't want to forward work mail home, that you want to toss the
original body (in the copy) and just send the one line notice. You
either have to filter the body (or generate a new message).

  :0 c
  * !^FROM_DAEMON
  * !^X-Loop: workmail(_at_)work
  * ^TO(workmail(_at_)work)
  {
    # munge body
    :0 fbiw
    | echo "There is a new mail in my work mail box"
    
    :0
    | ( formail  -I"From: Admin User <admin(_at_)work>" \
               -A"X-Loop: workmail(_at_)work" ) \
        | $SENDMAIL homemail(_at_)home
  }

  # original message continues untouched
  
You could also generate a new message, but then you'd loose the Subject:
and probably end up adding recipes to grab the original and add it to
the new message anyway.  Also, you might want to use "-i" instead of
"-I" to munge the From: header.  That way the original is changed to
Old-From: and you can see where the message originated.

-- 
Reply to list please, or append "8" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>