SPUG: Need a transparent email forwarding utility

Bill Campbell bill at celestial.com
Tue Sep 16 09:17:55 PDT 2008


On Tue, Sep 16, 2008, Tim Maher wrote:
>Can anybody recommend a module, script, or prefab application that
>provides transparent Email forwarding? What I need is something that
>will rewrite the headers so that mail sent to me at System A by
>Person #42 can be forwarded to me at my (Linux) system B, and allow
>me to hit "reply" to respond to Person #42 (instead of replying to
>/me/ at System A), to hit "group reply" and reply to all the original
>recipients, etc.

The perl Mail::Internet package provides all the tools necessary
to do things like this, and makes it easy to add/delete arbitrary
headers in messages.

use Mail::Internet;
# suck in message from standard input
my $msg = Mail::Internet->new([<>], Modify => 0, MailFrom => 'IGNORE');

my $sender = 'spammer at example.com';
my $address = 'somebody at example.com';
$msg->delete('Return-Path');
$msg->delete('From');
$msg->delete('Sender');
$msg->add('From', $sender);
open(SENDMAIL, qq(| /usr/lib/sendmail -f $sender $address));
$msg->print(*SENDMAIL);

Bill
-- 
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

Find out just what people will submit to, and you have found out the
exact amount of injustice and wrong which will be imposed upon them; and
these will continue until they are resisted with either words or blows, or
both. The limits of tyrants are prescribed by the endurance of those whom
they oppress. -- Frederick Douglass.


More information about the spug-list mailing list