procmail
[Top] [All Lists]

Re: How can I munge a To: line

1997-04-17 16:22:00
Simeon Nevel asked,

| I forward a lot of mailing list mail from my ISP acct to work.
| Unhappily, I'm being forced to use M$ Exchange <spit> as my MUA there ...

| Among other "endearing" traits is that it takes To: lines in the 
| form of:
| 
|     To: Multiple recipients of <listname(_at_)list(_dot_)com>
| 
| and changes them to:
| 
|     To: Multiple recipients of

| This, of course, makes it impossible to sort out about 1/2 my
| list mail once it reaches me at work. 

Are there no other headers that identify the list, such as From_, Sender:,
Resent-Sender:, or X-Mailing-List:, which arrive at work intact?

|        >>>> Procmail at work is *not* an option <<<<

What, then, do you use to sort at work?  Elm's filter?

| How can I use proc/formail to munge the To: line at the top of my
| .procmailrc and then let the munged mail be handled by the rest of
| my recipies?

Don't rule out getting a new job.  Some employment conditions are legally
classified as intolerable.

| Ideally, the resulting To: line should look thusly:
| 
|     To: listname(_at_)list(_dot_)com

Well, let's see.

 :0fwh
 * ^To: Multiple recipients of <\/[^>]+
 | formail -i "To: $MATCH"

but I'd tend to feel that, rather than let the software at work do yet other
horrid things to your forwarded mail, you might want to put copy the entire
head into the body for safekeeping:

 :0fwh
 * ^^\/(.+$)+$
 | cat ; echo ">$MATCH"
 
or if you're hot to save a shell,

 :0fwh
 | sed -e 1h -e 1!H -e '$ G'

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