procmail
[Top] [All Lists]

Re: forwarding with the use of procmail

1997-06-12 12:06:00
Mike Fisher asked,

| I've been trying something out lately:  forwarding short emails that are
| addressed to me (no mailing lists, aliases, etc) to my pager.  It has been
| working for the most part, except for one slight problem.  All the mail
| that gets forwarded to the pager says that it is "from" me.  Would there
| be a way to retain the original sender's name?
| 
| Here is the section of my .procmailrc that is pertinent (this is the last
| recipe in the file):
| 
| :0 c
| * ^TOmfisher
| * < 800
| ! 2168903460(_dot_)pager(_at_)usamobile(_dot_)com
| 
| Any help would be appreciated.

The problem is that your pager software was written by someone who didn't
understand the distinction between From_ and From:.  It should be fixed to
display the From: address of the forwarded item (which should be unchanged
from the incoming message as it arrived at harborcom.net, or whatever site
is forwarding it, and should still name the original sender) instead of the
From_ address (which, on a forwarding leg, should name the most recent
forwarder).

If the pager software also sends some of the text from the body, you can
get around its bug by copying the From: information to the top of the
body while it's going through your .procmailrc:

 :0c # ^TO_ is probably preferable to ^TO if your version supports ^TO_
 * ^TOmfisher
 * < 800
 {
# Usually we copy header lines into the body by appending them after the
# blank line at the neck with a head-filtering recipe, because on most
# mail the head is shorter than the body, but here we know we are dealing
# with mail where the body is shorter than the head, so we'll filter the
# body and add the line at the top.

  :0bfw # extract in clone so as not to clobber the parent's value of $MATCH
  * ^From: *\/[^ ].*
  | sed "1i\\
$MATCH\\
"

  :0
  ! 2168903460(_dot_)pager(_at_)usamobile(_dot_)com
 }

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