[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Resending received mail
I once had a procmail script saving to a file instead
of forwarding to another email address....
took a google search to figure out how to take a mail file
and pipe it into sendmail to a different email address...
formail -s is the trick! probably mentioned somewhere in an essential
unix book.... :)
how to take a text file that is emails and forward to an email box:
# cat /var/mail/mailfile | formail -s sendmail whatever@adomain.com
HOwever, I used this method to forward to ONE email address.
If using procmail, their are ways to extract an email address
from the header and resend to that address.....
I use the procmail port package, and that's where I got it:
# pkg_info | grep procm
procmail-3.22 filtering local mail delivery agent
# pkg_info -L procmail-3.22 | grep formail
/usr/local/bin/formail
/usr/local/man/man1/formail.1
Your solution probably depends on how your email
was stored on the OBSD.... one big file with sendmail...
lots of big files with sendmail... directories...
best of luck... as also mentioned somewhere you could get
fancy and do some testing to avoid loops,,,
what I would recommed is to first forward to a test user box/account
so as to not send thousands of emails the wrong way... - ooops.
On Mon, 23 Feb 2004, Chris Cameron wrote:
> Date: Mon, 23 Feb 2004 16:06:33 -0700
> From: Chris Cameron <chris@upnix.com>
> To: misc@openbsd.org
> Subject: Resending received mail
>
> Had an Exchange server die on me, and thanks to a spare computer and
> OBSD was able to put in a temporary server to prevent mail from
> bouncing.
>
> Now, I have a bunch of mail that needs to be redelivered to the restored
> Exchange server. Does anyone know of any clever way to resend this
> stuff?
>
> The only solution I've thought of is just going into the mbox files,
> remove the receiving headers and then just refeed it to sendmail.
>
> Problem with this is it required editing mail, which I'd rather not do
> (for privacy and time reasons).
>
>
> Any thoughts on this?
>
>
> Thanks,
> Chris