Subject: Re: How to forward a user's old mail to her new address

From: [email-masked] (David W. Tamkin)
Date: Thu, 12 Jan 1995 18:37:20 -0600 (CST)

Elmar Kurgpold asked,

| How do I forward all the messages in a file to some new e-mail address? 
| 
| A user has ~300 messages in her old inbox, and has temporarily moved to
| another address.  I'd like to bounce her old mail to her new address.  I
| assume that the Right Way would also include adding Resent-Date,
| Resent-From, and Resent-To headers.  I've never really understood formail,
| but I think it's what I need to use.  Could some kind soul tell me how 
| it's done, so I don't break things?

For a limited redistribution like this you wouldn't need to muck with Resent-
headers.  This should be enough:

First, make sure her old address has a .forward or something to send all
future mail to her new address.  Then,

 lockfile oldinbox.lock
 formail -ns /usr/lib/sendmail newaddress < oldinbox
 : > oldinbox # or whatever it takes to truncate a file to zero in your shell
 rm -f oldinbox.lock

| Thanks a million.  Please reply by e-mail, I'm currently unsubscribed to 
| the list.

I'm carboning the list; it's that kind of day.  If you see this on the list
and I've made a mistake you can correct, please be sure to carbon Elmar.

David W. Tamkin  Box 3284  Skokie, Illinois  60076-6284
[email-masked]    MCI Mail: 426-1818   +1 312 714 5610

---

From: [email-masked] (David W. Tamkin)
Date: Thu, 12 Jan 1995 21:41:12 -0600 (CST)

Not realizing Elmar had carboned the list, I answered him privately, so here
it is again for public consumption:

| Thanks, David.  I had some questions....
| 
| On Thu, 12 Jan 1995, David W. Tamkin wrote:
| 
| >  lockfile oldinbox.lock
| >  formail -ns /usr/lib/sendmail newaddress < oldinbox
| >  : > oldinbox # or whatever it takes to truncate a file to zero in your shell
| >  rm -f oldinbox.lock
| 
| This seems to work for small folders, but when I tested the larger folder,
| sendmail dumped core and queued most of the messages.  Would it be a good
| idea to sleep a few seconds between each message-- and is this possible? 

I guess the -n option for formail was a bad idea.  To get a pause in between,

formail -s sh -c 'sleep 5 ; /usr/lib/sendmail newaddress' < oldinbox &

---

From: [email-masked] (jesse montrose)
Date: Thu, 12 Jan 1995 20:06:47 -0800

>This seems to work for small folders, but when I tested the larger folder,
>sendmail dumped core and queued most of the messages.  Would it be a good
>idea to sleep a few seconds between each message-- and is this possible? 

You can add a -q to the sendmail command.

____________________________________________________________________________
jesse montrose           [email-masked] http://www.hooked.net/people/jesse/
                        I don't recycle.  I'm a consumer, damn it, I consume